create-product-agent-playwright-tests
Create or update Playwright end-to-end tests for the Product Agents frontend in this repo, especially for settings validation, conversation artifact visibility, research plan approval/rejection, and clarifying-question flows. Use when asked to write, expand, or run Playwright tests for frontend/product-agent (including live E2E runs gated by E2E_LIVE).
When & Why to Use This Skill
This Claude skill automates the creation, expansion, and execution of Playwright end-to-end (E2E) tests for frontend applications. It specializes in streamlining the testing of complex user interactions—such as settings validation, artifact visibility, and multi-step approval workflows—ensuring high-quality software delivery through robust, maintainable automation patterns.
Use Cases
- Automating UI smoke tests to verify that core components like landing pages and settings panels persist correctly across sessions.
- Developing live E2E test suites for backend-dependent features, including research plan approval/rejection flows and real-time streaming artifacts.
- Refactoring existing test scripts to utilize stable, role-based selectors and standardized assertion patterns to reduce test flakiness.
- Validating interactive conversational UI flows, specifically tracking 'Needs Clarification' status badges and clarifying-question triggers.
- Implementing gated live testing environments that safely execute E2E runs only when specific backend conditions and API keys are met.
| name | create-product-agent-playwright-tests |
|---|---|
| description | Create or update Playwright end-to-end tests for the Product Agents frontend in this repo, especially for settings validation, conversation artifact visibility, research plan approval/rejection, and clarifying-question flows. Use when asked to write, expand, or run Playwright tests for frontend/product-agent (including live E2E runs gated by E2E_LIVE). |
Create Product Agent Playwright Tests
Use this skill to add or modify Playwright tests under frontend/product-agent/tests and to run the E2E suite safely.
Quick start
- Prefer the existing test patterns in
frontend/product-agent/tests/*.spec.ts. - Use stable selectors from
references/ui-selectors.md. - Use scenario briefs from
references/test-scenarios.mdto translate prompts into assertions.
Workflow
Decide test type
- Use smoke tests for non-live UI checks (landing page, settings persistence).
- Use live E2E tests when the scenario depends on the backend or streaming (research plan approval, artifact rendering).
Pick a base pattern
- For live tests, mirror
frontend/product-agent/tests/run-progress.e2e.spec.ts. - For smoke tests, mirror
frontend/product-agent/tests/app-smoke.spec.tsorfrontend/product-agent/tests/conversations.spec.ts.
- For live tests, mirror
Implement assertions
- Use role- or label-based selectors first.
- Keep assertions UI-facing (visible text, status badges, buttons).
- For approval flows, assert both the pending state and the response after clicking Approve/Reject.
Guard live tests
- Gate live tests behind
E2E_LIVE=1and skip if base URL is unreachable. - If prompt input is missing, skip with a clear reason (see live test patterns).
- Gate live tests behind
Run tests
- Smoke tests:
npm run test -w frontend/product-agent. - Live tests:
E2E_LIVE=1 npm run test -w frontend/product-agent. - Targeted live file:
E2E_LIVE=1 npx playwright test tests/run-progress.e2e.spec.ts(run insidefrontend/product-agent).
- Smoke tests:
References
- UI selectors:
references/ui-selectors.md - Scenario briefs:
references/test-scenarios.md
Notes
- Live tests require a running backend with streaming enabled and valid API keys; follow the skip patterns used in
run-progress.e2e.spec.ts. - When validating settings persistence, confirm the Settings panel reflects saved values after reopening.
- For clarifying-question flows, accept either explicit question text or the "Needs Clarification" status badge.