@zerograviti/atticus-mock-service
v0.1.2
Published
A low friction mock and replay service for playwright
Maintainers
Readme
Playwright-first API mock recorder/replayer (Atticus).
Quick start
Install (dev):
npm install --save-dev atticus-mock-serviceAdd to Playwright fixtures (example):
import { test as base } from '@playwright/test';
import { MockService } from 'atticus-mock-service';
import path from 'path';
export const test = base.extend({
page: async ({ page }, use) => {
const service = new MockService({
mockDir: path.resolve('atticus-mocks'),
recordMode: 'auto',
autoApprove: true
});
await service.attachToPage(page);
await use(page);
}
});
export { expect } from '@playwright/test';Modes:
record— always hit real endpoints and save responsesreplay— only use saved responses; fail if missingauto— replay if present; otherwise record
Notes:
- If you see TLS errors for
route.fetch(), setNODE_EXTRA_CA_CERTSto a CA file you trust and setignoreHTTPSErrors: truein Playwright config.
Contributing and publishing:
- repo contains
ciworkflow that runs lint/build/test on PRs.
