Senior QA Engineer

Generates unit tests, integration tests, and E2E tests for React/Next.js applications.

How to use it

Claude Code
  1. Run the line below. It pulls the whole folder into ~/.claude/skills/senior-qa, including the files SKILL.md points to.
  2. Describe your job in plain words. Claude Code follows the skill from there.
Claude Code — installs the whole folder, not just SKILL.md
npx degit alirezarezvani/claude-skills/engineering-team/skills/senior-qa#main ~/.claude/skills/senior-qa

For 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)
  1. On this page open ⋯ → Download .md.
  2. Save it as SKILL.md in a folder, zip the folder, then Customize → Skills → + → Create skill → Upload a skill.
  3. Pick the file and Save. Claude shows the name and description and runs a security scan.
  4. Check the skill is switched on.
  5. Start a new chat and describe your job in plain words. The AI follows the skill from there.
ChatGPT or another app
  1. ChatGPT: make a Project and paste it into Instructions.
  2. 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.
Step-by-step guide with screenshots · Ask in the forum

Paste into Claude, ChatGPT or Cursor.

Source of Senior QA Engineer

Show the full text332 lines
namedescription
senior-qaGenerates 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---
2name: "senior-qa"
3description: 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 
8Test automation, coverage analysis, and quality assurance patterns for React and Next.js applications.
9 
10---
11 
12## Quick Start
13 
14```bash
15# Generate Jest test stubs for React components
16python scripts/test_suite_generator.py src/components/ --output __tests__/
17 
18# Analyze test coverage from Jest/Istanbul reports
19python scripts/coverage_analyzer.py coverage/coverage-final.json --threshold 80
20 
21# Scaffold Playwright E2E tests for Next.js routes
22python scripts/e2e_test_scaffolder.py src/app/ --output e2e/
23```
24 
25---
26 
27## Tools Overview
28 
29### 1. Test Suite Generator
30 
31Scans 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```bash
38# Basic usage - scan components and generate tests
39python scripts/test_suite_generator.py src/components/ --output __tests__/
40 
41# Include accessibility tests
42python scripts/test_suite_generator.py src/ --output __tests__/ --include-a11y
43 
44# Generate with custom template
45python 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 
58Parses 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```bash
65# Analyze coverage report
66python scripts/coverage_analyzer.py coverage/coverage-final.json
67 
68# Enforce threshold (exit 1 if below)
69python scripts/coverage_analyzer.py coverage/ --threshold 80 --strict
70 
71# Generate HTML report
72python scripts/coverage_analyzer.py coverage/ --format html --output report.html
73```
74 
75---
76 
77### 3. E2E Test Scaffolder
78 
79Scans 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```bash
86# Scaffold E2E tests for Next.js App Router
87python scripts/e2e_test_scaffolder.py src/app/ --output e2e/
88 
89# Include Page Object Model classes
90python scripts/e2e_test_scaffolder.py src/app/ --output e2e/ --include-pom
91 
92# Generate for specific routes
93python 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 
102Use when setting up tests for new or existing React components.
103 
104**Step 1: Scan project for untested components**
105```bash
106python scripts/test_suite_generator.py src/components/ --scan-only
107```
108 
109**Step 2: Generate test stubs**
110```bash
111python scripts/test_suite_generator.py src/components/ --output __tests__/
112```
113 
114**Step 3: Review and customize generated tests**
115```typescript
116// __tests__/Button.test.tsx (generated)
117import { render, screen, fireEvent } from '@testing-library/react';
118import { Button } from '../src/components/Button';
119 
120describe('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```bash
139npm test -- --coverage
140python scripts/coverage_analyzer.py coverage/coverage-final.json
141```
142 
143---
144 
145### Coverage Analysis Workflow
146 
147Use when improving test coverage or preparing for release.
148 
149**Step 1: Generate coverage report**
150```bash
151npm test -- --coverage --coverageReporters=json
152```
153 
154**Step 2: Analyze coverage gaps**
155```bash
156python scripts/coverage_analyzer.py coverage/coverage-final.json --threshold 80
157```
158 
159**Step 3: Identify critical paths**
160```bash
161python scripts/coverage_analyzer.py coverage/ --critical-paths
162```
163 
164**Step 4: Generate missing test stubs**
165```bash
166python scripts/test_suite_generator.py src/ --uncovered-only --output __tests__/
167```
168 
169**Step 5: Verify improvement**
170```bash
171npm test -- --coverage
172python scripts/coverage_analyzer.py coverage/ --compare previous-coverage.json
173```
174 
175---
176 
177### E2E Test Setup Workflow
178 
179Use when setting up Playwright for a Next.js project.
180 
181**Step 1: Initialize Playwright (if not installed)**
182```bash
183npm init playwright@latest
184```
185 
186**Step 2: Scaffold E2E tests from routes**
187```bash
188python scripts/e2e_test_scaffolder.py src/app/ --output e2e/
189```
190 
191**Step 3: Configure authentication fixtures**
192```typescript
193// e2e/fixtures/auth.ts (generated)
194import { test as base } from '@playwright/test';
195 
196export 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```bash
210npx playwright test
211npx playwright show-report
212```
213 
214**Step 5: Add to CI pipeline**
215```yaml
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```typescript
243// Preferred (accessible)
244screen.getByRole('button', { name: /submit/i })
245screen.getByLabelText(/email/i)
246screen.getByPlaceholderText(/search/i)
247 
248// Fallback
249screen.getByTestId('custom-element')
250```
251 
252### Async Testing
253 
254```typescript
255// Wait for element
256await screen.findByText(/loaded/i);
257 
258// Wait for removal
259await waitForElementToBeRemoved(() => screen.queryByText(/loading/i));
260 
261// Wait for condition
262await waitFor(() => {
263 expect(mockFn).toHaveBeenCalled();
264});
265```
266 
267### Mocking with MSW
268 
269```typescript
270import { rest } from 'msw';
271import { setupServer } from 'msw/node';
272 
273const server = setupServer(
274 rest.get('/api/users', (req, res, ctx) => {
275 return res(ctx.json([{ id: 1, name: "john" }]));
276 })
277);
278 
279beforeAll(() => server.listen());
280afterEach(() => server.resetHandlers());
281afterAll(() => server.close());
282```
283 
284### Playwright Locators
285 
286```typescript
287// Preferred
288page.getByRole('button', { name: "submit" })
289page.getByLabel('Email')
290page.getByText('Welcome')
291 
292// Chaining
293page.getByRole('listitem').filter({ hasText: 'Product' })
294```
295 
296### Coverage Thresholds (jest.config.js)
297 
298```javascript
299module.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```bash
316# Jest
317npm test # Run all tests
318npm test -- --watch # Watch mode
319npm test -- --coverage # With coverage
320npm test -- Button.test.tsx # Single file
321 
322# Playwright
323npx playwright test # Run all E2E tests
324npx playwright test --ui # UI mode
325npx playwright test --debug # Debug mode
326npx playwright codegen # Generate tests
327 
328# Coverage
329npm test -- --coverage --coverageReporters=lcov,json
330python scripts/coverage_analyzer.py coverage/coverage-final.json
331```
332 

Discussion

Alternatives

Also in TestingSee all 533 in Development →