Skip to content

Cypress.Command.add for a command that is a Cypress command doesn't warn/error #18572

@jennifer-shehane

Description

@jennifer-shehane

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', ...)

Other

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions