🔧 Add initial snapshots

This commit is contained in:
Belén Albeza 2025-06-09 16:38:58 +02:00
parent 1a10b7ebfd
commit 479406b884
7 changed files with 1241 additions and 2 deletions

2
frontend/.gitignore vendored
View file

@ -11,4 +11,4 @@ node_modules/
/blob-report/ /blob-report/
/playwright/.cache/ /playwright/.cache/
/playwright/**/visual-specs/**/*.png /playwright/**/visual-specs/**/*.png
/playwright/**/render-wasm-specs/**/*.png

View file

@ -61,8 +61,11 @@ export default defineConfig({
deviceScaleFactor: 2, deviceScaleFactor: 2,
}, },
testDir: "./playwright/ui/render-wasm-specs", testDir: "./playwright/ui/render-wasm-specs",
snapshotPathTemplate: "{testDir}/{testFilePath}-snapshots/{arg}.png",
expect: { expect: {
toHaveScreenshot: { maxDiffPixelRatio: 0.005 }, toHaveScreenshot: {
maxDiffPixelRatio: 0.005,
},
}, },
}, },
], ],

File diff suppressed because it is too large Load diff

View file

@ -48,3 +48,29 @@ test("Renders a file with solid, gradient and image fills", async ({
await expect(workspace.canvas).toHaveScreenshot(); await expect(workspace.canvas).toHaveScreenshot();
}); });
test("Renders a file with strokes", async ({ page }) => {
const workspace = new WasmWorkspacePage(page);
await workspace.setupEmptyFile();
await workspace.mockAsset(
"202c1104-9385-81d3-8006-5074e4682cac",
"render-wasm/assets/penguins.jpg",
);
await workspace.mockAsset(
"202c1104-9385-81d3-8006-5074c50339b6",
"render-wasm/assets/penguins.jpg",
);
await workspace.mockAsset(
"202c1104-9385-81d3-8006-507560ce29e3",
"render-wasm/assets/penguins.jpg",
);
await workspace.mockGetFile("render-wasm/get-file-shapes-strokes.json");
await workspace.goToWorkspace({
id: "202c1104-9385-81d3-8006-507413ff2c99",
pageId: "202c1104-9385-81d3-8006-507413ff2c9a",
});
await workspace.waitForFirstRender();
await expect(workspace.canvas).toHaveScreenshot();
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB