bmad-qa-generate-e2e-tests
bmad-code-org/bmad-method
Generate automated API and E2E tests for implemented features using your project's existing test framework.
What is bmad-qa-generate-e2e-tests?
This skill generates automated API and end-to-end tests for implemented code features. Use it when you need to create QA tests for a specific feature—it detects your project's test framework, generates tests following existing patterns, runs them to verify they pass, and outputs a summary.
- Detects your project's test framework (Playwright, Jest, Vitest, Cypress, etc.) or recommends one if none exists
- Generates API tests covering status codes, response structure, happy paths, and error cases
- Generates E2E tests for UI features using semantic locators and user workflows
- Executes tests to verify they pass and fixes failures immediately
- Creates a markdown summary of generated tests and coverage
How to install bmad-qa-generate-e2e-tests
npx skills add https://github.com/bmad-code-org/bmad-method --skill bmad-qa-generate-e2e-tests- BMad setup in your project (run `npx skills add bmad-code-org/BMAD-METHOD --skill bmad` if not already installed)
- An existing test framework in your project (Playwright, Jest, Vitest, Cypress, etc.) or willingness to adopt a recommended one
- Source code for the feature(s) you want to test
How to use bmad-qa-generate-e2e-tests
- 1.Activate the skill and greet the workflow
- 2.Specify what feature or directory to test (or let it auto-discover)
- 3.The skill detects your test framework and generates API tests (if applicable) covering status codes, response structure, and error cases
- 4.The skill generates E2E tests (if UI exists) using semantic locators and user workflows
- 5.Tests are executed automatically; any failures are fixed immediately
- 6.Review the generated test summary markdown in your output folder
Use cases
- Generate comprehensive API tests for a newly implemented REST endpoint
- Create E2E tests for a new user-facing feature or component workflow
- Establish test coverage for a feature before merging to main
- Generate tests following your project's existing test patterns and conventions
- Validate that implemented features work correctly across happy path and error scenarios
- QA automation engineers
- Full-stack developers adding test coverage to features
- Teams using the BMad method for structured development
- Projects with existing test frameworks seeking consistent test generation
bmad-qa-generate-e2e-tests FAQ
It auto-detects frameworks like Playwright, Jest, Vitest, and Cypress from your package.json and existing test files. If none exist, it recommends a framework based on your project type.
No. The skill generates tests automatically based on your feature code and existing test patterns in your project.
The skill runs tests immediately and fixes failures on the spot before outputting the summary.
This skill focuses on straightforward API and E2E tests. For advanced strategies like risk-based testing, test design planning, or comprehensive coverage analysis, install the Test Architect (TEA) module.
Tests are saved in your project's `tests/` directory following existing patterns, and a summary is output to your configured output folder.
Full instructions (SKILL.md)
Source of truth, from bmad-code-org/bmad-method.
name: bmad-qa-generate-e2e-tests description: 'Generate automated API and end-to-end tests for implemented features. Use when the user says "create qa automated tests for [feature]"'
QA Generate E2E Tests Workflow
Goal: Generate automated API and E2E tests for implemented code.
Your Role: You are a QA automation engineer. You generate tests ONLY — no code review or story validation (use the bmad-code-review skill for that).
Conventions
- Bare paths (e.g.
checklist.md) resolve from the skill root. {skill-root}resolves to this skill's installed directory (wherecustomize.tomllives).{project-root}is the nearest folder containing_bmad/, starting at the project working directory and moving up through its parents.{skill-name}resolves to the skill directory's basename.
On Activation
Step 1: Resolve the Workflow Block
Run: uv run {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --project-root {project-root} --key workflow
If the script is not found, BMad is not set up here. Offer to run the bmad skill's setup, installing bmad first if you do not have it (npx skills add bmad-code-org/BMAD-METHOD --skill bmad), then run the command again.
If it fails for any other reason, resolve the workflow block yourself by reading these three files in base → team → user order and applying the same structural merge rules as the resolver:
{skill-root}/customize.toml— defaults{project-root}/_bmad/custom/{skill-name}.toml— team overrides{project-root}/_bmad/custom/{skill-name}.user.toml— personal overrides
Any missing file is skipped. Scalars override, tables deep-merge, arrays of tables keyed by code or id replace matching entries and append new entries, and all other arrays append.
Step 2: Execute Prepend Steps
Execute each entry in {workflow.activation_steps_prepend} in order before proceeding.
Step 3: Load Persistent Facts
Treat every entry in {workflow.persistent_facts} as foundational context you carry for the rest of the workflow run. Entries prefixed file: are paths or globs under {project-root} — load the referenced contents as facts. All other entries are facts verbatim.
Step 4: Load Config
Run: uv run {project-root}/_bmad/scripts/resolve_config.py --project-root {project-root} --key core.project_name --key core.output_folder --key core.active_initiative
-
Script not found, or no
output_folder: BMad is not set up here. Offer to run thebmadskill's setup, installingbmadfirst if you do not have it (npx skills add bmad-code-org/BMAD-METHOD --skill bmad), then run the command again. -
No
active_initiative: drop/{active_initiative}from the paths below. -
dateas system-generated current datetime -
YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style
Step 5: Greet the User
Greet the user.
Step 6: Execute Append Steps
Execute each entry in {workflow.activation_steps_append} in order.
Activation is complete. If activation_steps_prepend or activation_steps_append were non-empty, confirm every entry was executed in order before proceeding. Do not begin the main workflow until all activation steps have been completed.
Paths
test_dir={project-root}/testssource_dir={project-root}default_output_file={output_folder}/{active_initiative}/test-summary-{slug}/test-summary-{slug}.md,{slug}naming the feature tested
Execution
Step 0: Detect Test Framework
Check project for existing test framework:
- Look for
package.jsondependencies (playwright, jest, vitest, cypress, etc.) - Check for existing test files to understand patterns
- Use whatever test framework the project already has
- If no framework exists:
- Analyze source code to determine project type (React, Vue, Node API, etc.)
- Search online for current recommended test framework for that stack
- Suggest the meta framework and use it (or ask user to confirm)
Step 1: Identify Features
Ask user what to test:
- Specific feature/component name
- Directory to scan (e.g.,
src/components/) - Or auto-discover features in the codebase
Step 2: Generate API Tests (if applicable)
For API endpoints/services, generate tests that:
- Test status codes (200, 400, 404, 500)
- Validate response structure
- Cover happy path + 1-2 error cases
- Use project's existing test framework patterns
Step 3: Generate E2E Tests (if UI exists)
For UI features, generate tests that:
- Test user workflows end-to-end
- Use semantic locators (roles, labels, text)
- Focus on user interactions (clicks, form fills, navigation)
- Assert visible outcomes
- Keep tests linear and simple
- Follow project's existing test patterns
Step 4: Run Tests
Execute tests to verify they pass (use project's test command).
If failures occur, fix them immediately.
Step 5: Create Summary
Output markdown summary:
# Test Automation Summary
## Generated Tests
### API Tests
- [x] tests/api/endpoint.spec.ts - Endpoint validation
### E2E Tests
- [x] tests/e2e/feature.spec.ts - User workflow
## Coverage
- API endpoints: 5/10 covered
- UI features: 3/8 covered
## Next Steps
- Run tests in CI
- Add more edge cases as needed
Keep It Simple
Do:
- Use standard test framework APIs
- Focus on happy path + critical errors
- Write readable, maintainable tests
- Run tests to verify they pass
Avoid:
- Complex fixture composition
- Over-engineering
- Unnecessary abstractions
For Advanced Features:
If the project needs:
- Risk-based test strategy
- Test design planning
- Quality gates and NFR assessment
- Comprehensive coverage analysis
- Advanced testing patterns and utilities
Install Test Architect (TEA) module: https://bmad-code-org.github.io/bmad-method-test-architecture-enterprise/
Output
Save summary to: {default_output_file}
Done! Tests generated and verified. Validate against checklist.md.
On Complete
Run: uv run {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --project-root {project-root} --key workflow.on_complete
If the resolved workflow.on_complete is non-empty, follow it as the final terminal instruction before exiting.
Related skills
More from bmad-code-org/bmad-method and the wider catalog.

bmad-retrospective
Review finished epics against their evidence and produce sourced retrospectives with action items.

bmad-review
Run multiple review lenses on code and documents to surface adversarial critique, edge cases, gaps, and structural issues.

bmad-spec
Distill any input into a machine-readable spec: kernel file plus companions for downstream BMad skills.

bmad-sprint-planning
Check planning readiness and generate sprint status from epics; validate and repair tracking files.

bmad-ux
Capture UX vision in DESIGN.md and EXPERIENCE.md documents via structured elicitation.

bmad-walkthrough
Guide structured human review of commits, PRs, files, or directories using BMad workflows.