-
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
Add ability to wait for script to load (like cy.script('js') + cy.wait()) #1296
Comments
This would be possible when full network stubbing feature lands
…Sent from my iPhone
On Feb 12, 2018, at 08:41, Bruno Sampaio ***@***.***> wrote:
Operating System: macOS High Sierra
Cypress Version: 1.4.2
Browser Version: Chrome 64
Is this a Feature or Bug?
Feature
Current behavior:
I am working on a React application where we create splitting points here and there in order to separate the code into different bundles. This means that sometimes it is necessary to wait for a script to load before continuing. The only way I found of doing that was by adding a cy.wait(5000) for those cases. Is there any other way of doing this?
Desired behavior:
Similar approach to cy.route so that you can specify which scripts to wait for. Something like:
cy.script('js*').as('getBundle');
***@***.***').then(...)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Is this possible yet? |
This also seems to be my problem. |
Is there any update on that issue? cc @brian-mann |
Any updates on the subject ? |
If your script sets a global variable after loading, let's say
and then ...
|
We have a recipe https://github.com/cypress-io/cypress-example-recipes/tree/master/examples/testing-dom__wait-for-resource showing how to wait for delayed style, JavaScript resource or even an image to load. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
The features requested in this issue are now possible as part of
Please see the If you encounter any issues or unexpected behavior while using |
Current behavior:
I am working on a React application where we create splitting points here and there in order to separate the code into different bundles. This means that sometimes it is necessary to wait for a script to load before continuing. The only way I found of doing that was by adding a
cy.wait(5000)
for those cases. Is there any other way of doing this?Desired behavior:
Similar approach to
cy.route
so that you can specify which scripts to wait for. Something like:The text was updated successfully, but these errors were encountered: