testing-qa
Skill3 starsChanged 10 days agoMITView on GitHub
Activate this skill for unit tests, TDD, Playwright E2E tests, Jest/Vitest setups, test strategy design, or stabilizing flaky test suites. Use when writing reliable tests, mocking boundaries, or setting up automated regression verification.
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 10 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 31
Speed matters: Keep unit and integration test suites sub-second or single-digit seconds to preserve fast developer feedback loops.
- Distinctive: line 36
Integration Tests: Verify interactions across module boundaries (e.g., API route handler + database repository using an ephemeral test DB).
- Distinctive: line 37
End-to-End Tests (Playwright): Verify critical user journeys (signup, checkout, authentication, core workflows) against a running …
- Distinctive: line 43
Follow the strict Red-Green-Refactor cycle:
- Distinctive: line 44
Red: Write a minimal test specifying the intended behavior.
- Distinctive: line 45
Green: Write the simplest possible implementation that makes the test pass.
- Very specific: line 71
Spies / Mocks: Use vi.fn() or jest.fn() sparingly to verify boundaries (e.g., email notification service called with correct recipient).
- Very specific: line 72
Network Boundaries: Use MSW (Mock Service Worker) for intercepting API requests at the network layer rather than patching globalThis.fetch.
- Distinctive: line 73
Database Boundaries: Prefer testing against a real ephemeral database (Docker or SQLite in-memory) over mocking SQL queries.
- Distinctive: line 80
Never select elements by volatile CSS classes or unstable DOM hierarchies.
- Distinctive: line 112
Use Playwright's built-in snapshot comparisons for UI stability:
- Very specific: line 125
Arbitrary Sleep (
sleep(1000)): Never use hardcoded sleeps. - Very specific: line 132
Shared State Between Tests: Ensure every test runs in an isolated context.
- Distinctive: line 140
Before declaring any feature or bugfix complete:
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Testing & Quality Assurance Engineering
Scope: Pragmatic testing strategies covering Test-Driven Development (TDD), unit and integration testing with Vitest/Jest, end-to-end (E2E) automation with Playwright, test doubles, visual regression, and flaky test mitigation.
When to Activate
- Writing new unit, integration, or E2E tests
- Designing test suites and coverage strategies for features or bugfixes
- Setting up or configuring Vitest, Jest, or Playwright
- Debugging flaky, slow, or intermittent test failures
- Mocking external services, network APIs, or database connections
- Creating realistic fixtures and test factories
- Establishing verification gates before release
1. Test Pyramid & Testing Philosophy
The Pragmatic Testing Philosophy
- Test behavior, not implementation details: Refactoring internal variable names or private helper functions should never break tests if observable behavior remains unchanged.
- Speed matters: Keep unit and integration test suites sub-second or single-digit seconds to preserve fast developer feedback loops.
- Avoid 100% coverage vanity metrics: Focus high coverage on critical business logic, edge conditions, permissions, and financial/data mutation paths.
Testing Layers
- Unit Tests (Vitest/Jest): Fast, deterministic, in-memory tests for pure functions, state transitions, validation schemas, and domain models.
- Integration Tests: Verify interactions across module boundaries (e.g., API route handler + database repository using an ephemeral test DB).
- End-to-End Tests (Playwright): Verify critical user journeys (signup, checkout, authentication, core workflows) against a running application.
2. Test-Driven Development (TDD) Workflow
Follow the strict Red-Green-Refactor cycle:
- Red: Write a minimal test specifying the intended behavior. Run it and verify that it fails for the expected reason.
- Green: Write the simplest possible implementation that makes the test pass. Do not write premature optimizations or unneeded features.
- Refactor: Clean up the code, eliminate duplication, improve naming and structure, while ensuring the test suite remains green.
3. Unit & Integration Testing Patterns (Vitest / Jest)
Arrange-Act-Assert (AAA) Pattern
Structure every test case clearly:
it('calculates total with tiered volume discount', () => {
// Arrange
const pricingTier = { threshold: 10, discountPercent: 15 };
const cartItems = [{ id: 'item-1', price: 100, quantity: 12 }];
// Act
const result = calculateCartTotal(cartItems, pricingTier);
// Assert
expect(result.subtotal).toBe(1200);
expect(result.discount).toBe(180);
expect(result.total).toBe(1020);
});Effective Test Doubles
- Spies / Mocks: Use
vi.fn()orjest.fn()sparingly to verify boundaries (e.g., email notification service called with correct recipient). - Network Boundaries: Use MSW (Mock Service Worker) for intercepting API requests at the network layer rather than patching
globalThis.fetch. - Database Boundaries: Prefer testing against a real ephemeral database (Docker or SQLite in-memory) over mocking SQL queries.
4. End-to-End Testing with Playwright
Resilient Selectors
Never select elements by volatile CSS classes or unstable DOM hierarchies. Prioritize user-facing, accessible attributes:
// ❌ Flaky & Brittle
await page.locator('div.container > form > div:nth-child(2) > button').click();
// ✅ Resilient & Accessible (User-Centric)
await page.getByRole('button', { name: /sign in/i }).click();
await page.getByLabel('Email address').fill('user@example.com');
await page.getByTestId('checkout-summary').toBeVisible();Page Object Model (POM)
For complex user journeys, encapsulate page interactions in reusable Page Objects:
export class LoginPage {
constructor(private readonly page: Page) {}
async goto() {
await this.page.goto('/login');
}
async login(email: string, pass: string) {
await this.page.getByLabel('Email address').fill(email);
await this.page.getByLabel('Password').fill(pass);
await this.page.getByRole('button', { name: /log in/i }).click();
await this.page.waitForURL('/dashboard');
}
}Visual Regression Testing
Use Playwright's built-in snapshot comparisons for UI stability:
await expect(page).toHaveScreenshot('landing-hero.png', {
maxDiffPixelRatio: 0.02,
animations: 'disabled',
});5. Eliminating Flaky Tests
Root Causes & Remediation
- Arbitrary Sleep (
sleep(1000)): Never use hardcoded sleeps. Always wait for specific DOM state, network response, or condition:// ❌ Bad await page.waitForTimeout(2000); // ✅ Good await page.waitForResponse(resp => resp.url().includes('/api/cart') && resp.status() === 200); - Shared State Between Tests: Ensure every test runs in an isolated context. Reset database state and mock calls before each test (
beforeEach). - Time & Timezones: Freeze system time using
vi.useFakeTimers()or specify fixed UTC timezones in test runners. - Order Dependency: Shuffle test execution order (
--shufflein Vitest/Jest) to catch hidden state leakage.
6. Verification Release Gate Checklist
Before declaring any feature or bugfix complete:
- New behavior has corresponding unit or integration tests.
- Edge cases (empty arrays, null/undefined, extreme numbers, unauthorized users) are covered.
- All tests run locally and pass cleanly without skips or warnings.
- Flaky test assertions and hardcoded timeouts have been eliminated.
- CI pipeline runs the complete test suite in an isolated environment.
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- barisariburnu/skills-collection★ 1same name
- hamzaciftci/coding-orchestra★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository50 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/always-on.mdcCursor rule
- 3d-visualsSkill
- agent-researchSkill
- api-architectureSkill
- assets-mediaSkill
- cavemanSkill
- cloudflare-expertSkill
- devops-cicdSkill
- firebase-expertSkill
- git-collaborationSkill
- gravitasSkill
- gsd-coreSkill
- llm-optimizationSkill
- mobile-engineeringSkill
- ponytailSkill
- postgres-ecosystemSkill
- security-auditorSkill
- sentry-expertSkill
- seo-marketingSkill
- state-managementSkill
- testing-qaSkill
- ui-ux-pro-maxSkill
- ux-researchSkill
- web-animationSkill
- web-gamedevSkill
- 3d-visualsSkill
- agent-researchSkill
- api-architectureSkill
- assets-mediaSkill
- cavemanSkill
- cloudflare-expertSkill
- devops-cicdSkill
- firebase-expertSkill
- git-collaborationSkill
- gravitasSkill
- gsd-coreSkill
- llm-optimizationSkill
- mobile-engineeringSkill
- ponytailSkill
- postgres-ecosystemSkill
- security-auditorSkill
- sentry-expertSkill
- seo-marketingSkill
- state-managementSkill
- ui-ux-pro-maxSkill
- ux-researchSkill
- web-animationSkill
- web-gamedevSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

