0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-22 14:39:45 -05:00

Setup temporary visual regression testing for the design system

This commit is contained in:
Belén Albeza 2024-05-28 11:07:48 +02:00
parent c3c6879a2f
commit d4dc87a740
4 changed files with 21 additions and 2 deletions

View file

@ -32,7 +32,7 @@
"compile:cljs": "clojure -M:dev:shadow-cljs compile main",
"watch": "node ./scripts/watch.js",
"e2e:server": "node ./scripts/e2e-server.js",
"e2e:test": "playwright test",
"e2e:test": "playwright test --project default",
"storybook:compile": "yarn run compile && clojure -M:dev:shadow-cljs compile storybook",
"storybook:watch": "yarn run storybook:compile && concurrently \"clojure -M:dev:shadow-cljs watch storybook\" \"storybook dev -p 6006\" \"yarn run watch\"",
"storybook:build": "yarn run storybook:compile && storybook build"

View file

@ -39,8 +39,17 @@ export default defineConfig({
/* Configure projects for major browsers */
projects: [
{
name: "chromium",
name: "default",
use: { ...devices["Desktop Chrome"] },
testDir: "./playwright/ui/specs",
},
{
name: "ds",
use: { ...devices["Desktop Chrome"] },
testDir: "./playwright/ui/visual-specs",
expect: {
toHaveScreenshot: { maxDiffPixelRatio: 0.01 },
},
},
],

View file

@ -0,0 +1,10 @@
import { test, expect } from "@playwright/test";
import { LoginPage } from "../pages/LoginPage";
test("Shows login form correctly", async ({ page }) => {
await LoginPage.initWithLoggedOutUser(page);
const loginPage = new LoginPage(page);
await page.goto("/#/auth/login");
await expect(page).toHaveScreenshot();
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB