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 times out waiting for image load #8934

Closed
bahmutov opened this issue Oct 22, 2020 · 6 comments · Fixed by #9097
Closed

cy.route2 times out waiting for image load #8934

bahmutov opened this issue Oct 22, 2020 · 6 comments · Fixed by #9097

Comments

@bahmutov
Copy link
Contributor

bahmutov commented Oct 22, 2020

Cypress v5.4.0 and even #8916

Test in https://github.com/cypress-io/cypress-example-recipes/blob/master/examples/stubbing-spying__route2/cypress/integration/image-spec.js#L4

  it.only('spies on loading a static image', () => {
    cy.route2('/images').as('image')
    cy.visit('/pics.html')
    // how to check if the /image route was called once?
    cy.wait('@image')
  })

The image request happens, but the test fails it. Notice that the routes tab shows 1 matching request

wait-on-image-times-out

@sainthkh
Copy link
Contributor

When I was fixing #8858, I also saw this problem (the test passes but the image loading failed). After #8965, I couldn't see this happening again. If the bug doesn't happen on your environment too, I think we can close this issue.

@bahmutov
Copy link
Contributor Author

Check

describe('route2', () => {
  it.only('spies on loading a static image', () => {
    cy.route2('/images').as('image')
    cy.visit('/pics.html')
    // how to check if the /image route was called once?
    // @see https://github.com/cypress-io/cypress/issues/8934
    cy.wait('@image')
  })

Still happening in 5.5.0

@sainthkh
Copy link
Contributor

Sorry, I misunderstood the issue.

@flotwig
Copy link
Contributor

flotwig commented Nov 4, 2020

Closing this issue, I can reproduce this, but only if the image is not cached. If it is cached, the server returns a 304 Found, which is the same issue as #8999.

@flotwig flotwig closed this as completed Nov 4, 2020
@bahmutov bahmutov reopened this Nov 4, 2020
@cypress-bot cypress-bot bot added stage: work in progress and removed stage: needs investigating Someone from Cypress needs to look at this labels Nov 4, 2020
@bahmutov bahmutov closed this as completed Nov 4, 2020
@bahmutov bahmutov reopened this Dec 1, 2020
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: work in progress labels Dec 1, 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 2, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 2, 2020

The code for this is done in cypress-io/cypress#9097, 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 7, 2020

Released in 6.1.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Dec 7, 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