Cypress.testingType

Cypress.testingType returns the current testing type, determined by the Test Runner chosen to run. The Cypress.testingType returns e2e for Cypress Test Runner integration tests, or component for experimental 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

Version Changes
7.0.0 Added Cypress.testingType

© 2017 Cypress.io
Licensed under the MIT License.
https://docs.cypress.io/api/cypress-api/testing-type