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

Cypress Commands adddQuery Error #700

Open
jmitchell-figure opened this issue Apr 12, 2023 · 5 comments
Open

Cypress Commands adddQuery Error #700

jmitchell-figure opened this issue Apr 12, 2023 · 5 comments
Labels
bug 🐛 Something isn't working

Comments

@jmitchell-figure
Copy link

Describe the bug
When going through the examples to setup within Cypress I am seeing the following error when trying to run any tests:

Cypress.Commands.addQuery() is used to create new queries, but findAllByLabelText is an existing Cypress command or query, or is reserved internally by Cypress.

To Reproduce

  1. Go through installation instructions.
  2. Use Cypress example for setup: https://github.com/drptbl/synpress-examples/tree/master/cypress/isolated-state
  3. Run any test.
  4. See error

**Expected behavior
Cypress should run tests without the error.

Screenshots
image

Desktop (please complete the following information):

  • OS: macOS
  • Synpress version: 3.5.1

**Note
Cypress Version: 12.5.1

@jmitchell-figure jmitchell-figure added the bug 🐛 Something isn't working label Apr 12, 2023
@nickwang14
Copy link

Bump, this is also happening to me

@yelenabaghdasaryan
Copy link

Take a look at this testing-library/cypress-testing-library#238 (comment).
This error happened on my side when I was importing e2e.ts file in my tests and we have a query type defined in e2e.ts. So pay attention if you import in your test file rather the type definition or anything from commands.ts, where the query is added

@Oputo50
Copy link

Oputo50 commented Nov 8, 2023

This is happening to me also. testing-library/cypress-testing-library#238 (comment) this didn't help me unfortunately

@Oputo50
Copy link

Oputo50 commented Nov 8, 2023

@jmitchell-figure have you been able to fix it?

@devfservant
Copy link

Take a look at this testing-library/cypress-testing-library#238 (comment).

I had the same error and the fix was also to ensure that the file was "run" only once.
I suggest anyone facing this issue to just add a console.log before adding the commands/queries:

console.log('Adding support commands/queries');  // => If you see this log multiple times, the issue is likely on your end
Cypress.Commands.addQuery('findAllByLabelText', findAllByLabelTextFn);

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

No branches or pull requests

5 participants