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.Command.add for a command that is a Cypress command doesn't warn/error #18572

jennifer-shehane opened this issue Oct 20, 2021 · 2 comments · Fixed by #18587


Copy link

What would you like?

You could write:

Cypress.Commands.add('get', ...)

And Cypress doesn't warn that you are trying to add a command that is already a command in Cypress. I'm not exactly sure what the behavior is - does it ignore the add or does it 'overwrite' the original command.

Why is this needed?

If there are conflicting names added, it would be unclear which takes precedence. We should error in this case and instruct the user that they need to use overwrite instead of add, which is for commands that don't exist at all.

Cypress.Commands.overwrite('get', ...)


No response

Copy link
Member Author

The code for this is done, but this has yet to be released. We'll update this issue and reference the changelog when it's released.

Copy link

cypress-bot bot commented Nov 10, 2021

Released in 9.0.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v9.0.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Nov 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

Successfully merging a pull request may close this issue.

2 participants