{
  "slug": "locator-and-page-aria-snapshots-can-return-json-df1a3f437bc7",
  "title": "Locator and page aria snapshots can return JSON",
  "tools": [
    "playwright"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-09-04T22:40:31.000Z",
  "announced_at": "2026-09-04T22:40:31.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When a test or inspection script needs a structured accessibility snapshot, call `locator.ariaSnapshotJSON()` or `page.ariaSnapshotJSON()`; pass optional `mode`, `depth`, or `boxes` options as needed. Both APIs were added in Playwright v1.63.0.",
    "examples": [
      "const snapshot = await page.getByRole('list').ariaSnapshotJSON();",
      "const snapshot = await page.ariaSnapshotJSON({ mode: 'ai', depth: 2, boxes: true });"
    ],
    "gotchas": [
      "Version: v1.63.0",
      "mode: `\"ai\"` or `\"default\"`; `\"ai\"` returns a snapshot optimized for AI consumption. Defaults to `\"default\"`.",
      "depth: Number; limits the snapshot depth when specified.",
      "boxes: Boolean; when true, adds each element's bounding box as a `box` property (`x`, `y`, `width`, `height`), in viewport-relative CSS pixels. Defaults to false.",
      "Prerequisite: Use Playwright v1.63 or later; both methods were added in v1.63."
    ]
  },
  "why_it_matters": "Consume an aria snapshot as structured JSON in a test or inspection script.",
  "before": "Use the aria snapshot API that returns YAML markup.",
  "sources": [
    "https://github.com/microsoft/playwright/releases/tag/v1.63.0",
    "https://playwright.dev/docs/api/class-locator#locator-aria-snapshot-json",
    "https://playwright.dev/docs/api/class-page#page-aria-snapshot-json"
  ],
  "rank": 0.97039,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v1+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "augsep-20261008",
    "verdict_id": "augsep-20261008:augsep-20261008-579bf8375159b0fd-8:gate",
    "evidence_hash": "8f458d0a9fe7d706ecdbbba7433f7d4b9f5359e0c90f3581627b8ce9e8b79bc6"
  },
  "review": {
    "draft_hash": "5a9de99c825657f0ba50f43001fa9c82254d432a449dc6e9960a8e18bbd9834b",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "augsep-20261008:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.97 >= 0.9; 2 needed) and Jev gave 0.76 (>= 0.6 needed)."
  }
}
