Cypress · Method
Cypress.Commands.add
Cypress custom commands add reusable test commands or replace existing ones. Choose parent, child, or dual behavior based on whether the command uses a previous subject.
Last updated
Syntax
Cypress.Commands.add(name, callbackFn)
Cypress.Commands.add(name, options, callbackFn)
Cypress.Commands.addAll(callbackObj)
Cypress.Commands.addAll(options, callbackObj)
Cypress.Commands.overwrite(name, callbackFn)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
Cypress.Commands.addAll()Cypress.Commands.overwrite()Cypress.Commands.addQuery()Cypress.Commands.overwriteQuery()Cypress.log()cy.wrap()