mirror of
https://github.com/penpot/penpot.git
synced 2025-06-17 07:51:39 +02:00
🔧 Set up playwright project for render wasm
This commit is contained in:
parent
8c337f508b
commit
59a4b51d2c
10 changed files with 2256 additions and 8 deletions
50
frontend/playwright/ui/render-wasm-specs/shapes.spec.js
Normal file
50
frontend/playwright/ui/render-wasm-specs/shapes.spec.js
Normal file
|
@ -0,0 +1,50 @@
|
|||
import { test, expect } from "@playwright/test";
|
||||
import { WasmWorkspacePage } from "../pages/WasmWorkspacePage";
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await WasmWorkspacePage.init(page);
|
||||
await WasmWorkspacePage.mockConfigFlags(page, [
|
||||
"enable-feature-render-wasm",
|
||||
"enable-render-wasm-dpr",
|
||||
]);
|
||||
});
|
||||
|
||||
test("Renders a file with basic shapes, boards and groups", async ({
|
||||
page,
|
||||
}) => {
|
||||
const workspace = new WasmWorkspacePage(page);
|
||||
await workspace.setupEmptyFile();
|
||||
await workspace.mockGetFile("render-wasm/get-file-shapes-groups-boards.json");
|
||||
|
||||
await workspace.goToWorkspace({
|
||||
id: "53a7ff09-2228-81d3-8006-4b5eac177245",
|
||||
pageId: "53a7ff09-2228-81d3-8006-4b5eac177246",
|
||||
});
|
||||
await workspace.waitForCanvasRender();
|
||||
|
||||
await expect(workspace.canvas).toHaveScreenshot();
|
||||
});
|
||||
|
||||
test("Renders a file with solid, gradient and image fills", async ({
|
||||
page,
|
||||
}) => {
|
||||
const workspace = new WasmWorkspacePage(page);
|
||||
await workspace.setupEmptyFile();
|
||||
await workspace.mockAsset(
|
||||
"1ebcea38-f1bf-8101-8006-4c8fd68e7c84",
|
||||
"render-wasm/penguins.jpg",
|
||||
);
|
||||
await workspace.mockAsset(
|
||||
"1ebcea38-f1bf-8101-8006-4c8f579da49c",
|
||||
"render-wasm/penguins.jpg",
|
||||
);
|
||||
await workspace.mockGetFile("render-wasm/get-file-shapes-fills.json");
|
||||
|
||||
await workspace.goToWorkspace({
|
||||
id: "1ebcea38-f1bf-8101-8006-4c8ec4a9bffe",
|
||||
pageId: "1ebcea38-f1bf-8101-8006-4c8ec4a9bfff",
|
||||
});
|
||||
await workspace.waitForCanvasRender();
|
||||
|
||||
await expect(workspace.canvas).toHaveScreenshot();
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue