mirror of
https://github.com/penpot/penpot.git
synced 2026-02-12 14:42:56 +00:00
Merge pull request #8331 from penpot/ladybenko-add-wasm-config-playwright-helper
🔧 Add helper utils to mock config flags for WasmWorkspacePage (e2e)
This commit is contained in:
@@ -10,7 +10,7 @@ export const WASM_FLAGS = [
|
|||||||
export class WasmWorkspacePage extends WorkspacePage {
|
export class WasmWorkspacePage extends WorkspacePage {
|
||||||
static async init(page) {
|
static async init(page) {
|
||||||
await super.init(page);
|
await super.init(page);
|
||||||
await WorkspacePage.mockConfigFlags(page, WASM_FLAGS);
|
await WasmWorkspacePage.mockConfigFlags(page, WASM_FLAGS);
|
||||||
|
|
||||||
await page.addInitScript(() => {
|
await page.addInitScript(() => {
|
||||||
document.addEventListener("penpot:wasm:loaded", () => {
|
document.addEventListener("penpot:wasm:loaded", () => {
|
||||||
@@ -27,6 +27,14 @@ export class WasmWorkspacePage extends WorkspacePage {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async mockConfigFlags(page, flags) {
|
||||||
|
await super.mockConfigFlags(page, [...WASM_FLAGS, ...flags]);
|
||||||
|
}
|
||||||
|
|
||||||
|
async mockConfigFlags(flags) {
|
||||||
|
return WasmWorkspacePage.mockConfigFlags(this.page, flags);
|
||||||
|
}
|
||||||
|
|
||||||
constructor(page) {
|
constructor(page) {
|
||||||
super(page);
|
super(page);
|
||||||
this.canvas = page.getByTestId("canvas-wasm-shapes");
|
this.canvas = page.getByTestId("canvas-wasm-shapes");
|
||||||
|
|||||||
Reference in New Issue
Block a user