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

Not able to use cy.route() if application enable cache #7903

Closed
nikhilesh009 opened this issue Jul 7, 2020 · 6 comments
Closed

Not able to use cy.route() if application enable cache #7903

nikhilesh009 opened this issue Jul 7, 2020 · 6 comments

Comments

@nikhilesh009
Copy link

nikhilesh009 commented Jul 7, 2020

not able to use cy.route while application using cache.
before i was able to wait for response by using this.

cy.server()
cy.route('**/users').as('getUsers')
cy.visit('/users')
cy.wait('@getUsers')

but now it's not able to wait for a response
Screenshot 2020-07-07 at 11 43 23
Screenshot 2020-07-07 at 11 45 42
Screenshot 2020-07-07 at 11 46 11

Cypress version 4.9
Electron, chrome

@nikhilesh009 nikhilesh009 changed the title Not able to use cy.route() if network enable cache Not able to use cy.route() if app enable cache Jul 7, 2020
@nikhilesh009 nikhilesh009 changed the title Not able to use cy.route() if app enable cache Not able to use cy.route() if application enable cache Jul 7, 2020
@jennifer-shehane
Copy link
Member

  • Can you be more specific about what you mean by 'enabling cache'?
  • You're saying the XHR goes through but cy.wait() times out?

Ideally a reproducible example will be best, so that we can narrow down the issue ourselves. Can you provide one? Thanks!

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Jul 8, 2020
@nikhilesh009
Copy link
Author

ezgif com-gif-maker (7)
Yes XHR goes through but its throwing timeout
in our application, before we didn't use the cache, so it was working fine, but we introduce this https://angular.io/guide/service-worker-config
and then test started throwing error

@jennifer-shehane
Copy link
Member

Can you provide a reproducible example? I wonder if disabling service workers would have some effect #702

@nikhilesh009
Copy link
Author

nikhilesh009 commented Jul 15, 2020

i tried to find the reproducible app, but i couldn't able to find, :(
yes after disabling service workers it works.
i was playing around, I figure it out if I unregister manually then i can see XHR route and it works as it supposes to be
Screenshot 2020-07-15 at 16 50 23
ezgif com-gif-maker (8)

@jennifer-shehane
Copy link
Member

Unfortunately we have to close this issue as there is not enough information to reproduce the problem. This does not mean that your issue is not happening - it just means that we do not have a path to move forward.

Please comment in this issue with a reproducible example and we will consider reopening the issue. It'd be nice to have an example of why this is not working when Service Workers are enabled.

@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Jul 28, 2020
@nikhilesh009
Copy link
Author

#702 that was the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants