fix: e2e flakes (#20630)

* fix

* Update managed-event-types.e2e.ts

* fix
This commit is contained in:
Anik Dhabal Babu
2025-05-07 18:04:06 +05:30
committed by GitHub
parent 6143cd60e5
commit 61397e5184
2 changed files with 7 additions and 5 deletions
+5
View File
@@ -23,6 +23,11 @@ test.describe("hash my url", () => {
// We wait until loading is finished
await page.waitForSelector('[data-testid="event-types"]');
await page.locator("ul[data-testid=event-types] > li a").first().click();
await expect(page.getByTestId("vertical-tab-event_setup_tab_title")).toHaveAttribute(
"aria-current",
"page"
); // fix the race condition
await expect(page.getByTestId("vertical-tab-event_setup_tab_title")).toContainText("Event Setup"); //fix the race condition
// We wait for the page to load
await page.locator(".primary-navigation >> text=Advanced").click();
// ignore if it is already checked, and click if unchecked
+2 -5
View File
@@ -50,16 +50,13 @@ test.describe("2FA Tests", async () => {
secret: secret!,
});
// FIXME: this passes even when switch is not checked, compare to test
// below which checks for data-state="checked" and works as expected
await page.waitForSelector(`[data-testid=two-factor-switch]`);
await expect(page.locator(`[data-testid=two-factor-switch]`).isChecked()).toBeTruthy();
await expect(page.getByTestId("backup-codes-download")).toBeVisible();
return user;
});
await test.step("Logout", async () => {
await page.goto("/auth/logout");
await users.logout();
});
await test.step("Login with 2FA enabled", async () => {