Skip to content
masterclass Buddy

Cypress · Method

cy.as

Cypress .as() saves a command result under an alias. Use the alias later with cy.get('@name'), cy.wait('@name'), or this.name in a standard function test.

Last updated

Syntax

.as(aliasName)
.as(aliasName, options)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • cy.get()
  • cy.wait()
  • cy.intercept()
  • cy.fixture()
  • cy.stub()
  • cy.spy()

Source: cy.as() | Cypress API Documentation. Checked 2026-11-03.