Senior QA Engineer
Generates unit tests, integration tests, and E2E tests for React/Next.js applications.
How to use it
Claude Code
- Run the line below. It pulls the whole folder into
~/.claude/skills/senior-qa, including the files SKILL.md points to. - Describe your job in plain words. Claude Code follows the skill from there.
npx degit alirezarezvani/claude-skills/engineering-team/skills/senior-qa#main ~/.claude/skills/senior-qaFor one project only, change the path to .claude/skills/senior-qa. This skill also uses Next.js, previous-coverage.json, ctx.json — copying SKILL.md alone won't be enough. See the folder on GitHub.
Claude (web or desktop app)
- On this page open ⋯ → Download .md.
- Save it as SKILL.md in a folder, zip the folder, then Customize → Skills → + → Create skill → Upload a skill.
- Pick the file and Save. Claude shows the name and description and runs a security scan.
- Check the skill is switched on.
- Start a new chat and describe your job in plain words. The AI follows the skill from there.
ChatGPT or another app
- ChatGPT: make a Project and paste it into Instructions.
- Neither? Paste it at the top of a new chat — it works for that chat.
Not working?
- Check which app you pasted it into — the steps above name the right one.
- Some skills need the paid tier of Claude or ChatGPT.
Paste into Claude, ChatGPT or Cursor.
Source of Senior QA Engineer
Show the full text332 lines
| name | description |
|---|---|
| senior-qa | Generates unit tests, integration tests, and E2E tests for React/Next.js applications. Scans components to create Jest + React Testing Library test stubs, analyzes Istanbul/LCOV coverage reports to surface gaps, scaffolds Playwright test files from Next.js routes, mocks API calls with MSW, creates test fixtures, and configures test runners. Use when the user asks to "generate tests", "write unit tests", "analyze test coverage", "scaffold E2E tests", "set up Playwright", "configure Jest", "implement testing patterns", or "improve test quality". |
Senior QA Engineer
Test automation, coverage analysis, and quality assurance patterns for React and Next.js applications.
Quick Start
# Generate Jest test stubs for React components
python scripts/test_suite_generator.py src/components/ --output __tests__/
# Analyze test coverage from Jest/Istanbul reports
python scripts/coverage_analyzer.py coverage/coverage-final.json --threshold 80
# Scaffold Playwright E2E tests for Next.js routes
python scripts/e2e_test_scaffolder.py src/app/ --output e2e/
Tools Overview
1. Test Suite Generator
Scans React/TypeScript components and generates Jest + React Testing Library test stubs with proper structure.
Input: Source directory containing React components Output: Test files with describe blocks, render tests, interaction tests
Usage:
# Basic usage - scan components and generate tests
python scripts/test_suite_generator.py src/components/ --output __tests__/
# Include accessibility tests
python scripts/test_suite_generator.py src/ --output __tests__/ --include-a11y
# Generate with custom template
python scripts/test_suite_generator.py src/ --template custom-template.tsx
Supported Patterns:
- Functional components with hooks
- Components with Context providers
- Components with data fetching
- Form components with validation
2. Coverage Analyzer
Parses Jest/Istanbul coverage reports and identifies gaps, uncovered branches, and provides actionable recommendations.
Input: Coverage report (JSON or LCOV format) Output: Coverage analysis with recommendations
Usage:
# Analyze coverage report
python scripts/coverage_analyzer.py coverage/coverage-final.json
# Enforce threshold (exit 1 if below)
python scripts/coverage_analyzer.py coverage/ --threshold 80 --strict
# Generate HTML report
python scripts/coverage_analyzer.py coverage/ --format html --output report.html
3. E2E Test Scaffolder
Scans Next.js pages/app directory and generates Playwright test files with common interactions.
Input: Next.js pages or app directory Output: Playwright test files organized by route
Usage:
# Scaffold E2E tests for Next.js App Router
python scripts/e2e_test_scaffolder.py src/app/ --output e2e/
# Include Page Object Model classes
python scripts/e2e_test_scaffolder.py src/app/ --output e2e/ --include-pom
# Generate for specific routes
python scripts/e2e_test_scaffolder.py src/app/ --routes "/login,/dashboard,/checkout"
QA Workflows
Unit Test Generation Workflow
Use when setting up tests for new or existing React components.
Step 1: Scan project for untested components
python scripts/test_suite_generator.py src/components/ --scan-only
Step 2: Generate test stubs
python scripts/test_suite_generator.py src/components/ --output __tests__/
Step 3: Review and customize generated tests
// __tests__/Button.test.tsx (generated)
import { render, screen, fireEvent } from '@testing-library/react';
import { Button } from '../src/components/Button';
describe('Button', () => {
it('renders with label', () => {
render(<Button>Click me</Button>);
expect(screen.getByRole('button', { name: /click me/i })).toBeInTheDocument();
});
it('calls onClick when clicked', () => {
const handleClick = jest.fn();
render(<Button onClick={handleClick}>Click</Button>);
fireEvent.click(screen.getByRole('button'));
expect(handleClick).toHaveBeenCalledTimes(1);
});
// TODO: Add your specific test cases
});
Step 4: Run tests and check coverage
npm test -- --coverage
python scripts/coverage_analyzer.py coverage/coverage-final.json
Coverage Analysis Workflow
Use when improving test coverage or preparing for release.
Step 1: Generate coverage report
npm test -- --coverage --coverageReporters=json
Step 2: Analyze coverage gaps
python scripts/coverage_analyzer.py coverage/coverage-final.json --threshold 80
Step 3: Identify critical paths
python scripts/coverage_analyzer.py coverage/ --critical-paths
Step 4: Generate missing test stubs
python scripts/test_suite_generator.py src/ --uncovered-only --output __tests__/
Step 5: Verify improvement
npm test -- --coverage
python scripts/coverage_analyzer.py coverage/ --compare previous-coverage.json
E2E Test Setup Workflow
Use when setting up Playwright for a Next.js project.
Step 1: Initialize Playwright (if not installed)
npm init playwright@latest
Step 2: Scaffold E2E tests from routes
python scripts/e2e_test_scaffolder.py src/app/ --output e2e/
Step 3: Configure authentication fixtures
// e2e/fixtures/auth.ts (generated)
import { test as base } from '@playwright/test';
export const test = base.extend({
authenticatedPage: async ({ page }, use) => {
await page.goto('/login');
await page.fill('[name="email"]', '[email protected]');
await page.fill('[name="password"]', 'password');
await page.click('button[type="submit"]');
await page.waitForURL('/dashboard');
await use(page);
},
});
Step 4: Run E2E tests
npx playwright test
npx playwright show-report
Step 5: Add to CI pipeline
# .github/workflows/e2e.yml
- name: "run-e2e-tests"
run: npx playwright test
- name: "upload-report"
uses: actions/upload-artifact@v3
with:
name: "playwright-report"
path: playwright-report/
Reference Documentation
| File | Contains | Use When |
|---|---|---|
references/testing_strategies.md |
Test pyramid, testing types, coverage targets, CI/CD integration | Designing test strategy |
references/test_automation_patterns.md |
Page Object Model, mocking (MSW), fixtures, async patterns | Writing test code |
references/qa_best_practices.md |
Testable code, flaky tests, debugging, quality metrics | Improving test quality |
Common Patterns Quick Reference
React Testing Library Queries
// Preferred (accessible)
screen.getByRole('button', { name: /submit/i })
screen.getByLabelText(/email/i)
screen.getByPlaceholderText(/search/i)
// Fallback
screen.getByTestId('custom-element')
Async Testing
// Wait for element
await screen.findByText(/loaded/i);
// Wait for removal
await waitForElementToBeRemoved(() => screen.queryByText(/loading/i));
// Wait for condition
await waitFor(() => {
expect(mockFn).toHaveBeenCalled();
});
Mocking with MSW
import { rest } from 'msw';
import { setupServer } from 'msw/node';
const server = setupServer(
rest.get('/api/users', (req, res, ctx) => {
return res(ctx.json([{ id: 1, name: "john" }]));
})
);
beforeAll(() => server.listen());
afterEach(() => server.resetHandlers());
afterAll(() => server.close());
Playwright Locators
// Preferred
page.getByRole('button', { name: "submit" })
page.getByLabel('Email')
page.getByText('Welcome')
// Chaining
page.getByRole('listitem').filter({ hasText: 'Product' })
Coverage Thresholds (jest.config.js)
module.exports = {
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
};
Common Commands
# Jest
npm test # Run all tests
npm test -- --watch # Watch mode
npm test -- --coverage # With coverage
npm test -- Button.test.tsx # Single file
# Playwright
npx playwright test # Run all E2E tests
npx playwright test --ui # UI mode
npx playwright test --debug # Debug mode
npx playwright codegen # Generate tests
# Coverage
npm test -- --coverage --coverageReporters=lcov,json
python scripts/coverage_analyzer.py coverage/coverage-final.json
| 1 | |
| 2 | name "senior-qa" |
| 3 | description Generates unit tests, integration tests, and E2E tests for React/Next.js applications. Scans components to create Jest + React Testing Library test stubs, analyzes Istanbul/LCOV coverage reports to surface gaps, scaffolds Playwright test files from Next.js routes, mocks API calls with MSW, creates test fixtures, and configures test runners. Use when the user asks to "generate tests", "write unit tests", "analyze test coverage", "scaffold E2E tests", "set up Playwright", "configure Jest", "implement testing patterns", or "improve test quality". |
| 4 | |
| 5 | |
| 6 | # Senior QA Engineer |
| 7 | |
| 8 | Test automation, coverage analysis, and quality assurance patterns for React and Next.js applications. |
| 9 | |
| 10 | |
| 11 | |
| 12 | ## Quick Start |
| 13 | |
| 14 | |
| 15 | # Generate Jest test stubs for React components |
| 16 | python scripts/test_suite_generator.py src/components/ --output __tests__/ |
| 17 | |
| 18 | # Analyze test coverage from Jest/Istanbul reports |
| 19 | python scripts/coverage_analyzer.py coverage/coverage-final.json --threshold 80 |
| 20 | |
| 21 | # Scaffold Playwright E2E tests for Next.js routes |
| 22 | python scripts/e2e_test_scaffolder.py src/app/ --output e2e/ |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | ## Tools Overview |
| 28 | |
| 29 | ### 1. Test Suite Generator |
| 30 | |
| 31 | Scans React/TypeScript components and generates Jest + React Testing Library test stubs with proper structure. |
| 32 | |
| 33 | **Input:** Source directory containing React components |
| 34 | **Output:** Test files with describe blocks, render tests, interaction tests |
| 35 | |
| 36 | **Usage:** |
| 37 | |
| 38 | # Basic usage - scan components and generate tests |
| 39 | python scripts/test_suite_generator.py src/components/ --output __tests__/ |
| 40 | |
| 41 | # Include accessibility tests |
| 42 | python scripts/test_suite_generator.py src/ --output __tests__/ --include-a11y |
| 43 | |
| 44 | # Generate with custom template |
| 45 | python scripts/test_suite_generator.py src/ --template custom-template.tsx |
| 46 | |
| 47 | |
| 48 | **Supported Patterns:** |
| 49 | Functional components with hooks |
| 50 | Components with Context providers |
| 51 | Components with data fetching |
| 52 | Form components with validation |
| 53 | |
| 54 | |
| 55 | |
| 56 | ### 2. Coverage Analyzer |
| 57 | |
| 58 | Parses Jest/Istanbul coverage reports and identifies gaps, uncovered branches, and provides actionable recommendations. |
| 59 | |
| 60 | **Input:** Coverage report (JSON or LCOV format) |
| 61 | **Output:** Coverage analysis with recommendations |
| 62 | |
| 63 | **Usage:** |
| 64 | |
| 65 | # Analyze coverage report |
| 66 | python scripts/coverage_analyzer.py coverage/coverage-final.json |
| 67 | |
| 68 | # Enforce threshold (exit 1 if below) |
| 69 | python scripts/coverage_analyzer.py coverage/ --threshold 80 --strict |
| 70 | |
| 71 | # Generate HTML report |
| 72 | python scripts/coverage_analyzer.py coverage/ --format html --output report.html |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | ### 3. E2E Test Scaffolder |
| 78 | |
| 79 | Scans Next.js pages/app directory and generates Playwright test files with common interactions. |
| 80 | |
| 81 | **Input:** Next.js pages or app directory |
| 82 | **Output:** Playwright test files organized by route |
| 83 | |
| 84 | **Usage:** |
| 85 | |
| 86 | # Scaffold E2E tests for Next.js App Router |
| 87 | python scripts/e2e_test_scaffolder.py src/app/ --output e2e/ |
| 88 | |
| 89 | # Include Page Object Model classes |
| 90 | python scripts/e2e_test_scaffolder.py src/app/ --output e2e/ --include-pom |
| 91 | |
| 92 | # Generate for specific routes |
| 93 | python scripts/e2e_test_scaffolder.py src/app/ --routes "/login,/dashboard,/checkout" |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | ## QA Workflows |
| 99 | |
| 100 | ### Unit Test Generation Workflow |
| 101 | |
| 102 | Use when setting up tests for new or existing React components. |
| 103 | |
| 104 | **Step 1: Scan project for untested components** |
| 105 | |
| 106 | python scripts/test_suite_generator.py src/components/ --scan-only |
| 107 | |
| 108 | |
| 109 | **Step 2: Generate test stubs** |
| 110 | |
| 111 | python scripts/test_suite_generator.py src/components/ --output __tests__/ |
| 112 | |
| 113 | |
| 114 | **Step 3: Review and customize generated tests** |
| 115 | |
| 116 | // __tests__/Button.test.tsx (generated) |
| 117 | import { render, screen, fireEvent } from '@testing-library/react'; |
| 118 | import { Button } from '../src/components/Button'; |
| 119 | |
| 120 | describe('Button', () => { |
| 121 | it('renders with label', () => { |
| 122 | render(<Button>Click me</Button>); |
| 123 | expect(screen.getByRole('button', { name: /click me/i })).toBeInTheDocument(); |
| 124 | }); |
| 125 | |
| 126 | it('calls onClick when clicked', () => { |
| 127 | const handleClick = jest.fn(); |
| 128 | render(<Button onClick={handleClick}>Click</Button>); |
| 129 | fireEvent.click(screen.getByRole('button')); |
| 130 | expect(handleClick).toHaveBeenCalledTimes(1); |
| 131 | }); |
| 132 | |
| 133 | // TODO: Add your specific test cases |
| 134 | }); |
| 135 | |
| 136 | |
| 137 | **Step 4: Run tests and check coverage** |
| 138 | |
| 139 | npm test -- --coverage |
| 140 | python scripts/coverage_analyzer.py coverage/coverage-final.json |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | ### Coverage Analysis Workflow |
| 146 | |
| 147 | Use when improving test coverage or preparing for release. |
| 148 | |
| 149 | **Step 1: Generate coverage report** |
| 150 | |
| 151 | npm test -- --coverage --coverageReporters=json |
| 152 | |
| 153 | |
| 154 | **Step 2: Analyze coverage gaps** |
| 155 | |
| 156 | python scripts/coverage_analyzer.py coverage/coverage-final.json --threshold 80 |
| 157 | |
| 158 | |
| 159 | **Step 3: Identify critical paths** |
| 160 | |
| 161 | python scripts/coverage_analyzer.py coverage/ --critical-paths |
| 162 | |
| 163 | |
| 164 | **Step 4: Generate missing test stubs** |
| 165 | |
| 166 | python scripts/test_suite_generator.py src/ --uncovered-only --output __tests__/ |
| 167 | |
| 168 | |
| 169 | **Step 5: Verify improvement** |
| 170 | |
| 171 | npm test -- --coverage |
| 172 | python scripts/coverage_analyzer.py coverage/ --compare previous-coverage.json |
| 173 | |
| 174 | |
| 175 | |
| 176 | |
| 177 | ### E2E Test Setup Workflow |
| 178 | |
| 179 | Use when setting up Playwright for a Next.js project. |
| 180 | |
| 181 | **Step 1: Initialize Playwright (if not installed)** |
| 182 | |
| 183 | npm init playwright@latest |
| 184 | |
| 185 | |
| 186 | **Step 2: Scaffold E2E tests from routes** |
| 187 | |
| 188 | python scripts/e2e_test_scaffolder.py src/app/ --output e2e/ |
| 189 | |
| 190 | |
| 191 | **Step 3: Configure authentication fixtures** |
| 192 | |
| 193 | // e2e/fixtures/auth.ts (generated) |
| 194 | import { test as base } from '@playwright/test'; |
| 195 | |
| 196 | export const test = base.extend({ |
| 197 | authenticatedPage: async ({ page }, use) => { |
| 198 | await page.goto('/login'); |
| 199 | await page.fill('[name="email"]', '[email protected]'); |
| 200 | await page.fill('[name="password"]', 'password'); |
| 201 | await page.click('button[type="submit"]'); |
| 202 | await page.waitForURL('/dashboard'); |
| 203 | await use(page); |
| 204 | }, |
| 205 | }); |
| 206 | |
| 207 | |
| 208 | **Step 4: Run E2E tests** |
| 209 | |
| 210 | npx playwright test |
| 211 | npx playwright show-report |
| 212 | |
| 213 | |
| 214 | **Step 5: Add to CI pipeline** |
| 215 | |
| 216 | # .github/workflows/e2e.yml |
| 217 | - name: "run-e2e-tests" |
| 218 | run: npx playwright test |
| 219 | - name: "upload-report" |
| 220 | uses: actions/upload-artifact@v3 |
| 221 | with: |
| 222 | name: "playwright-report" |
| 223 | path: playwright-report/ |
| 224 | |
| 225 | |
| 226 | |
| 227 | |
| 228 | ## Reference Documentation |
| 229 | |
| 230 | | File | Contains | Use When | |
| 231 | |------|----------|----------| |
| 232 | | `references/testing_strategies.md` | Test pyramid, testing types, coverage targets, CI/CD integration | Designing test strategy | |
| 233 | | `references/test_automation_patterns.md` | Page Object Model, mocking (MSW), fixtures, async patterns | Writing test code | |
| 234 | | `references/qa_best_practices.md` | Testable code, flaky tests, debugging, quality metrics | Improving test quality | |
| 235 | |
| 236 | |
| 237 | |
| 238 | ## Common Patterns Quick Reference |
| 239 | |
| 240 | ### React Testing Library Queries |
| 241 | |
| 242 | |
| 243 | // Preferred (accessible) |
| 244 | screen.getByRole('button', { name: /submit/i }) |
| 245 | screen.getByLabelText(/email/i) |
| 246 | screen.getByPlaceholderText(/search/i) |
| 247 | |
| 248 | // Fallback |
| 249 | screen.getByTestId('custom-element') |
| 250 | |
| 251 | |
| 252 | ### Async Testing |
| 253 | |
| 254 | |
| 255 | // Wait for element |
| 256 | await screen.findByText(/loaded/i); |
| 257 | |
| 258 | // Wait for removal |
| 259 | await waitForElementToBeRemoved(() => screen.queryByText(/loading/i)); |
| 260 | |
| 261 | // Wait for condition |
| 262 | await waitFor(() => { |
| 263 | expect(mockFn).toHaveBeenCalled(); |
| 264 | }); |
| 265 | |
| 266 | |
| 267 | ### Mocking with MSW |
| 268 | |
| 269 | |
| 270 | import { rest } from 'msw'; |
| 271 | import { setupServer } from 'msw/node'; |
| 272 | |
| 273 | const server = setupServer( |
| 274 | rest.get('/api/users', (req, res, ctx) => { |
| 275 | return res(ctx.json([{ id: 1, name: "john" }])); |
| 276 | }) |
| 277 | ); |
| 278 | |
| 279 | beforeAll(() => server.listen()); |
| 280 | afterEach(() => server.resetHandlers()); |
| 281 | afterAll(() => server.close()); |
| 282 | |
| 283 | |
| 284 | ### Playwright Locators |
| 285 | |
| 286 | |
| 287 | // Preferred |
| 288 | page.getByRole('button', { name: "submit" }) |
| 289 | page.getByLabel('Email') |
| 290 | page.getByText('Welcome') |
| 291 | |
| 292 | // Chaining |
| 293 | page.getByRole('listitem').filter({ hasText: 'Product' }) |
| 294 | |
| 295 | |
| 296 | ### Coverage Thresholds (jest.config.js) |
| 297 | |
| 298 | |
| 299 | module.exports = { |
| 300 | coverageThreshold: { |
| 301 | global: { |
| 302 | branches: 80, |
| 303 | functions: 80, |
| 304 | lines: 80, |
| 305 | statements: 80, |
| 306 | }, |
| 307 | }, |
| 308 | }; |
| 309 | |
| 310 | |
| 311 | |
| 312 | |
| 313 | ## Common Commands |
| 314 | |
| 315 | |
| 316 | # Jest |
| 317 | npm test # Run all tests |
| 318 | npm test -- --watch # Watch mode |
| 319 | npm test -- --coverage # With coverage |
| 320 | npm test -- Button.test.tsx # Single file |
| 321 | |
| 322 | # Playwright |
| 323 | npx playwright test # Run all E2E tests |
| 324 | npx playwright test --ui # UI mode |
| 325 | npx playwright test --debug # Debug mode |
| 326 | npx playwright codegen # Generate tests |
| 327 | |
| 328 | # Coverage |
| 329 | npm test -- --coverage --coverageReporters=lcov,json |
| 330 | python scripts/coverage_analyzer.py coverage/coverage-final.json |
| 331 | |
| 332 |
Discussion
Browse more free Claude skills or everything in Development.