Scheduling infrastructure for absolutely everyone.
fix: 2FA OTP flaky test (#13583)
Udit Takkar5dad78f8fe10
diff --git a/apps/web/playwright/login.2fa.e2e.ts b/apps/web/playwright/login.2fa.e2e.tsindex 0864f678530..5365aa548e6 100644--- a/apps/web/playwright/login.2fa.e2e.ts+++ b/apps/web/playwright/login.2fa.e2e.ts@@ -42,6 +42,8 @@ test.describe("2FA Tests", async () => {await fillOtp({ page, secret: "123456", noRetry: true });await expect(page.locator('[data-testid="error-submitting-code"]')).toBeVisible();+ await removeOtpInput(page);+await fillOtp({page,// eslint-disable-next-line @typescript-eslint/no-non-null-assertion@@ -162,6 +164,14 @@ test.describe("2FA Tests", async () => {});});+async function removeOtpInput(page: Page) {+ await page.locator('input[name="2fa6"]').waitFor({ state: "visible", timeout: 30_000 });++ // Remove one OTP input+ await page.locator('input[name="2fa6"]').focus();+ await page.keyboard.press("Backspace");+}+async function fillOtp({ page, secret, noRetry }: { page: Page; secret: string; noRetry?: boolean }) {let token = authenticator.generate(secret);if (!noRetry && !totpAuthenticatorCheck(token, secret)) {