| name |
description |
license |
tags |
| webapp-testing |
Generate and execute comprehensive test suites for web applications. Covers unit, integration, E2E, and visual regression tests. Analyzes application structure to create meaningful test cases with high coverage. |
MIT |
--- testing qa automation e2e playwright jest |
Webapp Testing
Overview
Generate and execute comprehensive test suites for web applications covering unit, integration, end-to-end, and visual regression testing. Analyzes application structure to produce high-coverage, meaningful test cases.
When to Use
- When building a new feature that needs test coverage from day one
- When a codebase has low test coverage and you want to improve it
- When setting up an E2E test suite for critical user flows
- When adding visual regression tests to catch UI regressions
- When preparing a release and need to verify all critical paths
Instructions
- Accept: application source directory or URL, test type(s) to generate (unit/integration/e2e/visual), coverage targets, and testing framework preference.
- Analyze application structure:
- Identify components, pages, and API endpoints.
- Map critical user flows (auth, checkout, core CRUD operations).
- Review existing tests to avoid duplication.
- Generate unit tests:
- Pure functions: input/output coverage including edge cases.
- React/Vue components: render, props, state changes, event handlers.
- Use Jest/Vitest with React Testing Library for component tests.
- Generate integration tests:
- API endpoint tests: happy path, validation errors, auth failures.
- Database interactions: CRUD operations with test fixtures.
- Service layer: mock external dependencies.
- Generate E2E tests (Playwright):
- Critical user flows: registration, login, primary feature, checkout.
- Cross-browser: Chromium, Firefox, WebKit.
- Mobile viewport coverage.
- Test data fixtures and cleanup.
- Generate visual regression tests:
- Screenshot tests for key pages and components.
- Baseline capture and comparison configuration.
- Calculate coverage estimate and identify untested paths.
- Return test files, coverage estimate, and setup instructions.
Environment
FRAMEWORK=playwright+jest
COVERAGE_TARGET=80
BROWSERS=chromium,firefox,webkit
INCLUDE_VISUAL=true
TEST_DATA_FIXTURES=true
Examples
Input:
app_url: https://staging.myapp.com
app_dir: ./src
test_types: [e2e, unit]
coverage_target: 85
priority_flows: [login, checkout, user-profile]
Output:
Webapp Test Suite Generated
Test files created: 12
Estimated coverage: 87%
Unit tests (6 files):
- auth.service.test.ts: 24 tests (login, register, token refresh)
- cart.utils.test.ts: 18 tests (add, remove, calculate totals)
- CheckoutForm.test.tsx: 15 tests (validation, submission, error states)
E2E tests (4 files, Playwright):
- auth.spec.ts: login/logout flow (3 scenarios)
- checkout.spec.ts: full purchase flow (5 scenarios)
- profile.spec.ts: profile CRUD (4 scenarios)
Setup: npx playwright install && npm test
CI config: .github/workflows/test.yml generated
1---2name: webapp-testing3description: | name | description | license | tags |4---5| name | description | license | tags |6|------|-------------|---------|------|7| webapp-testing | Generate and execute comprehensive test suites for web applications. Covers unit, integration, E2E, and visual regression tests. Analyzes application structure to create meaningful test cases with high coverage. | MIT | --- testing qa automation e2e playwright jest |89# Webapp Testing1011## Overview1213Generate and execute comprehensive test suites for web applications covering unit, integration, end-to-end, and visual regression testing. Analyzes application structure to produce high-coverage, meaningful test cases.1415## When to Use1617- When building a new feature that needs test coverage from day one18- When a codebase has low test coverage and you want to improve it19- When setting up an E2E test suite for critical user flows20- When adding visual regression tests to catch UI regressions21- When preparing a release and need to verify all critical paths2223## Instructions24251. Accept: application source directory or URL, test type(s) to generate (unit/integration/e2e/visual), coverage targets, and testing framework preference.262. Analyze application structure:27 - Identify components, pages, and API endpoints.28 - Map critical user flows (auth, checkout, core CRUD operations).29 - Review existing tests to avoid duplication.303. Generate unit tests:31 - Pure functions: input/output coverage including edge cases.32 - React/Vue components: render, props, state changes, event handlers.33 - Use Jest/Vitest with React Testing Library for component tests.344. Generate integration tests:35 - API endpoint tests: happy path, validation errors, auth failures.36 - Database interactions: CRUD operations with test fixtures.37 - Service layer: mock external dependencies.385. Generate E2E tests (Playwright):39 - Critical user flows: registration, login, primary feature, checkout.40 - Cross-browser: Chromium, Firefox, WebKit.41 - Mobile viewport coverage.42 - Test data fixtures and cleanup.436. Generate visual regression tests:44 - Screenshot tests for key pages and components.45 - Baseline capture and comparison configuration.467. Calculate coverage estimate and identify untested paths.478. Return test files, coverage estimate, and setup instructions.4849## Environment5051```52FRAMEWORK=playwright+jest53COVERAGE_TARGET=8054BROWSERS=chromium,firefox,webkit55INCLUDE_VISUAL=true56TEST_DATA_FIXTURES=true57```5859## Examples6061**Input:**62```63app_url: https://staging.myapp.com64app_dir: ./src65test_types: [e2e, unit]66coverage_target: 8567priority_flows: [login, checkout, user-profile]68```6970**Output:**71```72Webapp Test Suite Generated73Test files created: 1274Estimated coverage: 87%7576Unit tests (6 files):77- auth.service.test.ts: 24 tests (login, register, token refresh)78- cart.utils.test.ts: 18 tests (add, remove, calculate totals)79- CheckoutForm.test.tsx: 15 tests (validation, submission, error states)8081E2E tests (4 files, Playwright):82- auth.spec.ts: login/logout flow (3 scenarios)83- checkout.spec.ts: full purchase flow (5 scenarios)84- profile.spec.ts: profile CRUD (4 scenarios)8586Setup: npx playwright install && npm test87CI config: .github/workflows/test.yml generated88```