-
Notifications
You must be signed in to change notification settings - Fork 675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
experimental-multiple-windows fails with Error: WebSocket connection closed on completion of some tests #8377
Comments
I updated the source code in the issue above to remove use of resizeWindow which is listed as not supported for --experimental-multiple-windows. |
FYI: My workaround was to call testcafe using the --test "testname" parameter for each individual test that needs multiple windows.
I did this using find, perl, and xargs. Your milage may vary.
We have auth and public tests which need to be executed separately, which is why the regex in the perl single line matches but doesn't capture auth, so that it only finds the right tests. |
Hello, Thank you for reaching out to us. I tried to run your example and encountered a different error related to invalid date creation. After a bit of debugging, I found that the buttonDate is invalid. The test also contains a significant amount of code that is unrelated to the issue. Additionally, try to place the await before the Selector, like so:
Please remove any unnecessary code and provide a minimal, updated version of the test so I can further investigate the issue. |
I have replaced the test script in the issue with a newly created minimal test script that shows the issue without extra code. |
We appreciate you taking the time to share information about this issue. We reproduced the bug and added this ticket to our internal task queue. We'll update this thread once we have news. |
Hello, |
Sorry for the delay responding I lost power due to a weather event.
|
Hello,
I wasn't able to reproduce the issue you're describing. Still, we need a way to reproduce the problematic behavior in order to help you. Could you please confirm that you have the same environment? |
I built a new Ubuntu desktop virtual machine (within VirtualBox), applied updates via apt, installed Node Version Manager and Node 24, Testcafe, Chrome. rebooted, and then ran the tests. The test fails, either 2/3 or 3/3 due to web sockets being closed. To check if it was a VirtualBox issue, I installed NodeJS onto my host (Windows 11), TestCafe and tried again. All versions (except Windows) matches the version numbers listed above. I can't think what the reason could be between your working config and my failing config. I did not have a VPN or Proxy configured for the tests. I am running the tests locally. When I run a CI suite (against a local instance of PhotoPrism instead of the demo), it fails occasionally. |
Hello, we still cannot reproduce the issue. We tried to reproduce it on different machines, but TestCafe executes tests as expected every time. This time, I ran my tests with the following configuration: Could you please confirm that you use Testcafe 3.7.2? Also, please share your package.json, as I see that you used the following:
I need to see what script you use for testcafe. With this information, we'll be in a better position to reproduce the issue. |
I found a way to get the tests to always work. Add the flag --skip-uncaught-errors.
Without that flag, they almost always fail for me. I have had one test run which didn't fail tonight in testing, amongst the 50 odd that I have run. I tried debugging via --inspect-brk and noticed that the unhandled promise mentions Page.getFrameTree. But I don't know how to trace back to where the promise got created from where there is a missing handler for the rejection. In my recent tests, on both ubunutu and windows machines, there is only the issue8377.js file in the folder being executed from, and no other configuration has ever been done. The previous tests were being done on the PhotoPrism docker development environment, which is why the more complex execution command. These tests (below) are done on machines that did not have node or testcafe installed before I ran the tests, and don't have any configuration done for node or testcafe other than basic installation. I have added --start-fullscreen to the windows command to ensure that the browser window is large enough so that the app renders the page suitable for the test. ubuntu doesn't need that as it's opening a large enough browser window. WindowsChrome Version 134.0.6998.178 (Official Build) (64-bit)
ubuntuChrome is the latest available according to sudo apt --only-upgrade install google-chrome-stable
|
What is your Scenario?
Use native automation to open places page on PhotoPrism.
Validate that searching for a location will return the map, with a cluster of photos for that location.
Zoom out.
Select the cluster, and then open another window from the browse button shown in the UI.
FYI:
Maps fail in non native automation due to an issue in hammerhead (already logged), so we are attempting to use the --experimental-multiple-windows flag for tests that use multiple windows.
What is the Current behavior?
On successful completion of the test (as per the console.log messages), the an error is thrown as testcafe is tearing everything down. The test that fails with a WebSocket connection closed is unpredictable.
What is the Expected behavior?
What is the public URL of the test page? (attach your complete example)
The public demo of PhotoPrism can be used for this test.
https://demo.photoprism.app/library/login is the initial landing page (no credentials required as this is a public demo).
The test also navigates to the following pages:
https://demo.photoprism.app/library/places
https://demo.photoprism.app/library/browse
What is your TestCafe test code?
Your complete configuration file
testcaferc.json
Your complete test report
Screenshots
No screen shots are taken as the test has already successfully completed, and testcafe fails as it tears the test down.
Steps to Reproduce
This command will run up to 10 times, but stop when the 1st failure is encountered.
The error is not consistent and can take a couple of executions to fail.
TestCafe version
11.1.0
Node.js version
v22.13.1
Command-line arguments
-- "chrome --headless=new" --skip-js-errors --experimental-multiple-windows ./tests/testcafeissue8377.js
Browser name(s) and version(s)
Chrome headless 133
Platform(s) and version(s)
Linux Ubuntu 24.10
Other
The test script above has been created to show the issue. It is pared back to the minimum required to show the issue.
Non Native Automation of maps fail as per this issue: DevExpress/testcafe-hammerhead#3041
which is why we are attempting to use --experimental-multiple-windows
The text was updated successfully, but these errors were encountered: