Skip to main content

Cypress.isCy

Cypress.isCy() checks if a variable is a valid instance of cy or a cy chainable.

This utility may be useful when writing plugins for Cypress and you want to determine if a value is a valid Cypress chainable.

Syntax

Cypress.isCy(obj)

Arguments

obj (Object)

The object to test.

Examples

Cypress.isCy(cy) // true

const chainer = cy.wrap().then(() => {
Cypress.isCy(chainer) // true
})

Cypress.isCy(undefined) // false

Cypress.isCy(() => {}) // false