{
  "doc": {
    "id": "api/cypress-api/spec",
    "title": "Cypress.spec | Cypress Documentation",
    "description": "Get the properties of the spec under test in Cypress",
    "section": "api",
    "source_path": "/llm/markdown/api/cypress-api/spec.md",
    "version": "ce02913654e2655ee63448bdc92bb92c7b46a619",
    "updated_at": "2026-04-22T19:37:51.587Z",
    "headings": [
      {
        "id": "api/cypress-api/spec#cypress-spec",
        "text": "Cypress.spec",
        "level": 1
      },
      {
        "id": "api/cypress-api/spec#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "api/cypress-api/spec#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "api/cypress-api/spec#log-spec-information",
        "text": "Log spec information",
        "level": 3
      },
      {
        "id": "api/cypress-api/spec#cypress-spec-returns-an-object",
        "text": "Cypress.spec returns an object",
        "level": 4
      }
    ]
  },
  "content": {
    "type": "root",
    "children": [
      {
        "type": "heading",
        "depth": 1,
        "children": [
          {
            "type": "text",
            "value": "Cypress.spec"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "`Cypress.spec` returns you the properties of the spec under test."
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Syntax"
          }
        ]
      },
      {
        "type": "code",
        "lang": "javascript",
        "meta": null,
        "value": "Cypress.spec // returns spec object"
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Examples"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Log spec information"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Cypress.spec returns an object"
          }
        ]
      },
      {
        "type": "code",
        "lang": "js",
        "meta": null,
        "value": "it('log spec info', () => {\n  console.log(Cypress.spec)\n  // {\n  //   name: 'filter.cy.js',\n  //   relative: 'cypress/e2e/filter.cy.js',\n  //   absolute: '/Users/janelane/Dev/web-app/cypress/e2e/filter.cy.js',\n  // }\n})"
      }
    ]
  },
  "token_estimate": 73
}