{
  "doc": {
    "id": "api/cypress-api/platform",
    "title": "Cypress.platform",
    "description": "Get the underlying OS name as returned from Node's os.platform() in Cypress.",
    "section": "api",
    "source_path": "/llm/markdown/api/cypress-api/platform.md",
    "version": "f97f06d85653c51afe39a9bd3cefda946807f150",
    "updated_at": "2026-10-05T21:01:45.863Z",
    "headings": [
      {
        "id": "api/cypress-api/platform#cypress-platform",
        "text": "Cypress.platform",
        "level": 1
      },
      {
        "id": "api/cypress-api/platform#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "api/cypress-api/platform#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "api/cypress-api/platform#conditionals",
        "text": "Conditionals",
        "level": 3
      }
    ]
  },
  "content": {
    "type": "root",
    "children": [
      {
        "type": "heading",
        "depth": 1,
        "children": [
          {
            "type": "text",
            "value": "Cypress.platform"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "`Cypress.platform` returns the underlying OS name, as returned from Node's "
          },
          {
            "type": "link",
            "title": null,
            "url": "https://nodejs.org/api/os.html#os_os_platform",
            "children": [
              {
                "type": "text",
                "value": "`os.platform()`"
              }
            ]
          },
          {
            "type": "text",
            "value": "."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Even though Cypress runs in the browser, it automatically makes this property available for use in your tests."
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Syntax"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "Cypress.platform // 'darwin'"
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Examples"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Conditionals"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "it('selects all text in the note', () => {\n  // if macOS do one thing, else do another\n  const modifier = Cypress.platform === 'darwin' ? '{cmd}' : '{ctrl}'\n\n  cy.get('#note').type(`${modifier}a`)\n})"
      }
    ]
  },
  "token_estimate": 99
}