@rulereplay/playwright
v0.1.0
Published
Playwright browser authorities, visible-state observations, artifacts, replay, and generated-world fixtures for RuleReplay
Readme
@rulereplay/playwright
Playwright browser authorities, visible-state observations, generated-world fixtures, artifacts, and replay for RuleReplay.
Install
npm install --save-dev @rulereplay/core @rulereplay/playwright playwright
npx playwright install chromiumExample
import {
browserAuthority,
observeVisibleState,
playwrightTier,
} from '@rulereplay/playwright';
const browser = playwrightTier({
baseURL: 'http://127.0.0.1:3000',
screenshot: 'on-failure',
trace: 'on-failure',
});
const summaryPage = browserAuthority({
name: 'summary-page',
start: world => `/orders/${world.orderId}`,
observe: ({ page }) =>
observeVisibleState(page, {
status: '[data-testid="status"]',
}),
});Each authority receives an isolated page. Screenshots, traces, and browser logs are retained according to the configured artifact policy.
Requires Node.js 20.11 or newer and Playwright 1.x. Licensed under MIT.
