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

Wait for graphql query to complete #1053

Closed
moimael opened this issue Dec 11, 2017 · 3 comments
Closed

Wait for graphql query to complete #1053

moimael opened this issue Dec 11, 2017 · 3 comments

Comments

@moimael
Copy link

moimael commented Dec 11, 2017

  • Operating System: Fedora 27
  • Cypress Version: 1.1.4
  • Browser Version: Chrome 63

Is this a Feature or Bug?

Not sure

Current behavior:

I wanna wait until after my graphql queries complete to start running my tests. Right now it displays a loading indicator after the page load and before the query complete, which makes my tests fails if the query do not complete quick enough. Using cy.wait doesn't work.

Desired behavior:

I would like to use the wait feature on graphql query but it doesn't seems to work, cypress do not seems to pick graphql network requests.

How to reproduce:

Try to use cy.wait on a graphql query made with react-apollo

@bahmutov
Copy link
Contributor

Thank you for opening an issue, can you give us a repo with reproducible example?

@bahmutov bahmutov added the stage: needs information Not enough info to reproduce the issue label Dec 11, 2017
@moimael
Copy link
Author

moimael commented Dec 11, 2017

Hi,

I think I found the cause of this, react-apollo is using fetch and cypress do not seems to support it. Disabling fetch and using xhr instead using the polyfill seems to do the trick :)

@bahmutov
Copy link
Contributor

Perfect, glad it worked out. We have fetch support in the roadmap #687 but for now you can just disable window.fetch like shown in this recipe https://github.com/cypress-io/cypress-example-recipes/tree/master/examples/stubbing-spying__window-fetch

@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Jun 12, 2018
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

3 participants