--- name: web-system-tests description: The web realization of the system-tests contract — browser-driven system tests with Playwright against a running frontend. Owns the project layout (`tests/`), the Playwright configuration (`baseURL` plus `webServer`, cross-engine projects), the role- and label-based selector policy, code coverage as an opt-in second run, and the green oracle plus its after-every-change loop. Composes with `system-tests` (the black-box contract), `ears-tests` (spec-derived expectations), and the stack skill that owns the application (`web-components`, `web-sprinkles`, `web-static`). Use whenever a web frontend needs end-to-end, browser, or system tests written, run, reviewed, or repaired — triggers on "Playwright", "e2e test", "end-to-end test", "browser test", "system test for the frontend", "test the UI", "cross-browser test", "test coverage for the frontend", "run the e2e tests", "why is this test flaky". Not for auditing a rendered page's markup, accessibility, or Baseline compliance — that is the Chrome DevTools loop in `web-static`. argument-hint: "[app, page, or business component to test]" --- Write, run, and maintain browser-driven system tests for $ARGUMENTS. Apply all rules below strictly. ## Composition - `/system-tests` owns the contract — black box, running system, coordinates as configuration, isolation, total verdict reporting. This skill is its **web realization**: layout, configuration, selector policy, test syntax, and the green oracle. - The stack skill owns the application under test — `/web-components` (SPA), `/web-sprinkles`, or `/web-static`. - `/ears-tests` owns spec-derived expectations: one `test.describe` per requirement group, the literal `Rn.m` id in the test title. - `/bce` owns where things live: one spec file per business component, named after it. ### Versus the Chrome DevTools verification loop `/web-static` drives the rendered page through Chrome DevTools MCP — console, accessibility snapshot, viewport, Lighthouse, Baseline. That loop inspects **the page as it is right now**: agent-driven, single-shot, leaving no artifact behind. This skill produces a **committed suite** re-run by a machine on every change, in three engines, indefinitely. Neither replaces the other. Rendering, accessibility tree, contrast, and Baseline compliance belong to the DevTools loop; user-visible **behavior, and its survival across changes**, belongs here. Where a project has both, green means both. ## The public surface of a web UI is its accessibility tree `/system-tests` permits assertions through the public surface only. For an HTTP service that surface is the endpoint; for a web UI it is everything the user can perceive and operate — which is exactly what the accessibility tree exposes. So the selector policy is a consequence of the contract, not a style preference: - Locate by role, label, text, or placeholder: `getByRole`, `getByLabel`, `getByText`, `getByPlaceholder`. - CSS selectors, ids, class names, `nth-child`, DOM shape, shadow-root piercing, and store internals are implementation. A test bound to them fails on a refactor that changed nothing a user can see — which is a false alarm, and false alarms are what kill suites. The payoff shows up when a locator finds nothing: an element with no accessible name is a defect in the application — a missing `