{
  "slug": "playwright-getbyrole-matches-accessible-descriptions-a2f5ba466ed9",
  "title": "Playwright getByRole() matches accessible descriptions",
  "tools": [
    "playwright"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-05-11T19:08:18.000Z",
  "announced_at": "2026-05-11T19:08:18.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When locating an element by role and accessible description, pass `description` in the `getByRole()` options. Playwright v1.60.0 added this option to page, locator, frame, and frame-locator methods.",
    "examples": [
      "await page.getByRole('<role>', { description: '<accessible description>' });",
      "await locator.getByRole('<role>', { description: '<accessible description>' });",
      "await frame.getByRole('<role>', { description: '<accessible description>' });"
    ],
    "gotchas": [
      "Version: v1.60.0",
      "role (required): ARIA role to locate.",
      "description: String or RegExp matching the accessible description. String matching is case-insensitive substring matching by default.",
      "exact: Match the name and description exactly, case-sensitively and as whole strings; defaults to false. Ignored for RegExp values.",
      "Prerequisite: Use Playwright v1.60.0 or later for the `description` option."
    ]
  },
  "why_it_matters": "Locate an element by its role and accessible description in a page, locator, frame, or frame locator.",
  "sources": [
    "https://github.com/microsoft/playwright/releases/tag/v1.60.0",
    "https://playwright.dev/docs/api/class-page#page-get-by-role",
    "https://playwright.dev/docs/api/class-locator#locator-get-by-role",
    "https://playwright.dev/docs/api/class-frame#frame-get-by-role"
  ],
  "rank": 0.97036,
  "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": "backfill-20261007",
    "verdict_id": "backfill-20261007:backfill-20261007-15228fe3d33f40e5-7:gate",
    "evidence_hash": "8d2217b180ed48f8295026249b4e63507609b51ecea3842ff24b521ee9c9c11e"
  },
  "review": {
    "draft_hash": "c8a407c99cc0e279c7ef9580dff0dc830eaa0bb3af229760f67935c2f9019d6b",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "backfill-20261007:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.97 >= 0.9; 2 needed) and Jev gave 0.79 (>= 0.6 needed)."
  }
}
