-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
window.stop() at onBeforeLoad #6596
Comments
@EtienneBruines We've had a discussion about You could potentially utilize
@EtienneBruines Can you explain a bit about what you are trying to achieve in the state of your application with the attempted workarounds? My guess it you're looking for this feature: #788 Closing though as this is not a bug in Cypress currently. Also, check out our community chat, it can be helpful for debugging or answering questions on how to use Cypress. |
@jennifer-shehane Our issue is that we need to set values in both Right now, we are loading the login-page, setting the *To (2) there seemed to be some kind of race-conditions going on. The |
It would be great if there were a way to cancel the navigation, to be able to stop loading the page at any point and still be able to continue testing.
Current behavior:
Cypress test fails / timeout when calling
window.stop()
withinonBeforeLoad
.Desired behavior:
Cypress test succeeding
Test code to reproduce
TL;DR call
window.stop()
inside theonBeforeLoad
callback.Assume
./cypress/fixtures/demo.html
is any page (including an empty html file).window_stop_spec.js
Versions
Should be unrelated.
Current workaround
Our current workaround is to actually load a blank page on which we load our localStorage and indexedDB, afterwards adding some "logged in" element to the page (
win.document.body.innerText = 'logged-in'
) and waiting for that to appear after navigating to it (cy.visit('./blank.html').contains('logged-in')
). Because it is an empty page, no resources are wasted trying to load anything else.The text was updated successfully, but these errors were encountered: