Webapp testing

From squadcodercom/squadcoder · View interactive version

Webapp testing is an AI agent skill from the GitHub repository squadcodercom/squadcoder. Test a web app end-to-end with Playwright: drive real flows, assert on visible state, catch console/network errors, and do visual + RTL/Hebrew checks. Covers writing resilient selectors (roles/text over CSS), waiting on conditions (never sleeps), screenshot diffing, and a quick smoke pass before shi

How to use this skill

Skill file

Webapp Testing — resilient end-to-end tests with Playwright

Test what the user sees and does, not implementation details. The bundled Playwright MCP/browser

is available; use it to drive a real browser and assert on real state.

Step 0 — decide the flow

Name the user journey ("sign up → onboarding → first project"). Test that, not isolated widgets.

List the success assertions up front (what must be true at the end).

Step 1 — resilient selectors (in priority order)

  1. Role + accessible name — getByRole("button", { name: "Save" }). Survives restyles.
  2. Visible text — getByText(...).
  3. Label / placeholder — for form fields.
  4. data-testid — only when the above can't disambiguate.

Avoid brittle CSS/XPath chains and nth-child positional selectors.

Step 2 — wait on conditions, never sleep

Step 3 — drive the flow and assert

await page.goto(BASE_URL)
await page.getByRole("button", { name: "Open project" }).click()
await page.getByPlaceholder("Browse folders").fill("~/demo")
await page.keyboard.press("Enter")
await expect(page.getByRole("heading", { name: "demo" })).toBeVisible()

Step 4 — catch errors the user wouldn't report

Step 5 — visual + RTL/Hebrew parity

nothing overlaps. RTL bugs hide in physical-CSS leftovers — this catches them.

Step 6 — a fast smoke pass

Before shipping, run one short script that: loads the app, asserts no console errors, walks the primary

flow, and screenshots the result LTR + RTL. Cheap insurance.

Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.