{
  "slug": "playwright-locator-visible-filters-to-visible-elements-f3a4c151c133",
  "title": "Playwright locator.visible() filters to visible elements",
  "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 clicking a matching button only if it is visible, use `await page.locator('button').visible().click();`. `visible()` returns a locator that filters out invisible elements and is the recommended replacement for `:visible`.",
    "examples": [
      "await page.locator('button').visible().click();"
    ],
    "gotchas": [
      "Version: v1.63.0",
      "selector (`'button'`) (required): The selector passed to `page.locator()` to find matching elements.",
      "`visible()` (required): Takes no documented arguments; returns a locator matching only visible elements. Visibility is checked each time the locator is used."
    ]
  },
  "why_it_matters": "Click a matching button only when it is visible.",
  "before": "Use the `:visible` CSS pseudo-class to match visible elements.",
  "sources": [
    "https://github.com/microsoft/playwright/releases/tag/v1.63.0",
    "https://playwright.dev/docs/api/class-locator#locator-visible",
    "https://playwright.dev/docs/api/class-locator"
  ],
  "rank": 0.97043,
  "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-2:gate",
    "evidence_hash": "8f458d0a9fe7d706ecdbbba7433f7d4b9f5359e0c90f3581627b8ce9e8b79bc6"
  },
  "review": {
    "draft_hash": "03b6dc7b850f54d0d4ffa407513886824ba10803c10b79563ea3b76f49705537",
    "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.69 (>= 0.6 needed)."
  }
}
