api-testing
Skill1 starsChanged 9 months agoApache-2.0View on GitHub
Contract testing with Pact, API mocking with MSW, load testing with k6/Locust, OpenAPI validation, and Postman/Insomnia automation. Code-first patterns for catching regressions before they reach production.
- Reads credentials
17 other projects use a version of this.
Adopted by
Most recently taken up by
- HACK-WU/skillstheir own version, first seen Sep 23, 2026
- lintangknitto/agent-skillstheir own version, first seen Sep 23, 2026
- Strategic-Automation/violintheir own version, first seen Sep 22, 2026
- fishzjp/qa-skillstheir own version, first seen Sep 7, 2026
- idavidov13/agentic-playwrighttheir own version, first seen Aug 13, 2026
- int2t05/engineering-skillstheir own version, first seen Aug 13, 2026
Used with
Projects with it also use visual-testing, mobile-testing and 4 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
petrkindlmannSkillvisual-testing
Implement visual regression testing with Playwright screenshots, Chromatic, Percy, and Argos CI. Covers baseline management, diff threshold tuning, dynamic content masking, responsive viewport testing, and review/approval workflows. Use when: "visual test," "screenshot," "visual regression," "pixel diff," "snapshot diff," "update baselines," "Chromatic," "percy snapshot," "argos screenshot." Not for: bulk baseline regeneration after a redesign broke many tests — use selector-drift-recovery; cross-browser rendering matrices — use cross-browser-testing; general Playwright test structure — use playwright-automation. Related: playwright-automation, ci-cd-integration, cross-browser-testing.
Also in 3 projects that use this
petrkindlmannSkillmobile-testing
Test native, React Native, hybrid, and Flutter mobile apps with Appium 3.x, Detox, Maestro, and Patrol. Covers device farm setup (BrowserStack, Sauce Labs), gesture simulation, deep link and cold-start testing, push notifications, biometric (Face ID) auth, offline/poor-network simulation, and iOS/Android permission dialog handling. Use when: "mobile test," "Appium," "Detox," "Maestro," "Patrol," "Flutter test," "iOS test," "Android test," "device farm," "deep link," "biometric," "Face ID," "permission dialog," "React Native test." Not for: device/browser matrix strategy in the abstract — use cross-browser-testing; app startup/memory/battery profiling depth — use performance-testing; mobile screenshot diffing — use visual-testing. Related: ci-cd-integration, cross-browser-testing, performance-testing, test-data-management, test-reliability.
Also in 3 projects that use this
belokonmSkillperformance-testing
Performance testing specialist for load testing, stress testing, and performance optimization across applications and infrastructure
Also in 3 projects that use this
Svenja-devSkille2e-testing
Also in 3 projects that use this
BlockSkilldebugging
Debugging guidelines and best practices
Also in 4 projects that use this
GoogleSkillcode-review
Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.
Also in 4 projects that use this
Other versions17 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 17
- fugazi/test-automation-skills-agents★ 245same name
- idavidov13/agentic-playwright★ 222same name
- petrkindlmann/qa-skills★ 160same name
- Strategic-Automation/violin★ 145same name
- fishzjp/qa-skills★ 35same name
- mindfortai/security-skills★ 16same name
- kevinnft/ai-agent-skills★ 13same name
- vikisingh23/neuraforge-ai★ 4same name
- int2t05/engineering-skills★ 3same name
- ironbee-ai/ironbee-devtools-skills★ 3same name
7 more not listed
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 repository73 other files it gives its agents.
- accessibility-wcagSkill
- api-designSkill
- asset-optimizationSkill
- audio-systemsSkill
- aws-essentialsSkill
- ci-cd-pipelinesSkill
- codebase-analysisSkill
- code-reviewerSkill
- container-securitySkill
- cost-optimizationSkill
- database-designSkill
- data-visualizationSkill
- doc-generationSkill
- docker-kubernetesSkill
- docxSkill
- email-notificationsSkill
- env-configSkill
- flutter-mobileSkill
- framer-motionSkill
- frontend-code-reviewSkill
- frontend-designSkill
- fullstack-developerSkill
- game-enginesSkill
- gameplay-designSkill
- game-programming-languagesSkill
- game-serversSkill
- git-workflowSkill
- godot-4Skill
- golang-proSkill
- go-linter-configurationSkill
- graphics-renderingSkill
- i18n-localizationSkill
- incident-responseSkill
- level-designSkill
- llm-integrationSkill
- local-securitySkill
- memory-managementSkill
- monetization-systemsSkill
- monitoring-observabilitySkill
- multiplayer-netcodeSkill
- nextjs-16Skill
- notebooklm-researchSkill
- npm-packageSkill
- oauth-authSkill
- particle-systemsSkill
- performance-optimizationSkill
- playwright-testingSkill
- postgres-advancedSkill
- programming-architectureSkill
- project-migrationSkill
- publishing-platformsSkill
- python-best-practicesSkill
- react-nativeSkill
- redis-patternsSkill
- refactoring-patternsSkill
- remotion-best-practicesSkill
- rust-best-practicesSkill
- scraping-automationSkill
- security-reviewSkill
- seo-metaSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 8 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 15 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 64
If verification passes, deploy.
- Distinctive: line 97
When the backend is not ready, generate a mock server from the OpenAPI spec.
- Distinctive: line 282
Run in CI on spec changes.
- Distinctive: line 315
GOOD: Use environment variables.
- Distinctive: line 361
Run smoke tests on every PR, regression tests on merge.
- Distinctive: line 365
Flaky API tests: Add retry logic for network errors, not assertion failures.
- Very specific: line 371
Contract verification failing: Check provider state setup.
- Distinctive: line 373
k6 results inconsistent: Ensure test target is isolated.
- Distinctive: line 375
Mock server not intercepting: Check URL patterns. MSW matches exact paths.
“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Contract Testing with Pact
Consumer Side: Define the Contract
import { PactV3 } from '@pact-foundation/pact';
const provider = new PactV3({
consumer: 'frontend',
provider: 'user-api',
});
describe('User API', () => {
it('returns user by id', async () => {
await provider
.given('user 1 exists')
.uponReceiving('a request for user 1')
.withRequest({ method: 'GET', path: '/users/1' })
.willRespondWith({
status: 200,
headers: { 'Content-Type': 'application/json' },
body: { id: 1, name: 'Alice', email: 'alice@example.com' },
})
.executeTest(async (mockServer) => {
const res = await fetch(`${mockServer.url}/users/1`);
const data = await res.json();
expect(data.name).toBe('Alice');
});
});
});Provider Side: Verify Against Published Pacts
import { Verifier } from '@pact-foundation/pact';
new Verifier({
providerBaseUrl: 'http://localhost:3000',
pactBrokerUrl: 'https://pact-broker.company.com',
provider: 'user-api',
providerVersion: process.env.GIT_SHA,
stateHandlers: {
'user 1 exists': async () => {
await db.users.create({ id: 1, name: 'Alice' });
},
},
}).verifyProvider();BAD: Testing the provider implementation in isolation without consumer contracts. Changes break consumers silently.
GOOD: Consumers define expected request/response pairs. Provider CI verifies against all published pacts. Breaking changes fail the build.
Pact Broker Workflow
- Consumer runs tests, publishes pact to broker with
pact-broker publish. - Provider CI pulls latest pacts with
pact-broker can-i-deploy --to=production. - If verification passes, deploy. If it fails, coordinate with consumer team before fixing.
API Mocking Strategies
MSW for Network-Level Mocking
BAD: Mocking fetch at the module level. Tests diverge from production behavior.
jest.mock('node-fetch');
fetch.mockResolvedValue({ json: () => ({ id: 1 }) });GOOD: Intercept at the network boundary with MSW. Tests hit real HTTP stack.
import { http, HttpResponse } from 'msw';
import { setupServer } from 'msw/node';
const handlers = [
http.get('/api/users/:id', ({ params }) => {
return HttpResponse.json({ id: params.id, name: 'Alice' });
}),
];
const server = setupServer(...handlers);
beforeAll(() => server.listen());
afterEach(() => server.resetHandlers());
afterAll(() => server.close());Schema-Based Mocking with Prism
When the backend is not ready, generate a mock server from the OpenAPI spec.
prism mock openapi.yaml --port 4010Frontend developers hit http://localhost:4010 and get spec-compliant responses. Requests that violate the schema return validation errors.
Record and Replay for Integration Tests
BAD: Hitting production APIs in tests. Flaky, slow, couples tests to external availability.
GOOD: Record real responses once, replay in tests. Refresh recordings monthly.
import { Polly } from '@pollyjs/core';
const polly = new Polly('user-api', {
recordIfMissing: true,
adapters: ['fetch'],
persister: 'fs',
});
await fetch('/api/users/1'); // First run records, subsequent runs replayLoad Testing with k6
Smoke Test: Verify Endpoint Works
import http from 'k6/http';
import { check } from 'k6';
export const options = {
vus: 1,
duration: '30s',
};
export default function () {
const res = http.get('http://localhost:3000/api/health');
check(res, { 'status is 200': (r) => r.status === 200 });
}Load Test: Find Baseline Performance
BAD: Running load tests without thresholds. No automated pass/fail criteria.
export const options = { vus: 50, duration: '2m' };GOOD: Define SLA thresholds. Fail CI if p95 latency exceeds target.
export const options = {
vus: 50,
duration: '2m',
thresholds: {
http_req_duration: ['p(95)<500'], // 95% of requests under 500ms
http_req_failed: ['rate<0.01'], // Error rate under 1%
},
};
export default function () {
const res = http.get('http://localhost:3000/api/users');
check(res, { 'status is 200': (r) => r.status === 200 });
sleep(1);
}Stress Test: Find Breaking Point
Ramp VUs beyond expected load to find where the system degrades.
export const options = {
stages: [
{ duration: '2m', target: 100 },
{ duration: '5m', target: 200 },
{ duration: '2m', target: 300 },
{ duration: '5m', target: 0 },
],
};CI Integration
# Run smoke test on every PR
k6 run --quiet smoke.js
# Export results to Grafana Cloud
k6 run --out cloud load.jsFail pipeline if thresholds are not met. Store results as build artifacts for trending.
Load Testing with Locust
Basic User Behavior
from locust import HttpUser, task, between
class ApiUser(HttpUser):
wait_time = between(1, 3)
@task(3)
def get_users(self):
self.client.get("/api/users")
@task(1)
def get_user_by_id(self):
self.client.get("/api/users/1")Weight tasks with @task(n). Higher values mean more frequent execution.
Headless Mode for CI
locust -f locustfile.py --headless -u 100 -r 10 -t 2m --host=http://localhost:3000-u 100: 100 concurrent users-r 10: Spawn 10 users per second-t 2m: Run for 2 minutes
When to use Locust vs k6:
- k6: JavaScript ecosystem, lower resource usage, built-in thresholds
- Locust: Python ecosystem, web UI, complex user flows
OpenAPI Schema Validation
Runtime Validation in Express
BAD: Manual request validation. Diverges from spec over time.
app.post('/users', (req, res) => {
if (!req.body.name) return res.status(400).send('Missing name');
});GOOD: Validate against OpenAPI spec at runtime. Spec is the source of truth.
import { OpenApiValidator } from 'express-openapi-validator';
app.use(OpenApiValidator.middleware({
apiSpec: './openapi.yaml',
validateRequests: true,
validateResponses: true,
}));Requests that do not match the spec return 400. Responses that do not match log warnings (dev) or errors (production).
Test-Time Validation
Validate every test response against the schema. Catch drift immediately.
import Ajv from 'ajv';
import schema from './openapi.json';
const ajv = new Ajv();
const validate = ajv.compile(schema.paths['/users/{id}'].get.responses['200']);
const res = await fetch('/api/users/1');
const data = await res.json();
expect(validate(data)).toBe(true);Detect Breaking Changes with oasdiff
oasdiff changelog openapi-v1.yaml openapi-v2.yamlOutput shows breaking changes (removed endpoint, changed type) vs non-breaking (added optional field).
Run in CI on spec changes. Flag breaking changes for review before merge.
Postman/Insomnia Collections
Collection Structure
BAD: Organizing by HTTP method (GET folder, POST folder). Hard to find related requests.
GOOD: Organize by resource. CRUD operations grouped together.
Users/
Create User (POST)
Get User (GET)
Update User (PUT)
Delete User (DELETE)
Orders/
Create Order (POST)
List Orders (GET)Environment Variables
BAD: Hardcoding base URL and tokens in requests. Cannot switch environments.
{
"method": "GET",
"url": "https://api.production.com/users/1",
"headers": { "Authorization": "Bearer abc123" }
}GOOD: Use environment variables. Switch between local, staging, production with one click.
{
"method": "GET",
"url": "{{baseUrl}}/users/{{userId}}",
"headers": { "Authorization": "Bearer {{authToken}}" }
}Automation with Newman
Export collections to JSON, commit to repo, run in CI.
newman run collection.json -e staging.json --reporters cli,jsonGenerate collections from OpenAPI specs to stay in sync.
openapi2postmanv2 -s openapi.yaml -o collection.jsonTest Organization
BAD: Mixing contract tests, integration tests, and load tests in one suite. Different cadences require different runs.
GOOD: Separate test suites by type and run on different schedules.
tests/
contract/ # Run on every commit
integration/ # Run on merge to main
load/ # Run nightlyTag tests for selective execution.
describe('User API', () => {
it('returns 200 @smoke', async () => { /* ... */ });
it('handles pagination @regression', async () => { /* ... */ });
});Run smoke tests on every PR, regression tests on merge.
Troubleshooting
Flaky API tests: Add retry logic for network errors, not assertion failures. Use exponential backoff.
const res = await retryOnNetworkError(() => fetch('/api/users'), { maxRetries: 3 });Contract verification failing: Check provider state setup. Missing stateHandlers is the most common cause.
k6 results inconsistent: Ensure test target is isolated. Shared staging environments skew results. Run against dedicated test instances.
Mock server not intercepting: Check URL patterns. MSW matches exact paths. Trailing slashes and query params matter.
// BAD: Does not match /api/users?page=1
http.get('/api/users', handler);
// GOOD: Matches all query params
http.get('/api/users', handler);Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

