Skip to content

Commit

Permalink
test: added conditions for test to pass in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
deltork committed Jan 6, 2025
1 parent 7787efe commit 5794e13
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/studio-web/tests/editor/check-page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!" }),
Expand Down
7 changes: 4 additions & 3 deletions packages/studio-web/tests/studio-web/check-page-1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" }),
Expand All @@ -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
Expand All @@ -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();
Expand Down
14 changes: 8 additions & 6 deletions packages/studio-web/tests/test-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

/**
Expand Down

0 comments on commit 5794e13

Please sign in to comment.