mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
🔧 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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user