Skip to content

Can't overwrite expect command #22733

Open
@wKich

Description

@wKich

Current behavior

Since Cypress 10.0 there was been introduced #18587 change with throwing an error if user is trying to overwrite existing built-in command by using Cypress.Commands.add(). So the PR says that we should use overwrite method instead if we'd like to overwrite existing commands. But the problem is it doesn't work and if we use Cypress.Commands.overwrite() we will get another error

Cannot overwite command for: expect. An existing command does not exist by that name.

So currently there is no legal way to overwrite expect command and I couldn't find any info that expect is restricted and can't be overwritten.

Desired behavior

There are should be possible to overwrite built-in commands as expect by using Cypress.Commands.overwrite() without any errors

Test code to reproduce

No test code

Cypress Version

10.3.0

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    E2EIssue related to end-to-end testingTriagedIssue has been routed to backlog. This is not a commitment to have it prioritized by the team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions