Skip to content
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

cy.route2 cannot wait on the stubbed request with forceNetworkError: true #9062

Closed
bahmutov opened this issue Nov 2, 2020 · 4 comments · Fixed by #9603
Closed

cy.route2 cannot wait on the stubbed request with forceNetworkError: true #9062

bahmutov opened this issue Nov 2, 2020 · 4 comments · Fixed by #9603

Comments

@bahmutov
Copy link
Contributor

bahmutov commented Nov 2, 2020

I am trying to confirm that the application handles failed network Ajax calls

cy.visit('/')
cy.route2(url, { forceNetworkError: true }).as('users')
cy.get('#load-users').click()
cy.contains('#users', 'Problem fetching users Failed to fetch')

cy.wait('@users', { timeout: 1000 }) // the network call happens

The wait never resolves

forceNetworkError

Screenshot

Cypress v5.5.0 and develop at d12676c561fbd24a47ecd846a54cfe9042402dbe (which is AFTER fix: improve route2 logs commit)

Reproducible example in cypress-io/cypress-example-recipes#581

@flotwig
Copy link
Contributor

flotwig commented Nov 3, 2020

The issue is that the request never ends up in the Complete state for some reason. Seems to be getting stuck on RequestIntercepted.

@dylangarcia
Copy link

I'm running in to this too with forceNetworkError: true 👍

@cypress-bot cypress-bot bot added stage: work in progress There is an open PR for this issue [WIP] stage: needs review The PR code is done & tested, needs review and removed stage: needs investigating Someone from Cypress needs to look at this stage: work in progress There is an open PR for this issue [WIP] labels Dec 9, 2020
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Dec 10, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 10, 2020

The code for this is done in cypress-io/cypress#9603, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 21, 2020

Released in 6.2.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v6.2.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Dec 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants