Skip to content

Scheduling infrastructure for absolutely everyone.

fix: all e2e flakes [WIP] (#23633)

Anik Dhabal Babu550f34c12837
diff --git a/apps/web/playwright/change-theme.e2e.ts b/apps/web/playwright/change-theme.e2e.ts
index 09b06f006fa..adee17b3906 100644
--- a/apps/web/playwright/change-theme.e2e.ts
+++ b/apps/web/playwright/change-theme.e2e.ts
@@ -7,7 +7,7 @@ test.describe("Change App Theme Test", () => {
const pro = await users.create();
await pro.apiLogin();
await page.goto("/settings/my-account/appearance");
- await expect(page.locator('text="Dashboard theme"')).toBeVisible();
+ await expect(page.getByTestId("dashboard-shell").getByText("Dashboard theme")).toBeVisible();
await page.click('[data-testid="appTheme-dark"]');
await page.click('[data-testid="update-app-theme-btn"]');
@@ -25,7 +25,7 @@ test.describe("Change App Theme Test", () => {
const pro = await users.create();
await pro.apiLogin();
await page.goto("/settings/my-account/appearance");
- await expect(page.locator('text="Dashboard theme"')).toBeVisible();
+ await expect(page.getByTestId("dashboard-shell").getByText("Dashboard theme")).toBeVisible();
await page.click('[data-testid="appTheme-light"]');
await page.click('[data-testid="update-app-theme-btn"]');
@@ -44,7 +44,7 @@ test.describe("Change App Theme Test", () => {
await pro.apiLogin();
await page.goto("/settings/my-account/appearance");
- await expect(page.locator('text="Dashboard theme"')).toBeVisible();
+ await expect(page.getByTestId("dashboard-shell").getByText("Dashboard theme")).toBeVisible();
await page.click('[data-testid="appTheme-light"]');
await page.click('[data-testid="update-app-theme-btn"]');
const toast1 = await page.waitForSelector('[data-testid="toast-success"]');
@@ -72,7 +72,7 @@ test.describe("Change Booking Page Theme Test", () => {
await pro.apiLogin();
await page.goto("/settings/my-account/appearance");
- await expect(page.locator('text="Dashboard theme"')).toBeVisible();
+ await expect(page.getByTestId("dashboard-shell").getByText("Dashboard theme")).toBeVisible();
//Click the "Dark" theme label
await page.click('[data-testid="theme-dark"]');
@@ -94,7 +94,7 @@ test.describe("Change Booking Page Theme Test", () => {
await pro.apiLogin();
await page.goto("/settings/my-account/appearance");
- await expect(page.locator('text="Dashboard theme"')).toBeVisible();
+ await expect(page.getByTestId("dashboard-shell").getByText("Dashboard theme")).toBeVisible();
//Click the "Light" theme label
await page.click('[data-testid="theme-light"]');
@@ -114,7 +114,7 @@ test.describe("Change Booking Page Theme Test", () => {
await pro.apiLogin();
await page.goto("/settings/my-account/appearance");
- await expect(page.locator('text="Dashboard theme"')).toBeVisible();
+ await expect(page.getByTestId("dashboard-shell").getByText("Dashboard theme")).toBeVisible();
await page.click('[data-testid="theme-light"]');
await page.click('[data-testid="update-theme-btn"]');
diff --git a/apps/web/playwright/workflow.e2e.ts b/apps/web/playwright/workflow.e2e.ts
index b8b87cd0aaf..f262c5e8c21 100644
--- a/apps/web/playwright/workflow.e2e.ts
+++ b/apps/web/playwright/workflow.e2e.ts
@@ -26,7 +26,8 @@ test.describe("Workflow Tab - Event Type", () => {
await fillNameInput("Edited Workflow");
await saveWorkflow();
await page.getByTestId("go-back-button").click();
- page.getByTestId("workflow-list").waitFor();
+ await page.getByTestId("workflow-list").waitFor();
+ await page.reload();
await hasWorkflowInList("Edited Workflow");
});