diff --git a/packages/studio-web/tests/editor/check-page.spec.ts b/packages/studio-web/tests/editor/check-page.spec.ts index 0da8dfce..ad2797bb 100644 --- a/packages/studio-web/tests/editor/check-page.spec.ts +++ b/packages/studio-web/tests/editor/check-page.spec.ts @@ -3,7 +3,7 @@ import { testAssetsPath, disablePlausible } from "../test-commands"; test.describe.configure({ mode: "parallel" }); test("should check editor UI", async ({ page }) => { await page.goto("/", { waitUntil: "load" }); - disablePlausible(page); + await disablePlausible(page); await page.getByRole("button", { name: /Editor/ }).click(); await expect( page.getByRole("button", { name: "Take the tour!" }), diff --git a/packages/studio-web/tests/studio-web/check-page-1.spec.ts b/packages/studio-web/tests/studio-web/check-page-1.spec.ts index d1e7b937..122e7e76 100644 --- a/packages/studio-web/tests/studio-web/check-page-1.spec.ts +++ b/packages/studio-web/tests/studio-web/check-page-1.spec.ts @@ -2,11 +2,9 @@ import { test, expect } from "@playwright/test"; import { testText, disablePlausible } from "../test-commands"; test.describe.configure({ mode: "parallel" }); test.describe("test studio UI & UX", () => { - test.beforeEach(async ({ page }) => { - disablePlausible(page); - }); test("should check UI (en)", async ({ page }) => { await page.goto("/"); + await disablePlausible(page); //tour button is visible await expect(page.getByText("Take the tour!")).toBeVisible(); //check text button group @@ -22,6 +20,7 @@ test.describe("test studio UI & UX", () => { }); test("should check UI (fr)", async ({ page }) => { await page.goto("http://localhost:4203/"); + await disablePlausible(page); //tour button is visible await expect( page.getByRole("button", { name: "Visite guidée" }), @@ -39,6 +38,7 @@ test.describe("test studio UI & UX", () => { }); test("should check UI (es)", async ({ page }) => { await page.goto("http://localhost:4204/"); + await disablePlausible(page); //tour button is visible await expect(page.getByText("¡Siga el tour!")).toBeVisible(); //check text button group @@ -54,6 +54,7 @@ test.describe("test studio UI & UX", () => { }); test("should input and save text", async ({ page }) => { await page.goto("/"); + await disablePlausible(page); await expect(page.getByTestId("text-download-btn")).toBeDisabled(); await page.getByTestId("ras-text-input").fill(testText); await expect(page.getByTestId("text-download-btn")).toBeEnabled(); diff --git a/packages/studio-web/tests/test-commands.ts b/packages/studio-web/tests/test-commands.ts index 9a033a74..7fe7a0f8 100644 --- a/packages/studio-web/tests/test-commands.ts +++ b/packages/studio-web/tests/test-commands.ts @@ -112,14 +112,16 @@ export const defaultBeforeEach = async (page: Page, browserName: string) => { browserName === "webkit", "The aligner feature is not stable for webkit", ); + await expect(async () => { + await page.goto("/", { waitUntil: "load" }); + await expect( + page.getByTestId("next-step"), + "Soundswallower model has loaded", + ).not.toBeDisabled(); - await page.goto("/", { waitUntil: "load" }); - await expect( - page.getByTestId("next-step"), - "Soundswallower model has loaded", - ).not.toBeDisabled(); + await disablePlausible(page); + }).toPass(); }); - disablePlausible(page); }; /**