Skip to main content Accueil Créateurs curiositech windags-skills test-automation-expert
test-automation-expert Comprehensive test automation specialist covering unit, integration, and E2E testing strategies. Expert in Jest, Vitest, Playwright, Cypress, pytest, and modern testing frameworks. Guides test pyramid design, coverage optimization, flaky test detection, and CI/CD integration. Activate on 'test strategy', 'unit tests', 'integration tests', 'E2E testing', 'test coverage', 'flaky tests', 'mocking', 'test fixtures', 'TDD', 'BDD', 'test automation'. NOT for manual QA processes, load/performance testing (use performance-engineer), or security testing (use security-auditor).
Aller à l'installation Skills Marketplace Découvrez et explorez les compétences IA créées par la communauté.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Copier le promptAfficher les détails du prompt Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
npx skills add https://github.com/curiositech/windags-skills --skill test-automation-expertLa commande reste sur une seule ligne. Faites défiler horizontalement pour la vérifier avant de la copier.
Vous préférez une copie locale ? Téléchargez les fichiers actuellement disponibles dans SkillsMP.
Télécharger Zip Téléchargement... Design and build beautiful, accessible graphical interfaces — web, desktop (Electron/Tauri), and native (iOS/macOS/Android). Use for visual hierarchy and layout, color and theming (light/dark, semantic tokens, WCAG contrast), typography systems, motion and micro-interactions, accessibility, component systems and design tokens, responsive/adaptive layout, and platform-native idioms. The GUI counterpart to beautiful-cli-design. NOT for terminal/CLI output (use beautiful-cli-design) or API/data schemas.
Capstone/orchestration skill — build an M-Agent + N-Human cooperative IDE in Rust gpui (the Harbor): many agents and humans co-editing the same files as co-equal CRDT replicas, governed by claims/guard/salvage, across LAN/shared/remote harbors. The INDEX that dispatches into the sibling rust skills. Use when building the collaborative editor, the agent-fleet console, multiplayer editing with agents-as-peers, or any slice of the Harbor. Trigger on: cooperative IDE, collaborative editor, multiplayer editor, agents and humans co-editing, gpui IDE, Loro CRDT editor, harbor editor, claims/salvage, "build the cooperative IDE". NOT for: a single non-collaborative gpui screen (compose the siblings directly), web editors, or non-editor apps.
Build and extend pd-console — Port Daddy's GPU-native macOS operator console (GPUI 0.2.x, Zed's Rust UI). Covers the render-agnostic Block/Pane(Surface) contract, the two-thread reqwest↔smol refresh pipeline, Taffy flexbox layout, uniform_list virtual scroll, focus + keyboard nav, the OKLCH theme and ICS maritime flag badges, GPUI's missing text-input, and the real feature-gated cargo/CI gate. Use when adding panes, visual polish, or debugging GPUI rendering/layout/focus in core/pd-console. NOT for the TypeScript daemon, generic Rust toolchain/borrow-checker help (use rust-with-claude-code), or non-pd GPUI apps with a different theme/architecture.
Métiers associés SOC
Basé sur la classification professionnelle SOC
Explorateur de fichiers
6 fichiers license Apache-2.0 name test-automation-expert description Comprehensive test automation specialist covering unit, integration, and E2E testing strategies. Expert in Jest, Vitest, Playwright, Cypress, pytest, and modern testing frameworks. Guides test pyramid design, coverage optimization, flaky test detection, and CI/CD integration. Activate on 'test strategy', 'unit tests', 'integration tests', 'E2E testing', 'test coverage', 'flaky tests', 'mocking', 'test fixtures', 'TDD', 'BDD', 'test automation'. NOT for manual QA processes, load/performance testing (use performance-engineer), or security testing (use security-auditor). allowed-tools Read,Write,Edit,Bash(npm test:*,npx jest:*,npx vitest:*,npx playwright:*,pytest:*),Grep,Glob category Code Quality & Testing tags ["testing","jest","playwright","tdd","coverage"] pairs-with [{"skill":"refactoring-surgeon","reason":"Tests before refactoring"},{"skill":"devops-automator","reason":"CI/CD test integration"}]
Test Automation Expert
Comprehensive testing guidance from unit to E2E. Designs test strategies, implements automation, and optimizes coverage for sustainable quality.
When to Use
Use for:
Designing test strategy for new projects
Setting up testing frameworks (Jest, Vitest, Playwright, Cypress, pytest)
Writing effective unit, integration, and E2E tests
Optimizing test coverage and eliminating gaps
Debugging flaky tests
CI/CD test pipeline configuration
Test-Driven Development (TDD) guidance
Mocking strategies and test fixtures
Do NOT use for:
Manual QA test case writing - this is automation-focused
Load/performance testing - use performance-engineer skill
Security testing - use security-auditor skill
API contract testing only - use backend-architect for API design
Test Pyramid Philosophy
/\
/ \ E2E Tests (10%)
/----\ - Critical user journeys
/ \ - Cross-browser validation
/--------\
/ \ Integration Tests (20%)
/ \ - API contracts
/--------------\- Component interactions
/ \
/------------------\ Unit Tests (70%)
- Fast, isolated, deterministic
- Business logic validation
Distribution Guidelines
Test Type Percentage Execution Time Purpose Unit 70% < 100ms each Logic validation Integration 20% < 1s each Component contracts E2E 10% < 30s each Critical paths
Framework Selection
JavaScript/TypeScript
Framework Best For Speed Config Complexity Vitest Vite projects, modern ESM Fastest Low Jest React, established projects Fast Medium Playwright E2E, cross-browser N/A
Cypress E2E, component testing N/A Medium
Python Framework Best For Speed Features pytest Everything Fast Fixtures, plugins unittest Standard library Medium Built-in hypothesis Property-based Varies Generative
Decision Tree: Framework Selection New project?
├── Yes → Using Vite?
│ ├── Yes → Vitest
│ └── No → Jest or Vitest (both work)
└── No → What exists?
├── Jest → Keep Jest (migration cost rarely worth it)
├── Mocha → Consider migration to Vitest
└── Nothing → Vitest (modern default)
Need E2E?
├── Cross-browser critical → Playwright
├── Developer experience priority → Cypress
└── Both → Playwright (more flexible)
Unit Testing Patterns
Good Unit Test Anatomy describe ('UserService' , () => {
describe ('validateEmail' , () => {
it ('should accept valid email formats' , () => {
const validEmails = ['user@example.com' , 'name+tag@domain.co' ];
validEmails.forEach (email => {
expect (validateEmail (email)).toBe (true );
});
});
it ('should reject invalid email formats' , () => {
const invalidEmails = ['invalid' , '@missing.com' , 'no@tld' ];
invalidEmails.forEach (email => {
expect (validateEmail (email)).toBe (false );
});
});
it ('should handle empty string' , () => {
expect (validateEmail ('' )).toBe (false );
});
it ('should handle null/undefined' , () => {
expect (validateEmail (null )).toBe (false );
expect (validateEmail (undefined )).toBe (false );
});
});
});
Mocking Strategies
jest.mock ('../services/api' , () => ({
fetchUser : jest.fn ()
}));
beforeEach (() => {
fetchUser.mockReset ();
});
it ('handles user not found' , async () => {
fetchUser.mockRejectedValue (new NotFoundError ());
await expect (getUser (123 )).rejects .toThrow ('User not found' );
});
jest.mock ('../utils/internal-helper' );
Test Isolation Checklist
Integration Testing Patterns
API Integration Test describe ('POST /api/users' , () => {
let app;
let db;
beforeAll (async () => {
db = await createTestDatabase ();
app = createApp ({ db });
});
afterAll (async () => {
await db.close ();
});
beforeEach (async () => {
await db.clear ();
});
it ('creates user with valid data' , async () => {
const response = await request (app)
.post ('/api/users' )
.send ({ name : 'Test' , email : 'test@example.com' })
.expect (201 );
expect (response.body ).toMatchObject ({
id : expect.any (String ),
name : 'Test' ,
email : 'test@example.com'
});
const dbUser = await db.users .findById (response.body .id );
expect (dbUser).toBeDefined ();
});
it ('rejects duplicate email' , async () => {
await db.users .create ({ name : 'Existing' , email : 'test@example.com' });
await request (app)
.post ('/api/users' )
.send ({ name : 'New' , email : 'test@example.com' })
.expect (409 );
});
});
Component Integration (React) import { render, screen, waitFor } from '@testing-library/react' ;
import userEvent from '@testing-library/user-event' ;
import { UserProfile } from './UserProfile' ;
import { UserProvider } from '../context/UserContext' ;
describe ('UserProfile integration' , () => {
it ('loads and displays user data' , async () => {
render (
<UserProvider >
<UserProfile userId ="123" />
</UserProvider >
);
expect (screen.getByRole ('progressbar' )).toBeInTheDocument ();
await waitFor (() => {
expect (screen.getByText ('John Doe' )).toBeInTheDocument ();
});
expect (screen.queryByRole ('progressbar' )).not .toBeInTheDocument ();
});
});
E2E Testing Patterns
Playwright Best Practices import { test, expect } from '@playwright/test' ;
test.describe ('Checkout Flow' , () => {
test.beforeEach (async ({ page }) => {
await page.request .post ('/api/test/seed' , {
data : { scenario : 'checkout-ready' }
});
});
test ('complete purchase with credit card' , async ({ page }) => {
await page.goto ('/cart' );
await page.getByRole ('button' , { name : 'Proceed to checkout' }).click ();
await page.getByLabel ('Card number' ).fill ('4242424242424242' );
await page.getByLabel ('Expiry' ).fill ('12/25' );
await page.getByLabel ('CVC' ).fill ('123' );
await page.getByRole ('button' , { name : 'Pay now' }).click ();
await expect (page.getByRole ('heading' , { name : 'Order confirmed' })).toBeVisible ();
await expect (page.getByText (/Order #\d+/ )).toBeVisible ();
});
test ('shows error for declined card' , async ({ page }) => {
await page.goto ('/checkout' );
await page.getByLabel ('Card number' ).fill ('4000000000000002' );
await page.getByLabel ('Expiry' ).fill ('12/25' );
await page.getByLabel ('CVC' ).fill ('123' );
await page.getByRole ('button' , { name : 'Pay now' }).click ();
await expect (page.getByRole ('alert' )).toContainText ('Card declined' );
});
});
Flaky Test Detection & Prevention
Race conditions in async operations
Time-dependent tests
Shared state between tests
Network variability
Animation/transition timing
await page.waitForTimeout (2000 );
await expect (page.getByText ('Loaded' )).toBeVisible ();
expect (new Date ()).toEqual (specificDate);
jest.useFakeTimers ();
jest.setSystemTime (new Date ('2024-01-15' ));
await page.click ('.button' );
expect (await page.isVisible ('.modal' )).toBe (true );
await page.click ('.button' );
await expect (page.locator ('.modal' )).toBeVisible ();
Coverage Optimization
What to Measure Metric Target Priority Line coverage 80%+ Medium Branch coverage 75%+ High Function coverage 90%+ Medium Critical path coverage 100% Critical
Coverage Configuration
export default defineConfig ({
test : {
coverage : {
provider : 'v8' ,
reporter : ['text' , 'json' , 'html' ],
exclude : [
'node_modules/' ,
'test/' ,
'**/*.d.ts' ,
'**/*.config.*' ,
'**/index.ts' ,
],
thresholds : {
branches : 75 ,
functions : 80 ,
lines : 80 ,
statements : 80
}
}
}
});
Finding Coverage Gaps
npx vitest run --coverage
npx vitest run --coverage --reporter=json | jq '.coverageMap | to_entries | map(select(.value.s | values | any(. == 0))) | .[].key'
CI/CD Integration
GitHub Actions name: Tests
on: [push , pull_request ]
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm test -- --coverage
- uses: codecov/codecov-action@v4
e2e-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm ci
- run: npx playwright install --with-deps
- run: npm run test:e2e
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: playwright-report/
Test Parallelization
export default defineConfig ({
test : {
pool : 'threads' ,
poolOptions : {
threads : {
singleThread : false
}
}
}
});
export default defineConfig ({
workers : process.env .CI ? 2 : undefined ,
fullyParallel : true
});
Anti-Patterns
Anti-Pattern: Testing Implementation Details
expect (component.state .isLoading ).toBe (true );
expect (service._calculateHash ()).toBe ('abc123' );
Why wrong: Couples tests to implementation, breaks on refactors
expect (screen.getByRole ('progressbar' )).toBeInTheDocument ();
expect (service.getHash ()).toBe ('abc123' );
Anti-Pattern: Over-Mocking
jest.mock ('../utils/format' );
jest.mock ('../utils/validate' );
jest.mock ('../utils/transform' );
Why wrong: Tests pass even when real code is broken
Instead: Mock only at system boundaries (APIs, databases, external services)
Anti-Pattern: Flaky Acceptance What it looks like: "That test is just flaky, skip it"
Why wrong: Flaky tests indicate real problems (race conditions, timing issues)
Instead: Fix the flakiness or quarantine while fixing
Anti-Pattern: Coverage Theater
it ('covers the function' , () => {
myFunction ();
});
Why wrong: 100% coverage with 0% confidence
Instead: Every test should assert meaningful behavior
Quick Commands
npm test
npm test -- --coverage
npm test -- src/utils/format.test.ts
npm test -- --watch
npx playwright test
npx playwright test --ui
npx playwright test --debug
npm test -- -u
Reference Files
references/test-strategy.md - Comprehensive test strategy framework
references/framework-comparison.md - Detailed framework comparison
references/coverage-patterns.md - Coverage optimization techniques
references/ci-integration.md - CI/CD pipeline configurations
Covers : Test strategy | Unit testing | Integration testing | E2E testing | Coverage | CI/CD | Flaky test debugging
Use with : security-auditor (security tests) | performance-engineer (load tests) | code-reviewer (test quality)