{
  "doc": {
    "id": "api/cypress-api/testing-type",
    "title": "Cypress.testingType | Cypress Documentation",
    "description": "Get the current testing type in Cypress.",
    "section": "api",
    "source_path": "/llm/markdown/api/cypress-api/testing-type.md",
    "version": "e6988a974973e9090ce70406c38cb2b9e0eac9fa",
    "updated_at": "2026-05-15T15:50:22.536Z",
    "headings": [
      {
        "id": "api/cypress-api/testing-type#cypress-testingtype",
        "text": "Cypress.testingType",
        "level": 1
      },
      {
        "id": "api/cypress-api/testing-type#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "api/cypress-api/testing-type#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "api/cypress-api/testing-type#testing-type",
        "text": "Testing Type",
        "level": 3
      },
      {
        "id": "api/cypress-api/testing-type#conditionals",
        "text": "Conditionals",
        "level": 3
      },
      {
        "id": "api/cypress-api/testing-type#history",
        "text": "History",
        "level": 2
      }
    ]
  },
  "content": {
    "type": "root",
    "children": [
      {
        "type": "heading",
        "depth": 1,
        "children": [
          {
            "type": "text",
            "value": "Cypress.testingType"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "`Cypress.testingType` returns the current testing type, determined by your selection in the Cypress Launchpad. The `Cypress.testingType` returns `e2e` for "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/core-concepts/testing-types.md#What-is-E2E-Testing",
            "children": [
              {
                "type": "text",
                "value": "E2E Testing"
              }
            ]
          },
          {
            "type": "text",
            "value": " or `component` for "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/core-concepts/testing-types.md#What-is-Component-Testing",
            "children": [
              {
                "type": "text",
                "value": "Component Testing"
              }
            ]
          },
          {
            "type": "text",
            "value": "."
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Syntax"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "Cypress.testingType // returns 'e2e' or 'component'"
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Examples"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Testing Type"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "it('is running component testing mode', () => {  expect(Cypress.testingType).to.equal('component')})"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Conditionals"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "it('does something differently', () => {  if (Cypress.testingType === 'e2e') {    cy.exec('something')  } else {    cy.exec('something else')  }})"
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "History"
          }
        ]
      },
      {
        "type": "table",
        "align": [
          null,
          null
        ],
        "children": [
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Version"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Changes"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/app/references/changelog.md#7-0-0",
                    "children": [
                      {
                        "type": "text",
                        "value": "7.0.0"
                      }
                    ]
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Added `Cypress.testingType`"
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  },
  "token_estimate": 125
}