-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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.get cannot find data targets #1501
cy.get cannot find data targets #1501
Comments
Your test looks written correctly from what you have provided. Have you been able to hover back over when the command runs to see if the element is actually on the page at that time? The element may not be there yet if it is waiting for an xhr request to finish, for example. |
I think the problem is actually with storybook. I'm using this blog as a reference: https://medium.com/@mtiller/testing-react-components-using-storybook-and-cypress-1689a27f55aa And it looks like I need to grab the first storybook id, |
I am running a local storybook (localhost:9001) with one Node.js application.
I am running Cypress on another Node.js application.
I am trying to get my QA people up and running by using simple tests with the provided documentation.
Embedded deep in my storybook link, I have
<span class="some__class_name" data-qa-target="a_unique_name">Blah blah blah</span>
According to the documentation, here: https://docs.cypress.io/guides/references/best-practices.html#Selecting-Elements,
I should be able to say:
But Cypress is telling me
CypressError: Timed out retrying: Expected to find element: '[data-qa-target=oas-landing-provider-name]', but never found it.
If I'm doing something wrong, it's not obvious to me. Any suggestions? There are no buttons or inputs above this span. It's literally
body
,section
,div
upondiv
, and somespan
s within thediv
sThe text was updated successfully, but these errors were encountered: