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

Incorrect error message? #4

Closed
gregfenton opened this issue May 11, 2020 · 4 comments
Closed

Incorrect error message? #4

gregfenton opened this issue May 11, 2020 · 4 comments
Labels
bug Something isn't working severity: Trivial

Comments

@gregfenton
Copy link

At line 22 of https://github.com/abhinaba-ghosh/cypress-react-selector/blob/master/index.js, the error message states:

React Selector not loaded yet. did you forget to run cy.waitToLoadReact()?

but I believe that as a user of this plugin we are expected to run cy.waitForReact()? It looks like waitToLoadReact() is something being called "under the covers", not what a user of the plugin is expected to do?

@abhinaba-ghosh
Copy link
Owner

Hi @gregfenton , thanks for the detailed error description. As a user you need to tell the react selector to wait for react to be loaded for below reason:

  1. You might be having a legacy application where react is one of the technology if not only. It is possible that you are loading react views in specific user interaction in that case. So, cypress-react-selector needs to understand at which moment react is loaded.
  2. Sometimes there are multiple react roots available in the application. Let us assume your team is developing different parts of the application as separate react projects and then integrating them all. In that case Cypress-react-selector needs to understand what is the target react root.

You will get a better understanding here: https://github.com/abhinaba-ghosh/cypress-react-selector#wait-for-application-to-be-ready-to-run-tests

Also, have a look into the beforeAll method of these sample test: https://github.com/abhinaba-ghosh/cypress-react-selector/blob/master/cypress/integration/react-selector.spec.js

Let me know if it helps. I am open to any suggestions.

@gregfenton
Copy link
Author

Correct, both those examples show waitForReact(), but the error message I indicate says waitToLoadReact().

@abhinaba-ghosh
Copy link
Owner

@gregfenton That's a typo. Good catch! will be fixed in the next version.

@abhinaba-ghosh abhinaba-ghosh added bug Something isn't working severity: Trivial labels May 11, 2020
@abhinaba-ghosh
Copy link
Owner

Typo is fixed in version V0.1.6

Closing the ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working severity: Trivial
Projects
None yet
Development

No branches or pull requests

2 participants