webapp-testing
Playwright end-to-end testing guidance for web apps, with practical patterns and setup steps. Use when creating or improving browser-based E2E coverage, test stability, and CI execution. DO NOT USE FOR: React component tests (use ui-testing), canvas game interaction (use browser-canvas-testing), TDD workflow (use test-driven-development), debugging failures (use systematic-debugging), or randomized property tests (use property-based-testing).
- License 许可
- MIT
- 最近更新
- 2026-08-16
- Stars
- ★ 3
- Forks
- 0
01 前言 Front Matter
- name
- webapp-testing
- description
- Playwright end-to-end testing guidance for web apps, with practical patterns and setup steps. Use when creating or improving browser-based E2E coverage, test stability, and CI execution. DO NOT USE FOR: React component tests (use ui-testing), canvas game interaction (use browser-canvas-testing), TDD workflow (use test-driven-development), debugging failures (use systematic-debugging), or randomized property tests (use property-based-testing).
02 资源文件 2
- 参考文档patterns.md2.5 KB
- 参考文档playwright-setup.md2.5 KB
03 SKILL.md 正文
Web App Testing Skill
Overview
This skill provides practical Playwright E2E guidance for reliable web app testing across local and CI environments.
[CUSTOMIZE] Replace sample URLs, auth flows, selectors, and command snippets with your project-specific values.
<intake>
What do you need help with?
Choose one intent:
- patterns - Test design, selectors, waits, and reliability techniques
- setup - Playwright installation, config, environments, and CI basics
- quickstart - Minimal path to run first E2E test
What do you want to do? (patterns/setup/quickstart)
</intake>
<routing>
Response Routing
| Response | File | Purpose |
|---|---|---|
| patterns | patterns.md |
Test-writing patterns, anti-flake practices, and debugging flow |
| setup | playwright-setup.md |
Setup steps, config model, environment strategy, and CI notes |
| quickstart | playwright-setup.md → patterns.md |
Stand up tooling first, then apply stable test patterns |
</routing>
Quick Principles
- Prefer user-visible assertions over implementation details
- Use robust locators (
getByRole,getByLabel,getByTestId) before CSS/XPath - Keep tests isolated and data-independent
- Minimize fixed sleeps; rely on Playwright auto-wait and explicit expect conditions
- Stabilize E2E by controlling auth, test data, and network behavior
References
patterns.md- Practical E2E patterns and pitfallsplaywright-setup.md- Setup and environment configuration
Gotchas
| Trigger | Gotcha | Fix |
|---|---|---|
Using div > ul > li:nth-child(3) > button as a locator |
Breaks on any DOM restructure, even visually invisible ones | Use getByRole > getByLabel > getByTestId > CSS (last resort) |
await page.waitForTimeout(3000) to wait for readiness |
Adds hard delay to every run; flakes on slow CI | Replace with await expect(locator).toBeVisible() using Playwright auto-wait |
| Asserting immediately after an action without waiting for the result | Race condition; flakes on slow renders | Use Playwright's built-in auto-wait: await expect(locator).toHaveText(...) |
| Test B passes only when test A runs first | Order-dependent suite fails on parallel CI runs | Each test creates and owns its own data; tear down on completion |
| Running full login UI flow for most tests | Login is not re-tested; you're paying time cost repeatedly | Use storageState for authenticated tests; reserve full login UI for a small smoke subset |
| One test scenario covers three different features | A failure in one feature fails the entire test; hard to diagnose | One scenario per test; group by feature or user journey |
| Retrying a flaky test and moving on when it passes | Root cause unknown; intermittent issue will recur | Repro with retries disabled; capture --trace on artifacts; investigate selector stability and async assumptions |
04 同仓库更多 Skills
verification-before-completion
Evidence-based verification checklist before marking work complete. Use before PRs, releases, marking tickets done, or any "I'm finished" declaration; also when naming a baseline commit for a differential suite claim, when designing a mutation campaign or red-run evidence, when making an absence claim, a universal claim, or a one-time demonstration offered as a standing guarantee, when attributing a measurement or claiming a sweep or verification loop is complete, and when stating what a check or a CI suite will do about a change. DO NOT USE FOR: post-merge cleanup or archival (use post-pr-review) or processing GitHub review comments (use code-review-intake).
validation-methodology
Reusable validation and review methodology for staged validation, failure triage, and prosecution-depth setup. Use when running validation ladders, triaging failures, or executing adversarial review passes. DO NOT USE FOR: CE Gate orchestration, specialist dispatch ownership, or step execution flow (keep those in Code-Conductor).
upstream-onboarding
Shared opening-phase protocol for upstream agents (Experience-Owner, Solution-Designer, Issue-Planner) and Code-Conductor when invoked on an existing GitHub issue. Renders a scaled context brief and runs a standards check on inherited work at each phase boundary. Use when a user-invocable agent receives a request referencing an existing GitHub issue and must load solution-authoring and upstream-onboarding at the opening phase. DO NOT USE FOR: subagent dispatches (which already operate within an assessed session context); post-merge review (use post-pr-review); research or non-tree subagents.
ui-testing
Resilient React component testing strategies focusing on user behavior. Use when writing or reviewing component-level React tests, fixing flaky component tests, or establishing React testing patterns. DO NOT USE FOR: Playwright E2E tests (use webapp-testing), canvas game interaction (use browser-canvas-testing), TDD workflow (use test-driven-development), debugging failures (use systematic-debugging), UI component design (use frontend-design), or randomized property tests (use property-based-testing).
ui-iteration
Reusable screenshot-driven UI polish workflow for iterative visual refinement. Use when improving layout, hierarchy, spacing, feedback, or Tailwind-based presentation through repeated review-and-adjust passes. DO NOT USE FOR: functional bug fixing, accessibility-only audits, or major redesign strategy work (use Code-Smith or frontend-design).
tracking-format
Tracking-file frontmatter and coordination format guidance. Use when creating or reviewing local tracking files and related handoff conventions. DO NOT USE FOR: session-memory plan authoring rules outside the documented references here.