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
ERR_FAILED (-2) when loading new window Electron 102 (headless) via CLI #23835
Comments
We recommend stubbing That said, Cypress should not be crashing when you call this function and we should print a nice error message in the UI in this case. I was able to reproduce this error with the code snippets you provided. Thanks for the issue @MvRiele, let me know if the workaround works for you. |
we are experiencing this same error with electron (apparently not chrome) on a simple
when the thing being clicked causes a pop-up window to download a pdf |
I'll leave this here, we are also experiencing this issue. By using An example on how you can test the window by stubbing:
And then to verify it got called |
This is seemingly a duplicate of #18547, closing |
Damn it, I showed up, and I don't know how to fix it, okay
|
@benfenglee and everyone else coming here from google. We had a similar issue, cypress simply crashed on startup with a similar message. It seems like cypress has problems when the computer is set to enery saving mode (Windows 11). Perhaps the startup takes to long an cypress decides to kill the electron process. |
Current behavior
Test uses
cy.window().then(win => { cy.spy(win, 'open').as('windowOpen'); });
andcy.waitUntil(() => cy.get('@windowOpen').should('be.called'));
to check if opening a window is triggered.When running in CLI Electron 102 (headless) an error is given:
ERR_FAILED (-2) loading 'https://www.testcode.com/?title=test' Error: ERR_FAILED (-2) loading 'https://www.testcode.com/?title=test' at rejectAndCleanup (node:electron/js2c/browser_init:161:7647) at EventEmitter.stopLoadingListener (node:electron/js2c/browser_init:161:8022) at EventEmitter.emit (node:events:526:28) at EventEmitter.emit (node:domain:475:12)
When i run in chrome, there is no error and the test runs fine
Desired behavior
No error given
Test code to reproduce
Test uses
cy.window().then(win => { cy.spy(win, 'open').as('windowOpen'); });
andcy.waitUntil(() => cy.get('@windowOpen').should('be.called'));
to check if opening a window is triggered.Cypress Version
10.8.0
Node version
6.14.13
Operating System
windows 11 PRO
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: