@ralsh/playwright
v0.1.0
Published
Playwright helpers and reporter for uploading Ralsh visual regression snapshots.
Maintainers
Readme
@ralsh/playwright
Capture screenshots in Playwright tests and upload them to Ralsh for visual regression detection.
Install
npm install --save-dev @ralsh/playwrightInline
import { test } from '@ralsh/playwright';
test('homepage', async ({ page, snapshot }) => {
await page.goto('/');
await snapshot('homepage');
});Reporter
// playwright.config.ts
export default {
reporter: [['@ralsh/playwright/reporter']],
};By default, the reporter uploads to Ralsh and reads RALSH_TOKEN from the
environment, so most projects only need this:
RALSH_TOKEN=ral_pat_...You can also pass the token explicitly:
export default {
reporter: [
[
'@ralsh/playwright/reporter',
{
projectToken: process.env.RALSH_TOKEN,
},
],
],
};