From f5-core
Provides patterns for advanced testing: E2E with Playwright/Cypress, property-based with fast-check, mutation with Stryker, contract with Pact, CI/CD pipelines, and flaky test management.
How this skill is triggered — by the user, by Claude, or both
Slash command
/f5-core:testing-advancedThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
E2E, property-based, mutation, and CI/CD testing patterns.
E2E, property-based, mutation, and CI/CD testing patterns.
npx playwright test # Run all
npx playwright test --ui # UI mode
npx playwright test --debug # Debug mode
npx playwright codegen # Generate tests
// pages/LoginPage.ts
export class LoginPage {
constructor(private page: Page) {}
async login(email: string, password: string) {
await this.page.fill('[data-testid="email"]', email);
await this.page.fill('[data-testid="password"]', password);
await this.page.click('[data-testid="submit"]');
}
async expectLoggedIn() {
await expect(this.page).toHaveURL('/dashboard');
}
}
// tests/auth.spec.ts
test('should login successfully', async ({ page }) => {
const loginPage = new LoginPage(page);
await page.goto('/login');
await loginPage.login('[email protected]', 'password');
await loginPage.expectLoggedIn();
});
test('should match screenshot', async ({ page }) => {
await page.goto('/dashboard');
await expect(page).toHaveScreenshot('dashboard.png', {
maxDiffPixels: 100,
});
});
// cypress.config.ts
export default defineConfig({
e2e: {
baseUrl: 'http://localhost:3000',
supportFile: 'cypress/support/e2e.ts',
specPattern: 'cypress/e2e/**/*.cy.ts',
},
retries: { runMode: 2, openMode: 0 },
});
import fc from 'fast-check';
describe('string operations', () => {
it('reverse(reverse(s)) === s', () => {
fc.assert(
fc.property(fc.string(), (s) => {
return reverse(reverse(s)) === s;
})
);
});
it('sort is idempotent', () => {
fc.assert(
fc.property(fc.array(fc.integer()), (arr) => {
const sorted = sort(arr);
return JSON.stringify(sort(sorted)) === JSON.stringify(sorted);
})
);
});
});
// stryker.conf.json
{
"mutate": ["src/**/*.ts", "!src/**/*.spec.ts"],
"testRunner": "jest",
"reporters": ["html", "clear-text"],
"thresholds": { "high": 80, "low": 60, "break": 50 }
}
npx stryker run
// Consumer test
const provider = new Pact({
consumer: 'FrontendApp',
provider: 'UserService',
});
describe('User API', () => {
beforeAll(() => provider.setup());
afterAll(() => provider.finalize());
it('should get user', async () => {
await provider.addInteraction({
state: 'user exists',
uponReceiving: 'get user request',
withRequest: { method: 'GET', path: '/users/1' },
willRespondWith: {
status: 200,
body: { id: 1, name: 'John' },
},
});
const user = await getUser(1);
expect(user.name).toBe('John');
});
});
# .github/workflows/test.yml
name: Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20' }
- run: npm ci
- run: npm run test:cov
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
files: ./coverage/lcov.info
e2e:
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/
// Retry configuration
test.describe.configure({ retries: 2 });
// Wait for stability
await expect(element).toBeVisible({ timeout: 10000 });
// Avoid timing issues
await page.waitForLoadState('networkidle');
| Gate | Requirement |
|---|---|
| G3 | E2E critical paths verified |
| G4 | Contract tests pass |
| G5 | Production smoke tests |
npx claudepluginhub fujigo-software/f5-framework-claude --plugin f5-coreProvides E2E testing patterns and Playwright examples for reliable suites, flaky test debugging, CI/CD setup, and critical user workflows.
Provides patterns for building reliable E2E test suites with Playwright and Cypress, including page object model, configuration, and debugging flaky tests.
Generates page objects and test infrastructure for Playwright, Cypress, or Selenium E2E tests. Covers critical-path test implementation and flakiness remediation.