Skip to content
masterclass Buddy

Cypress · Matcher

Cypress.Commands

Cypress custom commands add reusable actions to tests or change existing commands. Choose parent, child, or dual behavior with the prevSubject option.

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.

Subscribe
  • Cypress.Commands.addAll()
  • Cypress.Commands.overwrite()
  • Cypress.Commands.log()
  • custom queries
  • cy.wrap()

Source: Custom Commands in Cypress. Checked 2026-11-03.