{
  "slug": "playwright-operations-and-assertions-accept-abortsignal-72cc564804df",
  "title": "Playwright operations and assertions accept AbortSignal",
  "tools": [
    "playwright"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-07-24T21:55:03.000Z",
  "announced_at": "2026-07-24T21:55:03.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When a browser action or web-first assertion needs to be cancellable, pass an `AbortSignal` in its `signal` option. To disable the operation’s default timeout too, pass `timeout: 0`.",
    "examples": [
      "const controller = new AbortController();\nsetTimeout(() => controller.abort(), 1000);\nawait page.getByRole('button', { name: 'Submit' }).click({ signal: controller.signal });\nawait expect(page.getByText('Done')).toBeVisible({ signal: controller.signal });",
      "await page.getByRole('button', { name: 'Submit' }).click({ signal: controller.signal, timeout: 0 });"
    ],
    "gotchas": [
      "Version: v1.62.0",
      "signal: An `AbortSignal` that cancels the operation; for locator assertions, aborting fails the assertion like a timeout.",
      "timeout: Maximum time in milliseconds. For operations, `0` disables the timeout; assertion timeout defaults to `TestConfig.expect`.",
      "Prerequisite: The `signal` option was added in Playwright v1.62.",
      "Most operations and web-first assertions accept `signal`.",
      "Providing a signal does not disable the default timeout; pass `timeout: 0` to disable it."
    ]
  },
  "why_it_matters": "Cancel a long-running browser action or assertion during a test.",
  "sources": [
    "https://github.com/microsoft/playwright/releases/tag/v1.62.0",
    "https://playwright.dev/docs/api/class-locator",
    "https://playwright.dev/docs/next/api/class-locatorassertions"
  ],
  "rank": 0.98047,
  "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-48c92cac04e84aed-1:gate",
    "evidence_hash": "b17276139b84e8e6a01d64416d3a7c27f07ddffc91b7a327300bf595585d287e"
  },
  "review": {
    "draft_hash": "4ce5a2bf75583e6ac859a00011c63301c525bf4be02f645c174bf35de27814b8",
    "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.98 >= 0.9; 2 needed) and Jev gave 0.76 (>= 0.6 needed)."
  }
}
