🔧 Add general improvements to integration tests

This commit marks as skip (temporal) several flaky/randomly-failing
tests.

It also moves the integration test execution from circleci to github
actions.
This commit is contained in:
Andrey Antukh
2025-11-17 23:04:40 +01:00
parent 122d3bc41c
commit 3136096123
27 changed files with 2386 additions and 2174 deletions

View File

@@ -4,6 +4,7 @@ import { WorkspacePage } from "./WorkspacePage";
export const WASM_FLAGS = [
"enable-feature-render-wasm",
"enable-render-wasm-dpr",
"enable-feature-text-editor-v2",
];
export class WasmWorkspacePage extends WorkspacePage {
@@ -12,7 +13,15 @@ export class WasmWorkspacePage extends WorkspacePage {
await WorkspacePage.mockConfigFlags(page, WASM_FLAGS);
await page.addInitScript(() => {
document.addEventListener("wasm:set-objects-finished", () => {
document.addEventListener("penpot:wasm:loaded", () => {
window.wasmModuleLoaded = true;
});
document.addEventListener("penpot:wasm:render", () => {
window.wasmRenderCount = (window.wasmRenderCount || 0) + 1;
});
document.addEventListener("penpot:wasm:set-objects", () => {
window.wasmSetObjectsFinished = true;
});
});
@@ -23,19 +32,20 @@ export class WasmWorkspacePage extends WorkspacePage {
this.canvas = page.getByTestId("canvas-wasm-shapes");
}
async waitForFirstRender(config = {}) {
const options = { hideUI: true, ...config };
await expect(this.pageName).toHaveText("Page 1");
if (options.hideUI) {
await this.hideUI();
}
await this.canvas.waitFor({ state: "visible" });
async waitForFirstRender() {
await this.pageName.waitFor();
await this.canvas.waitFor();
await this.page.waitForFunction(() => {
console.log("RAF:", window.wasmSetObjectsFinished);
return window.wasmSetObjectsFinished;
});
}
async waitForFirstRenderWithoutUI() {
await waitForFirstRender();
await this.hideUI();
}
async hideUI() {
await this.page.keyboard.press("\\");
await expect(this.pageName).not.toBeVisible();