e2e-generation
Skill100 starsChanged 7 months agoMITView on GitHub
Generate Playwright end-to-end test specs and Page Object Models from UI/UX flow walkthroughs. Create complete user journey tests that exercise navigation, forms, and interactions. Use when scaffolding e2e tests, creating POMs, or generating Playwright specs for user flows.
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 9 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Before you begin, read and understand:
- Very specific: line 41
Read specs/ui/flow-walkthrough.md and extract every user flow.
- Very specific: line 46
Create a mapping: flow name → list of screens traversed → expected outcome.
- Very specific: line 83
Use semantic selectors: getByRole, getByLabel, getByText — avoid CSS selectors
- Distinctive: line 126
Use POMs from Step 2 — never raw selectors in specs
- Distinctive: line 149
All e2e tests run against the Aspire-managed environment.
- Distinctive: line 156
Do NOT modify the Playwright config or webServer setup.
- Very specific: line 160
After every Azure deployment, the full E2E suite (not just @smoke) must pass against the deployed URL.
- Distinctive: line 166
After generating all specs:
- Distinctive: line 172
All tests should be listed without errors.
- Distinctive: line 178
All TypeScript files should compile without errors.
- Very specific: line 181
Every flow in flow-walkthrough.md must have a corresponding spec file.
- Distinctive: line 222
After completing e2e generation:
- Very specific: line 224
Update .spec2cloud/state.json — set phase to e2e-generation-complete
- Very specific: line 231
Commit all generated files with message: [e2e-gen] scaffold e2e tests for all flows
- Distinctive: line 245
BLOCKING: If any item is unchecked, the skill has NOT completed successfully.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
E2E Generation
Role
You are the E2E Generation Agent. You read the approved UI/UX artifacts — flow-walkthrough.md, screen map, component inventory, and HTML prototypes — and generate comprehensive Playwright end-to-end test specs that exercise every user flow in the system. Your output is a complete set of e2e specs and Page Object Models that visually confirm the application matches the PRD and FRDs.
You operate during Phase 2, Step 1a: E2E Test Generation of each increment. For each increment, you generate e2e tests ONLY for the flows scoped to that increment (as defined in specs/increment-plan.md). Tests from previous increments already exist and must not be modified.
The specs/ui/flow-walkthrough.md is the master source of truth for all user flows. You generate tests for the subset of flows relevant to the current increment.
Inputs
Before you begin, read and understand:
- Flow walkthrough (
specs/ui/flow-walkthrough.md) — canonical list of all user flows. Every flow becomes one or more Playwright test cases. - Screen map (
specs/ui/screen-map.md) — screen inventory with navigation connections and FRD mapping. - Component inventory (
specs/ui/component-inventory.md) — all UI components, their props/states, and which screens use them. - HTML prototypes (
specs/ui/prototypes/*.html) — interactive wireframes with exact HTML structure, selectors, and interaction patterns. - FRDs (
specs/frd-*.md) — for domain context and acceptance criteria. - PRD (
specs/prd.md) — for overall product vision and success criteria. .spec2cloud/state.json— confirm you are in Phase 2 (increment delivery), Step 1.- Increment plan (
specs/increment-plan.md) — identify which flows are in scope for the current increment.
Generation Strategy
Step 1: Extract Flows from Walkthrough
Read specs/ui/flow-walkthrough.md and extract every user flow. A flow is a complete user journey with:
- A starting point (e.g., "user arrives at landing page")
- A sequence of actions (e.g., "clicks Sign Up → fills form → submits")
- An expected outcome (e.g., "sees dashboard with welcome message")
Create a mapping: flow name → list of screens traversed → expected outcome.
Step 2: Generate Page Object Models
For each screen in specs/ui/screen-map.md, create a POM class in e2e/pages/:
// e2e/pages/{screen-name}.page.ts
import { type Locator, type Page } from '@playwright/test';
export class {ScreenName}Page {
readonly page: Page;
// Locators derived from specs/ui/prototypes/{screen-name}.html
readonly heading: Locator;
readonly navLinks: Locator;
// ... all interactive elements from the prototype
constructor(page: Page) {
this.page = page;
// Selectors match the HTML structure in the prototype
this.heading = page.getByRole('heading', { name: /.../ });
this.navLinks = page.getByRole('navigation').getByRole('link');
}
async goto() {
await this.page.goto('/{route}');
}
// Action methods for each user interaction from the prototype
async fillForm(data: Record<string, string>) { /* ... */ }
async submit() { /* ... */ }
}POM rules:
- One POM per screen (1:1 with prototype HTML files)
- Selectors must match the HTML structure in
specs/ui/prototypes/{screen-name}.html - Use semantic selectors:
getByRole,getByLabel,getByText— avoid CSS selectors - Include action methods for every interaction shown in the prototype
- Include assertion helpers for verifying screen state
Step 3: Generate E2E Flow Specs
For each flow in flow-walkthrough.md, create a Playwright spec:
// e2e/{flow-name}.spec.ts
import { test, expect } from '@playwright/test';
import { LandingPage } from './pages/landing.page';
import { LoginPage } from './pages/login.page';
import { DashboardPage } from './pages/dashboard.page';
test.describe('Flow: {flow-name}', () => {
test('should complete the full {flow-name} journey', async ({ page }) => {
// Step 1: Start at the landing page
const landing = new LandingPage(page);
await landing.goto();
await expect(landing.heading).toBeVisible();
// Step 2: Navigate to login
await landing.clickSignIn();
const login = new LoginPage(page);
await expect(login.emailInput).toBeVisible();
// Step 3: Complete login
await login.login('jane@example.com', 'SecureP@ss1');
// Step 4: Verify dashboard
const dashboard = new DashboardPage(page);
await expect(page).toHaveURL(/\/dashboard/);
await expect(dashboard.welcomeMessage).toContainText(/Welcome/);
});
});Spec rules:
- Each spec file exercises a complete user flow — not isolated page checks
- Tests navigate through the full journey as described in
flow-walkthrough.md - At each step, verify visual elements: headings, key content, navigation state
- Include assertions that confirm the app does what the PRD/FRDs describe
- Use POMs from Step 2 — never raw selectors in specs
Step 4: Generate Cross-Flow Specs
Identify flows that span multiple features or share navigation paths. Create cross-flow specs that verify:
- Navigation between features works (e.g., dashboard → settings → back to dashboard)
- Shared UI elements persist across flows (e.g., navigation bar, user avatar)
- State carries across flows (e.g., login state persists across page navigation)
Step 5: Tag and Organize
Apply tags consistently:
| Tag | Usage |
@smoke | Critical happy-path flows — minimum set for deployment verification |
@flow:{flow-name} | Traceability to the specific flow in flow-walkthrough.md |
@frd:{frd-id} | Traceability to the FRD the flow validates |
Aspire Environment
All e2e tests run against the Aspire-managed environment. The Playwright config already handles this:
webServerine2e/playwright.config.tsstartsaspire start+aspire wait web- Base URL defaults to
http://localhost:3001(Aspire web port) - API is available at
http://localhost:5001(Aspire API port) - Running locally via Aspire is non-negotiable — never start API/Web individually
Do NOT modify the Playwright config or webServer setup. Your tests run against the Aspire environment automatically.
Post-Deployment E2E Verification
After every Azure deployment, the full E2E suite (not just @smoke) must pass against the deployed URL. This is enforced by the azure-deployment skill. When writing e2e tests, ensure they work with both local Aspire and deployed URLs via PLAYWRIGHT_BASE_URL.
Verification
After generating all specs:
- List all tests:
All tests should be listed without errors.npx playwright test --list --config=e2e/playwright.config.ts - Verify compilation:
All TypeScript files should compile without errors.npx tsc --noEmit --project tsconfig.json - Coverage check:
Every flow in
flow-walkthrough.mdmust have a corresponding spec file. Create a coverage matrix:Flow: "New user signup" → e2e/signup-flow.spec.ts ✅ Flow: "Returning user login" → e2e/login-flow.spec.ts ✅ Flow: "Create resource" → e2e/resource-flow.spec.ts ✅ ...
Test Quality Rules
- Full journeys, not page checks — each test navigates a complete user flow end-to-end
- Visual confirmation — assert headings, key content, navigation state at each step
- No hardcoded waits — use
waitFor,toBeVisible,toHaveURLpatterns - No hardcoded test data — use constants or fixtures
- Each test is independent — no test depends on another test's side effects
- POMs for all page interactions — never raw selectors in spec files
- Avoid
test.skip()— tests should exist and be runnable (they'll fail until implementation)
Output Structure
e2e/
├── playwright.config.ts # Already exists — do not modify
├── fixtures.ts # Shared test fixtures and helpers
├── {flow-name}.spec.ts # One spec per flow from flow-walkthrough.md
├── smoke.spec.ts # Smoke tests (critical happy paths)
└── pages/ # Page Object Models
├── landing.page.ts # One POM per screen from screen-map.md
├── login.page.ts
├── dashboard.page.ts
└── ...State Updates
After completing e2e generation:
- Update
.spec2cloud/state.json— set phase toe2e-generation-complete - Append to
.spec2cloud/audit.log:[TIMESTAMP] e2e-generation: Generated e2e specs for N flows [TIMESTAMP] e2e-generation: Generated N Page Object Models [TIMESTAMP] e2e-generation: All specs compile and are listed ✅ - Commit all generated files with message:
[e2e-gen] scaffold e2e tests for all flows
Mandatory Completion Checklist
The orchestrator MUST verify ALL of the following before marking e2e-generation as complete:
- At least one Playwright spec file (
e2e/*.spec.ts) exists for every user flow inspecs/ui/flow-walkthrough.md - A Page Object Model (
e2e/pages/*.page.ts) exists for every screen inspecs/ui/screen-map.md - Every POM uses
data-testidselectors fromspecs/ui/component-inventory.md(not CSS classes or XPath) e2e/playwright.config.tsexists and is configured for the Aspire environment- All spec files compile successfully (
npx playwright test --listreturns all specs without errors) - Navigation flows between pages are tested (not just individual page interactions)
- State JSON and audit log are updated
BLOCKING: If any item is unchecked, the skill has NOT completed successfully. The orchestrator must loop back and complete the missing items before advancing to Gherkin generation.
Other versions1 project uses a version of this.
Word for word · 1
- crgarcia12/Liliput★ 4100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository47 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- adrSkill
- api-extractorSkill
- architecture-mapperSkill
- aspireSkill
- audit-logSkill
- azure-deploymentSkill
- bug-fixSkill
- build-checkSkill
- cloud-native-assessmentSkill
- cloud-native-plannerSkill
- codebase-scannerSkill
- commit-protocolSkill
- contract-generationSkill
- data-model-extractorSkill
- ddd-modelingSkill
- dependency-inventorySkill
- deploy-diagnosticsSkill
- error-handlingSkill
- extension-plannerSkill
- find-skillsSkill
- frd-generatorSkill
- gherkin-generationSkill
- human-gateSkill
- implementationSkill
- modernization-assessmentSkill
- modernization-plannerSkill
- performance-assessmentSkill
- playwright-cliSkill
- prd-generatorSkill
- research-best-practicesSkill
- resumeSkill
- rewrite-assessmentSkill
- rewrite-plannerSkill
- security-assessmentSkill
- security-plannerSkill
- skill-creatorSkill
- skill-discoverySkill
- spec-refinementSkill
- spec-validatorSkill
- state-managementSkill
- tech-stack-resolutionSkill
- test-discoverySkill
- test-generationSkill
- test-runnerSkill
- ui-ux-designSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

