@pixellpeep/playwright
v0.2.0
Published
PixellPeep Playwright fixture for visual regression snapshots
Readme
@pixellpeep/playwright
Playwright fixture for one-line visual snapshots with PixellPeep.
Setup
npm install @pixellpeep/playwright @pixellpeep/client @playwright/testplaywright.config.ts:
import { defineConfig } from '@playwright/test';
import { pixellpeepConfig } from '@pixellpeep/playwright';
export default defineConfig({
...pixellpeepConfig({
apiUrl: process.env.PIXELLPEEP_API,
apiKey: process.env.PIXELLPEEP_API_KEY,
projectId: process.env.PIXELLPEEP_PROJECT_ID,
baselineMode: 'local',
}),
});Test
import { test, expect } from '@pixellpeep/playwright';
test('login page', async ({ page, pixellpeep }) => {
await page.goto('https://your-app.example/login');
await pixellpeep.snapshot('login-page');
});Update baselines: updateBaseline: true on snapshot or PIXELLPEEP_UPDATE=1 via config.
