{
  "slug": "playwright-test-abort-aborts-the-running-test-e180dae24c30",
  "title": "Playwright test.abort() aborts the running test",
  "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 a fixture, hook, or route handler detects unrecoverable misuse, call `test.abort()` to fail the running test immediately; in a route handler, also call `route.abort()` if the request should be stopped.",
    "examples": [
      "test('does not publish to the shared page', async ({ page }) => { await page.route('**/publish', route => { test.abort('Tests must not publish to the shared page. Use the `clone` option.'); return route.abort(); }); });"
    ],
    "gotchas": [
      "Version: v1.60.0",
      "message (optional string): Describes the abort reason; included in the failure error.",
      "route.abort(): Aborts the intercepted request; the API also supports an optional error code.",
      "Prerequisite: `test.abort()` was added in Playwright v1.60.",
      "The optional message accompanies the abort."
    ]
  },
  "why_it_matters": "Stop a test immediately when a fixture, hook, or route handler detects unrecoverable misuse.",
  "sources": [
    "https://github.com/microsoft/playwright/releases/tag/v1.60.0",
    "https://playwright.dev/docs/api/class-test",
    "https://github.com/microsoft/playwright/blob/main/docs/src/api/class-route.md"
  ],
  "rank": 0.94033,
  "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-4:gate",
    "evidence_hash": "8d2217b180ed48f8295026249b4e63507609b51ecea3842ff24b521ee9c9c11e"
  },
  "review": {
    "draft_hash": "ec422c24446f8fe57ce96da20f1234cb1b1e2cfebc264631a8859c92016e0677",
    "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.94 >= 0.9; 2 needed) and Jev gave 0.78 (>= 0.6 needed)."
  }
}
