Setting default browser when debugging playwright tests - playwright

I am trying to figure out how to change the default browser when debugging playwright tests using VSCODE. Currently, in VSCODE when I run or debug it defaults to chrome. I want to change that to use webkit and cannot seem to find where that setting is.
Thank you in advance for your help
Christine

You should be able to set the default project (don't forget to also set it for the debug config)

Related

Cucumber testing on WSL2 not showing UI for Google Chrome

I'm testing my Rails project and there are some problems when the test is running.
cucumber features/test.feature
I have installed chromedriver for WSL2 and the test can run fine. However, the browser showing up is not rendered at all, it only has a border and transparent body like this.
I can still open google-chrome and it is displayed correctly. And the project used to work on WSL1. I can also take screenshots when testing, it's just that the browser's UI is not rendered.
I have installed the driver for GPU as stated in the WSL guide but the problem still persisted.
Has anyone encountered this problem and how can I fix it? Thank you very much.

How to stop browserlink.js and aspnet-core-browser-refresh

Why do I have all this junk in my console, only when using VS 2022?
I set Options -> Projects and Solutions -> ASP.NET Core -> Auto build and refresh options -> NONE
And also disabled 'browser link' here:
None of that stuff appears when running the same project in VS 2019, and I'm pretty sure its messing with my SignalR connections
For anyone using dotnet cli tool and want to disable the hot reload and console output whatever, and have no luck with dotnet watch --no-hot-reload, try put this at the very start of your js script:
function removeDotnetHotReload() {
const scriptInjectedSentinel = '_dotnet_watch_ws_injected'
// #ts-ignore
window[scriptInjectedSentinel] = true
}
removeDotnetHotReload()
For aspnet-core-browser-refresh, can you please file an issue at https://github.com/dotnet/sdk, as that's where that code lives?
For Browser Link, I can tell you that right now there's no way to disable those messages in a .NET 6 app without turning off CSS Hot Reload as well (you can turn verbose messages off in the console so they won't show, but they'll still be emitted). If you are ok turning off CSS Hot Reload, you can do that in Tools->Options->Projects and Solutions->ASP.NET Core. Please file feedback at Developer Community about this as well so we can potentially make this more discoverable.
That said, I'm curious why you think this might be interfering with your SignalR connections. If there is interference there, we definitely want to address that as well, but I'm not sure off the top of my head why that would be.
Per https://developercommunity.visualstudio.com/t/Browser-Link-cannot-be-disabled/1582653#T-N1608441, adding "hotReloadEnabled": false to your launchSettings.json profile(s) should suppress the injection of these scripts by Visual Studio. This does not actually turn off C# hot reloading - just turns off the scripts that MSFT injects.

Debugging a Dart WebApp with Launch target "URL" fails

I am using Dart Editor r22223 to debug a WebApp. If I launch the HTML file debugging works but if I open the HTML via URL (in my case that's http://localhost:8080/samplewebappohnewebui.html) then debugging seems not possible.
I am able the set breakpoints but the debugger does not stop at the breaktpoints.
Any hints?
[Update]
The reason for serving the HTML-file on 8080 is that the HTML file is build by Velocity...
[Update 2]
OK - I added my Dev-Configuration. In the background there is Eclipse running Jetty on 8080 but I am using Eclipse only for the Java things - not for Dart. For Dart I am using Dart-Editor.
[Update 3]
[Update 4]
Console shows message on clicks but the breakpoint does not stop the program at line 16...
Seems like the issue isn't really fixed.
As a workaround, you can serve the page at the same URL the "normal" launch would have (the "HTML file" field in the run configuration)
In your case, this would be http://localhost:8080/JRelais.Server.REST/WebContent/samplewebappohnewebui.html‌​
I also filed a new bug report addressing this problem, as I don't think the old one will ever be reopened.

How to prevent Firefox from starting in safe mode?

Running a Rails test suite with Selenium often opens Firefox with the "Start in Safe Mode?" dialog. Is there a way to either 1) disable this, or 2) add a script that will answer "No" if the dialog appears?
It appears to be related to some open Firefox issues. Please see here:
Disable/Change Firefox Safe Mode Hotkey (Shift)
If you're looking for an alternative to selenium and Firefox, I've had success with PhantomJS (a headless WebKit browser) and the poltergeist gem.
For 1)Disable this:
You can create your own custom profile.
For 2)Add a script to answer 'NO'
Use Autoit to write a script for answering NO and use that in your selenium program.

Rails how to automatic check if a link is broken?

How is it possible to automatic check if a link is broken?
What is the best solution (Screenscraping or other)
You could try selenium which is an automated testing framework.
You could also try monit which is a monitoring application (daemon). Sometimes I just use that service to check if a particular website or link is up. You can set it to check periodically.

Resources