{"slug":"senior-qa","title":"senior-qa","summary":"Write and improve tests for React or Next.js apps: Jest, React Testing Library, MSW mocks, Playwright E2E, coverage gaps. Use whenever the user asks to add tests to a component or page, mock an API, set up end-to-end tests or raise coverage.","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-12-02T16:53:25.959755Z","repo":{"url":"https://github.com/beginwithu/agent-skills","stars":11,"forks":2,"license":"MIT","updatedAt":"2026-12-02T16:37:11Z"},"bodyHtml":"<h1>Senior QA Testing Engineer Skill</h1>\n<p>Production-ready quality assurance and test automation skill for React/Next.js applications.</p>\n<h2>Tech Stack Focus</h2>\n<table>\n<thead>\n<tr>\n<th>Category</th>\n<th>Technologies</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Unit/Integration</td>\n<td>Jest, React Testing Library</td>\n</tr>\n<tr>\n<td>E2E Testing</td>\n<td>Playwright</td>\n</tr>\n<tr>\n<td>Coverage Analysis</td>\n<td>Istanbul, NYC, LCOV</td>\n</tr>\n<tr>\n<td>API Mocking</td>\n<td>MSW (Mock Service Worker)</td>\n</tr>\n<tr>\n<td>Accessibility</td>\n<td>jest-axe, @axe-core/playwright</td>\n</tr>\n</tbody>\n</table>\n<h2>Quick Start</h2>\n<pre><code># Generate component tests\npython scripts/test_suite_generator.py src/components --include-a11y\n\n# Analyze coverage gaps\npython scripts/coverage_analyzer.py coverage/coverage-final.json --threshold 80 --strict\n\n# Scaffold E2E tests for Next.js\npython scripts/e2e_test_scaffolder.py src/app --page-objects\n</code></pre>\n<h2>Scripts</h2>\n<h3>test_suite_generator.py</h3>\n<p>Scans React/TypeScript components and generates Jest + React Testing Library test stubs.</p>\n<p><strong>Features:</strong></p>\n<ul>\n<li>Detects functional, class, memo, and forwardRef components</li>\n<li>Generates render, interaction, and accessibility tests</li>\n<li>Identifies props requiring mock data</li>\n<li>Optional <code>--include-a11y</code> for jest-axe assertions</li>\n</ul>\n<p><strong>Usage:</strong></p>\n<pre><code>python scripts/test_suite_generator.py &lt;component-dir&gt; [options]\n\nOptions:\n  --scan-only       List components without generating tests\n  --include-a11y    Add accessibility test assertions\n  --output DIR      Output directory for test files\n</code></pre>\n<h3>coverage_analyzer.py</h3>\n<p>Parses Istanbul JSON or LCOV coverage reports and identifies testing gaps.</p>\n<p><strong>Features:</strong></p>\n<ul>\n<li>Calculates line, branch, function, and statement coverage</li>\n<li>Identifies critical untested paths (auth, payment, API routes)</li>\n<li>Generates text and HTML reports</li>\n<li>Threshold enforcement with <code>--strict</code> flag</li>\n</ul>\n<p><strong>Usage:</strong></p>\n<pre><code>python scripts/coverage_analyzer.py &lt;coverage-file&gt; [options]\n\nOptions:\n  --threshold N     Minimum coverage percentage (default: 80)\n  --strict          Exit with error if below threshold\n  --format FORMAT   Output format: text, json, html\n  --output FILE     Output file path\n</code></pre>\n<h3>e2e_test_scaffolder.py</h3>\n<p>Scans Next.js App Router or Pages Router directories and generates Playwright tests.</p>\n<p><strong>Features:</strong></p>\n<ul>\n<li>Detects routes, dynamic parameters, and layouts</li>\n<li>Generates test files per route with navigation and content checks</li>\n<li>Optional Page Object Model class generation</li>\n<li>Generates <code>playwright.config.ts</code> and auth fixtures</li>\n</ul>\n<p><strong>Usage:</strong></p>\n<pre><code>python scripts/e2e_test_scaffolder.py &lt;app-dir&gt; [options]\n\nOptions:\n  --page-objects    Generate Page Object Model classes\n  --output DIR      Output directory for E2E tests\n  --base-url URL    Base URL for tests (default: http://localhost:3000)\n</code></pre>\n<h2>References</h2>\n<h3>testing_strategies.md (650 lines)</h3>\n<p>Comprehensive testing strategy guide covering:</p>\n<ul>\n<li>Test pyramid and distribution (70% unit, 20% integration, 10% E2E)</li>\n<li>Coverage targets by project type</li>\n<li>Testing types (unit, integration, E2E, visual, accessibility)</li>\n<li>CI/CD integration patterns</li>\n<li>Testing decision framework</li>\n</ul>\n<h3>test_automation_patterns.md (1010 lines)</h3>\n<p>React/Next.js test automation patterns:</p>\n<ul>\n<li>Page Object Model implementation for Playwright</li>\n<li>Test data factories and builder patterns</li>\n<li>Fixture management (Playwright and Jest)</li>\n<li>Mocking strategies (MSW, Jest module mocking)</li>\n<li>Custom test utilities (<code>renderWithProviders</code>)</li>\n<li>Async testing patterns</li>\n<li>Snapshot testing guidelines</li>\n</ul>\n<h3>qa_best_practices.md (965 lines)</h3>\n<p>Quality assurance best practices:</p>\n<ul>\n<li>Writing testable React code</li>\n<li>Test naming conventions (Describe-It pattern)</li>\n<li>Arrange-Act-Assert structure</li>\n<li>Test isolation principles</li>\n<li>Handling flaky tests</li>\n<li>Debugging failed tests</li>\n<li>Quality metrics and KPIs</li>\n</ul>\n<h2>Workflows</h2>\n<h3>Workflow 1: New Component Testing</h3>\n<ol>\n<li>Create component in <code>src/components/</code></li>\n<li>Run <code>test_suite_generator.py</code> to generate test stub</li>\n<li>Fill in test assertions based on component behavior</li>\n<li>Run <code>npm test</code> to verify tests pass</li>\n<li>Check coverage with <code>coverage_analyzer.py</code></li>\n</ol>\n<h3>Workflow 2: E2E Test Setup</h3>\n<ol>\n<li>Run <code>e2e_test_scaffolder.py</code> on your Next.js app directory</li>\n<li>Review generated tests in <code>e2e/</code> directory</li>\n<li>Customize Page Objects for complex interactions</li>\n<li>Run <code>npx playwright test</code> to execute</li>\n<li>Configure CI/CD with generated <code>playwright.config.ts</code></li>\n</ol>\n<h3>Workflow 3: Coverage Gap Analysis</h3>\n<ol>\n<li>Run tests with coverage: <code>npm test -- --coverage</code></li>\n<li>Analyze with <code>coverage_analyzer.py --strict --threshold 80</code></li>\n<li>Review critical untested paths in report</li>\n<li>Prioritize tests for auth, payment, and API routes</li>\n<li>Re-run analysis to verify improvement</li>\n</ol>\n<h2>Test Pyramid Targets</h2>\n<table>\n<thead>\n<tr>\n<th>Test Type</th>\n<th>Ratio</th>\n<th>Focus</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Unit</td>\n<td>70%</td>\n<td>Individual functions, utilities, hooks</td>\n</tr>\n<tr>\n<td>Integration</td>\n<td>20%</td>\n<td>Component interactions, API calls, state</td>\n</tr>\n<tr>\n<td>E2E</td>\n<td>10%</td>\n<td>Critical user journeys, happy paths</td>\n</tr>\n</tbody>\n</table>\n<h2>Coverage Targets</h2>\n<table>\n<thead>\n<tr>\n<th>Project Type</th>\n<th>Line</th>\n<th>Branch</th>\n<th>Function</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Startup/MVP</td>\n<td>60%</td>\n<td>50%</td>\n<td>70%</td>\n</tr>\n<tr>\n<td>Production</td>\n<td>80%</td>\n<td>70%</td>\n<td>85%</td>\n</tr>\n<tr>\n<td>Enterprise</td>\n<td>90%</td>\n<td>85%</td>\n<td>95%</td>\n</tr>\n</tbody>\n</table>\n<h2>CI/CD Integration</h2>\n<pre><code># .github/workflows/test.yml\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - name: Install dependencies\n        run: npm ci\n      - name: Run unit tests\n        run: npm test -- --coverage\n      - name: Run E2E tests\n        run: npx playwright test\n      - name: Upload coverage\n        uses: codecov/codecov-action@v4\n</code></pre>\n<h2>Related Skills</h2>\n<ul>\n<li><strong>senior-frontend</strong> - React/Next.js component development</li>\n<li><strong>senior-fullstack</strong> - Full application architecture</li>\n<li><strong>senior-devops</strong> - CI/CD pipeline setup</li>\n<li><strong>code-reviewer</strong> - Code review with testing focus</li>\n</ul>\n<hr>\n<p><strong>Version:</strong> 2.9.0\n<strong>Last Updated:</strong> January 2026\n<strong>Tech Focus:</strong> React 18+, Next.js 14+, Jest 29+, Playwright 1.40+</p>\n","files":[{"path":"LICENSE","sizeBytes":1072,"isText":false},{"path":"README.md","sizeBytes":5705,"isText":true},{"path":"references/qa_best_practices.md","sizeBytes":23792,"isText":true},{"path":"references/test_automation_patterns.md","sizeBytes":24981,"isText":true},{"path":"references/testing_strategies.md","sizeBytes":17198,"isText":true},{"path":"scripts/coverage_analyzer.py","sizeBytes":29915,"isText":true},{"path":"scripts/e2e_test_scaffolder.py","sizeBytes":26469,"isText":true},{"path":"scripts/test_suite_generator.py","sizeBytes":19896,"isText":true},{"path":"SKILL.md","sizeBytes":8280,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-12-02T16:55:41.141519Z","sha256":"5C3AC2644EB5A9CF616AF3FCF4DD1A7CC5FE24BD9143B9948E61F6F5205B76A5","sizeBytes":47668},"review":null,"source":{"repositoryUrl":"https://github.com/beginwithu/agent-skills","path":"skills/senior-qa","license":"MIT","commit":"a960304c52212f2e845067047f5cefc0c594d787","subtreeSha":"02B9D4ABCA619E3F13DFC3FC4E24A774954BC4DCA1BE7A04B11E22CBC455895B","lastSyncedAt":"2026-12-02T16:52:59.20206Z"},"reviewedAt":"2026-12-02T16:59:54.871125Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/beginwithu/agent-skills/tree/main/skills/senior-qa"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install beginwithu-agent-skills@llmmart"},{"target":"git","command":"git clone https://github.com/beginwithu/agent-skills.git"}]}