agentleFS
onegunsamuraionegunsamurai/OpenLearning/.claude/skills/e2e-test-feature/SKILL.md

e2e-test-feature

Skill1 starsChanged 8 months agoMITView on GitHub

E2E test the current feature/fix using Playwright MCP browser automation

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 5 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Test the feature or fix on the current branch using Playwright MCP browser automation.

    line 8
  2. Distinctive:

    Read the recent commits to understand what changed.

    line 21
  3. Distinctive:

    If on main or no changes exist, ask the user what specific flow to test before proceeding.

    line 27
  4. Very specific:

    Read the relevant page objects in frontend/e2e/pages/*.page.ts to understand the expected element selectors for each page.

    line 48
  5. Distinctive:

    If any auth-required pages are in the test plan:

    line 58
  6. Very specific:

    Use mcp__playwright__browser_snapshot to verify the login form loaded

    line 60
  7. Very specific:

    Wait for redirect to /dashboard using mcp__playwright__browser_wait_for

    line 64
  8. Distinctive:

    If login fails (user not registered), first register via the Register tab with the same credentials, then sign in

    line 65
  9. Very specific:

    Use mcp__playwright__browser_click for buttons, tabs, links

    line 78
  10. Very specific:

    Use mcp__playwright__browser_fill_form for form inputs

    line 79
  11. Very specific:

    Use mcp__playwright__browser_type for text inputs like chat

    line 80
  12. Very specific:

    Use mcp__playwright__browser_press_key for keyboard actions (Enter to submit)

    line 81
  13. Very specific:

    After all tests complete, use mcp__playwright__browser_close to clean up.

    line 86

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Feature-Focused E2E Testing

Test the feature or fix on the current branch using Playwright MCP browser automation. Gathers context from git and issues, plans which pages/flows to test, executes interactively, and reports results formatted for the next fix iteration.

Steps

1. Gather Context

git branch --show-current
git log --oneline -10
git diff main...HEAD --name-only
  • Identify the current branch name and parse it for feature context (e.g., feat/fix-login-redirect means test login redirect).
  • Read the recent commits to understand what changed.
  • List all files changed vs main to determine scope.
  • Extract any issue numbers from branch name or commit messages (e.g., #123). If found, read the issue:
    gh issue view <number>
  • If on main or no changes exist, ask the user what specific flow to test before proceeding.

2. Plan Test Flow

Map changed files to pages that need testing:

Changed File PatternURL to Test
frontend/src/app/page.tsx/
frontend/src/app/login/**/login
frontend/src/app/assess/**/assess
frontend/src/app/dashboard/**/dashboard
frontend/src/app/gap-analysis/**/gap-analysis
frontend/src/app/learning-plan/**/learning-plan
frontend/src/app/demo/**/demo/assess, /demo/report
frontend/src/app/export/**/export/[id]
frontend/src/components/**All pages importing the component
frontend/src/hooks/**All pages using the hook
frontend/src/lib/**All pages using the module
backend/app/routes/**Frontend pages that call those API routes

Read the relevant page objects in frontend/e2e/pages/*.page.ts to understand the expected element selectors for each page.

Determine which pages require authentication:

  • Public (no auth): /, /login, /demo/assess, /demo/report
  • Auth required: /dashboard, /assess, /gap-analysis, /learning-plan, /export/[id]

3. Pre-flight Check

Navigate to http://localhost:3000 using mcp__playwright__browser_navigate. If it fails to load, tell the user to run make dev and stop.

If any auth-required pages are in the test plan:

  1. Navigate to http://localhost:3000/login
  2. Use mcp__playwright__browser_snapshot to verify the login form loaded
  3. Click the "Sign In" tab via mcp__playwright__browser_click
  4. Fill email $E2E_TEST_EMAIL and password $E2E_TEST_PASSWORD (from env vars) using mcp__playwright__browser_fill_form
  5. Click the "Sign In" button via mcp__playwright__browser_click
  6. Wait for redirect to /dashboard using mcp__playwright__browser_wait_for
  7. If login fails (user not registered), first register via the Register tab with the same credentials, then sign in

4. Execute Tests

For each page in the test plan, run this sequence:

  1. Navigate: mcp__playwright__browser_navigate to http://localhost:3000/<path>
  2. Wait: mcp__playwright__browser_wait_for for the page's key elements (reference the page object selectors)
  3. Snapshot: mcp__playwright__browser_snapshot — verify expected elements are present in the accessibility tree
  4. Console check: mcp__playwright__browser_console_messages — flag any error level messages
  5. Network check: mcp__playwright__browser_network_requests — flag any 4xx/5xx responses that are not expected
  6. Screenshot: mcp__playwright__browser_take_screenshot — save to e2e-screenshots/feat-NN-<page-name>.png
  7. Feature interactions: Based on the feature context, interact with the specific elements that changed:
    • Use mcp__playwright__browser_click for buttons, tabs, links
    • Use mcp__playwright__browser_fill_form for form inputs
    • Use mcp__playwright__browser_type for text inputs like chat
    • Use mcp__playwright__browser_press_key for keyboard actions (Enter to submit)
  8. Post-interaction verify: Take another snapshot and screenshot to confirm the expected state change occurred

5. Close Browser

After all tests complete, use mcp__playwright__browser_close to clean up.

Output Format

## E2E Test Results: <branch-name>

### Context
- **Branch:** <branch-name>
- **Feature:** <description from issue or commits>
- **Related issue:** <#number and title, or "none">
- **Pages tested:** <comma-separated list>

### Results

| # | Page | Test | Status | Details |
|---|------|------|--------|---------|
| 1 | /login | Page loads | PASS | All form elements visible |
| 2 | /login | Sign in flow | PASS | Redirects to /dashboard |
| 3 | /dashboard | Console errors | FAIL | TypeError: Cannot read property 'map' of undefined |

### Console Errors
| Page | Level | Message |
|------|-------|---------|
(deduplicated — omit this section if none found)

### Network Errors
| Page | URL | Status | Method |
|------|-----|--------|--------|
(omit this section if none found)

### Screenshots
1. `e2e-screenshots/feat-01-login.png` — Login page after load
2. `e2e-screenshots/feat-02-dashboard.png` — Dashboard after sign in

### Recommended Next Steps
- <actionable fix 1 based on failures, with file:line reference if possible>
- <actionable fix 2>
(omit this section if all tests pass)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.