Closed reallymello closed 1 year ago
This is because Google have changed the way headless works. we have sorted that internally because we defer things to Selenium but we need to update our template to remove that.
Thanks! The world makes sense again.
Description of the bug/issue
When I use a chrome environment profile that has --headless in the args collection I expect the test to run in headless mode the same as if I were to use the default environment and pass --headless as a CLI argument, but I notice the tests hang in the former, especially around multiple window scenarios.
Steps to reproduce
Assuming your nightwatch.conf.js has the default environment profiles for chrome
uncomment all the args except --allow-insecure-localhost
Run the test
npx nightwatch -e chrome
. The test seems to hang in the script around code where a new window is launched, handles are grabbed, then the new handle is switched to.It seems like getCurrentUrl is what hangs and eventually times out.
The same test, run using
npx nightwatch --headless
works without issue. I am not sure why headless when used in the chrome environment behaves differently than chrome with the --headless CLI argument.Sample test
Command to run
Verbose Output
Nightwatch Configuration
Nightwatch.js Version
3.1.3
Node Version
18.5.0
Browser
116.0.5845
Operating System
Windows 11
Additional Information
No response