Skip to content

Commit

Permalink
Fixed some tests (TopBar tests still needs fixing)
Browse files Browse the repository at this point in the history
  • Loading branch information
BaBrixx committed Dec 14, 2023
1 parent 44c6061 commit 0eaec54
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 19 deletions.
14 changes: 9 additions & 5 deletions tests/lib/components/settings/colorSettings.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { test, expect, type Dialog } from "@playwright/test";

test.beforeEach(async ({ page }) => {
test.beforeEach(async ({ page, browserName }) => {
// TODO: remove this check when Firefox and WebKit supports popover: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/popover#browser_compatibility
test.skip(
browserName === "firefox" || browserName === "webkit",
"Popover not supported yet",
);

await page.goto("/");
await page.waitForLoadState();
await page.waitForLoadState("load");
Expand All @@ -9,10 +15,8 @@ test.beforeEach(async ({ page }) => {
await page.waitForLoadState("load");
await page.waitForLoadState("domcontentloaded");

await page.getByRole("button", { name: "Options", exact: true }).hover();
await page
.getByRole("button", { name: "settings Settings", exact: true })
.click();
await page.getByRole("button", { name: "Options", exact: true }).click();
await page.getByRole("button", { name: "Settings", exact: true }).click();
});

test("can create valid color", async ({ page }) => {
Expand Down
14 changes: 9 additions & 5 deletions tests/lib/components/settings/fontSettings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ import { test, expect, type Dialog } from "@playwright/test";

const testFilesPath = "tests/lib/components/settings/testfiles";

test.beforeEach(async ({ page }) => {
test.beforeEach(async ({ page, browserName }) => {
// TODO: remove this check when Firefox and WebKit supports popover: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/popover#browser_compatibility
test.skip(
browserName === "firefox" || browserName === "webkit",
"Popover not supported yet",
);

await page.goto("/");
await page.waitForLoadState();
await page.waitForLoadState("load");
Expand All @@ -11,10 +17,8 @@ test.beforeEach(async ({ page }) => {
await page.waitForLoadState("load");
await page.waitForLoadState("domcontentloaded");

await page.getByRole("button", { name: "Options", exact: true }).hover();
await page
.getByRole("button", { name: "settings Settings", exact: true })
.click();
await page.getByRole("button", { name: "Options", exact: true }).click();
await page.getByRole("button", { name: "Settings", exact: true }).click();
await page.getByRole("button", { name: "Font", exact: true }).click();
});

Expand Down
14 changes: 9 additions & 5 deletions tests/lib/components/settings/settings.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { test, expect, type Page, type Locator } from "@playwright/test";

test.beforeEach(async ({ page }) => {
test.beforeEach(async ({ page, browserName }) => {
// TODO: remove this check when Firefox and WebKit supports popover: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/popover#browser_compatibility
test.skip(
browserName === "firefox" || browserName === "webkit",
"Popover not supported yet",
);

await page.goto("/");
await page.waitForLoadState();
await page.waitForLoadState("load");
Expand All @@ -9,10 +15,8 @@ test.beforeEach(async ({ page }) => {
await page.waitForLoadState("load");
await page.waitForLoadState("domcontentloaded");

await page.getByRole("button", { name: "Options", exact: true }).hover();
await page
.getByRole("button", { name: "settings Settings", exact: true })
.click();
await page.getByRole("button", { name: "Options", exact: true }).click();
await page.getByRole("button", { name: "Settings", exact: true }).click();
});

async function getTabButtons(page: Page): Promise<Locator[]> {
Expand Down
11 changes: 8 additions & 3 deletions tests/lib/components/topBar/aboutUI/about.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import { test, expect } from "@playwright/test";

test.beforeEach(async ({ page }) => {
test.beforeEach(async ({ page, browserName }) => {
// TODO: remove this check when Firefox and WebKit supports popover: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/popover#browser_compatibility
test.skip(
browserName === "firefox" || browserName === "webkit",
"Popover not supported yet",
);

await page.goto("/");
await page.click("#start-new-project");
});

test("Navigating to Help, then About", async ({ page }) => {
await page.getByRole("button", { name: "Help", exact: true }).click();

await page.getByRole("button", { name: "error About" }).click();
await page.getByRole("button", { name: "About", exact: true }).click();

const aboutBox = await page
.locator("dialog")
Expand Down
8 changes: 7 additions & 1 deletion tests/lib/components/topBar/topbar.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { test, expect } from "@playwright/test";

test.beforeEach(async ({ page }) => {
test.beforeEach(async ({ page, browserName }) => {
// TODO: remove this check when Firefox and WebKit supports popover: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/popover#browser_compatibility
test.skip(
browserName === "firefox" || browserName === "webkit",
"Popover not supported yet",
);

await page.goto("/");
await page.click("#start-new-project");
});
Expand Down

0 comments on commit 0eaec54

Please sign in to comment.