Playwright debug test to not close browser - visual-studio-code

I'm using playwright and vscode, especially the "debug test" function which pops up a real browser window to run the test. When it fails the test auto closes, how can I make it not auto close so that I can modify the test and also visually see what the state of the test is?

Related

Enable "Build fail, do you want to continue?" while running Java in VS Code

I accidentally pressed the always continue button when I got the "Build fail, do you want to continue?" box while running my java program. Now VS Code runs it even when there are errors and the box does not appear anymore. I need to know if there are any errors in my code before it runs, so how do I enable that option again?

How do I enter debug mode for my widget tests on Flutter in AndroidStudio?

When it comes to starting debug mode while deploying my app to my device in AndroidStudio the debug button is green and clickable:
If I however want to start debug mode for my tests it is greyed out:
Is there a way for me to enter debug mode to better understand why my tests fail?
It turns out that Debug mode is available when Debugging individual files but not when Debugging folders/All tests.
This means it requires adding a new run configuration (via edit configuration):
Click new configuration:
Select Flutter Test and end up at:
You need the Test scope All in file and can select the testfile that you want to debug and use the debugger with it.

Angular ng serve asking to open app and not working

Problem Statement
When I try to do ng s -o in my terminal for my Angular app, it says, "How would you like to open this?" inside a popup box where I can choose an app, but choosing an app doesn't work.
Image of Problem
When I try to choose an app, it displays code. When I chose Chrome in the popup box, this happens:
The image shows that when I run an app after ng s -o it just displays code. Also, the tab title in the browser says "ng" when the code shows. Another thing, there is no error in the terminal...
Expected Results
I want to run my Angular app with ng s -o.
Actual Results
The app doesn't serve and asks to open an app.
Note: I am using Visual Studio Code for this.
The problem was related to my cli. I was using PowerShell when I was running ng, and for some strange reason, PowerShell stopped running ng and was asking me to open an app to run the file. Even though this never happened to me before and I was using ng and PowerShell just fine before. Strange!
Now I am using CMD instead. It now runs perfectly. So, I switched cli's from PowerShell to CMD in my integrated terminal in Visual Studio Code and it started working.
I got the idea to switch cli's from this: https://github.com/Microsoft/vscode/issues/28541
npx ng serve -o works for me in visual studio code.
The problem was caused as the Vs code was using PowerShell mode. By changing it to default cmd mode, the ng commands started to work.
The steps to change from PowerShell to cmd mode is as follows:
Press Ctrl + Shift + P to show all commands.
Type profile in the displayed text box to filter the list.
Select Terminal: Select Default Profile.
You will be prompted to select your preferred terminal shell, you can change this later in your settings or follow the same process as we do now.

How to debug an interactive Node.js app in VS Code?

How do you run and debug an interactive Node.js app (one that prompts the user to enter STDIN on the console) in VS Code using a simple launch (F5). I have so far been running the app using node --inspect-brk . and then attaching VS Code. This works fine, but I'm just wondering if there's a faster way. If I look at the DEBUG CONSOLE pane, I can see the STDOUT, but I can't add input there.
Randy's comment was my answer with a link here. Thanks, Randy.
The solution is to configure the console value in your launch.json file. I added "console": "integratedTerminal" and now when I hit F5 I can jump to the integrated terminal (CTRL+<backtick>) and interact with my app.

How to debug Karma when it fails

How can I debug a failing Karma test?
I am running mocha+chai+sinon tests without a problem. If I try to run the tests with Karma I get a "Uncaught TypeError: Cannot read property 'call' of undefined" error and Karma stops running (I am using Webpack to transpile). The error seems to be with a Webpack loader, but the question is how to I debug this? As soon as I run the tests, karma fails and terminates.
How can I trace the karma execution?
You can configure karma to stay alive in the background. Just add the option singleRun: false to your karma config. If you're using grunt-karma, you can also additionally set the background: true option.
If you then start karma, the window which opens up should stay open. There should be a debug link which will open a second window. This window will stay open and you'll be able to re-run all the tests by just pressing F5 / refresh. Inside that window you can debug the whole stuff using the dev tools (usually opened by pressing F12) of your choice.