Cypress.testingType

Cypress.testingType returns the current testing type, determined by your selection in the Cypress Launchpad. The Cypress.testingType returns e2e for E2E Testing or component for Component Testing.

Syntax

Cypress.testingType // returns 'e2e' or 'component'

Examples

Testing Type

it('is running experimental component testing mode', () => {
  expect(Cypress.testingType).to.equal('component')
})

Conditionals

it('does something differently', () => {
  if (Cypress.testingType === 'e2e') {
    cy.exec('something')
  } else {
    cy.exec('something else')
  }
})

History

VersionChanges
7.0.0Added Cypress.testingType