mirror of
https://github.com/penpot/penpot.git
synced 2025-07-09 10:27:21 +02:00
🔧 Add visual regression tests for font load
This commit is contained in:
parent
330bee7839
commit
f58ee2c89f
4 changed files with 394 additions and 0 deletions
45
frontend/playwright/ui/render-wasm-specs/texts.spec.js
Normal file
45
frontend/playwright/ui/render-wasm-specs/texts.spec.js
Normal file
|
@ -0,0 +1,45 @@
|
|||
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 texts", async ({
|
||||
page,
|
||||
}) => {
|
||||
const workspace = new WasmWorkspacePage(page);
|
||||
await workspace.setupEmptyFile();
|
||||
await workspace.mockGetFile("render-wasm/get-file-text.json");
|
||||
|
||||
await workspace.goToWorkspace({
|
||||
id: "3b0d758a-8c9d-8013-8006-52c8337e5c72",
|
||||
pageId: "3b0d758a-8c9d-8013-8006-52c8337e5c73",
|
||||
});
|
||||
await workspace.waitForFirstRender();
|
||||
await expect(workspace.canvas).toHaveScreenshot();
|
||||
});
|
||||
|
||||
test("Updates a text font", async ({
|
||||
page,
|
||||
}) => {
|
||||
const workspace = new WasmWorkspacePage(page);
|
||||
await workspace.setupEmptyFile();
|
||||
await workspace.mockGetFile("render-wasm/get-file-text.json");
|
||||
|
||||
await workspace.goToWorkspace({
|
||||
id: "3b0d758a-8c9d-8013-8006-52c8337e5c72",
|
||||
pageId: "3b0d758a-8c9d-8013-8006-52c8337e5c73",
|
||||
});
|
||||
await workspace.waitForFirstRender();
|
||||
await workspace.clickLeafLayer("this is a text");
|
||||
const fontStyle = workspace.page.getByTitle("Font Style");
|
||||
await fontStyle.click();
|
||||
const boldOption = fontStyle.getByText("bold").first();
|
||||
await boldOption.click();
|
||||
await expect(workspace.canvas).toHaveScreenshot();
|
||||
});
|
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
Loading…
Add table
Add a link
Reference in a new issue