@argos-ci/playwright
v7.3.6
Published
Playwright SDK for visual testing with Argos.
Maintainers
Readme
Official Argos Playwright integration
Capture stable Argos screenshots from your Playwright tests, and report failure screenshots and traces to Argos.
Visit the Playwright SDK documentation for guides, the API reference, and more.
Installation
npm install --save-dev @argos-ci/playwrightUsage
Set up the Argos reporter in your Playwright config:
// playwright.config.ts
import { defineConfig } from "@playwright/test";
import { createArgosReporterOptions } from "@argos-ci/playwright/reporter";
export default defineConfig({
// ... other configuration
reporter: [
// Use "dot" reporter on CI, "list" otherwise (Playwright default).
process.env.CI ? ["dot"] : ["list"],
// Add the Argos reporter.
[
"@argos-ci/playwright/reporter",
// Upload the screenshots to Argos only on CI.
createArgosReporterOptions({ uploadToArgos: !!process.env.CI }),
],
],
});Then capture stable screenshots with argosScreenshot in your tests:
// tests/example.spec.ts
import { test } from "@playwright/test";
import { argosScreenshot } from "@argos-ci/playwright";
test("screenshot homepage", async ({ page }) => {
await page.goto("http://localhost:3000");
await argosScreenshot(page, "homepage");
});