From 86940cce9e028d2e43f2b1a67380bceb22155775 Mon Sep 17 00:00:00 2001 From: kyy Date: Fri, 29 May 2026 18:26:01 +0900 Subject: [PATCH] =?UTF-8?q?23cd316c23=20=EA=B8=B0=EC=A4=80=20=EB=B3=91?= =?UTF-8?q?=ED=95=A9=20code-check=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- userfront-e2e/tests/auth-routing.spec.ts | 49 ++++++------------- .../tests/signup-theme-visibility.spec.ts | 14 ++++-- 2 files changed, 24 insertions(+), 39 deletions(-) diff --git a/userfront-e2e/tests/auth-routing.spec.ts b/userfront-e2e/tests/auth-routing.spec.ts index cd5999e8..1e9d4942 100644 --- a/userfront-e2e/tests/auth-routing.spec.ts +++ b/userfront-e2e/tests/auth-routing.spec.ts @@ -189,44 +189,19 @@ async function makeWindowCloseNavigateToRoot(page: Page): Promise { }); } -async function clickVerificationAction(page: Page): Promise { - await page.waitForTimeout(500); - if (page.isClosed() || !page.url().includes("/verify-complete")) { - return; - } - - const viewport = page.viewportSize(); - if (!viewport) { - throw new Error("Viewport size was not available."); - } - - await page.mouse.click( - viewport.width / 2, - Math.min(viewport.height - 24, viewport.height / 2 + 120), - ); -} - async function enableFlutterAccessibility(page: Page): Promise { await page.waitForTimeout(300); const button = page.getByRole("button", { name: "Enable accessibility" }); - if (await button.count()) { - await button.first().click({ force: true }).catch(async () => { - await button.first().evaluate((node) => { - (node as HTMLElement).click(); - }); - }); - await page.waitForTimeout(500); - return; - } const placeholder = page.locator("flt-semantics-placeholder").first(); - if (await placeholder.count()) { - await placeholder.click({ force: true }).catch(async () => { + + await button.click({ force: true, timeout: 1_000 }).catch(async () => { + await placeholder.click({ force: true, timeout: 1_000 }).catch(async () => { await placeholder.evaluate((node) => { (node as HTMLElement).click(); }); }); - await page.waitForTimeout(800); - } + }); + await page.waitForTimeout(500); } test.describe("UserFront WASM auth routing", () => { @@ -366,7 +341,8 @@ test.describe("UserFront WASM auth routing", () => { await expect(page).toHaveURL(/\/ko\/verify-complete$/); expect(userMeCalls).toBe(0); - await clickVerificationAction(page); + await enableFlutterAccessibility(page); + await page.getByRole("button", { name: "로그인 창으로 이동하기" }).click(); expect(userMeCalls).toBe(0); await expect(page).toHaveURL(/\/ko\/signin(?:\?.*)?$/); @@ -529,7 +505,10 @@ test.describe("UserFront WASM auth routing", () => { if (!popup.isClosed()) { const closePromise = popup.waitForEvent("close").catch(() => undefined); try { - await clickVerificationAction(popup); + await enableFlutterAccessibility(popup); + await popup + .getByRole("button", { name: "로그인 창으로 이동하기" }) + .click(); } catch (error) { if (!popup.isClosed()) { throw error; @@ -573,7 +552,8 @@ test.describe("UserFront WASM auth routing", () => { verifyOnly: true, }); - await clickVerificationAction(page); + await enableFlutterAccessibility(page); + await page.getByRole("button", { name: "로그인 창으로 이동하기" }).click(); expect(userMeCalls).toBe(0); await expect(page).toHaveURL(/\/ko\/signin(?:\?.*)?$/); @@ -614,7 +594,8 @@ test.describe("UserFront WASM auth routing", () => { verifyOnly: true, }); - await clickVerificationAction(page); + await enableFlutterAccessibility(page); + await page.getByRole("button", { name: "로그인 창으로 이동하기" }).click(); expect(userMeCalls).toBe(0); await expect(page).toHaveURL(/\/ko\/signin(?:\?.*)?$/); diff --git a/userfront-e2e/tests/signup-theme-visibility.spec.ts b/userfront-e2e/tests/signup-theme-visibility.spec.ts index ff11d8a2..9346f4ca 100644 --- a/userfront-e2e/tests/signup-theme-visibility.spec.ts +++ b/userfront-e2e/tests/signup-theme-visibility.spec.ts @@ -115,15 +115,19 @@ async function mockSignupApis(page: Page): Promise { } async function enableFlutterAccessibility(page: Page): Promise { + await page.waitForTimeout(300); + const button = page.getByRole('button', { name: 'Enable accessibility' }); - if (await button.count()) { - await button.first().click({ force: true }).catch(async () => { - await page.locator('flt-semantics-placeholder').first().evaluate((node) => { + const placeholder = page.locator('flt-semantics-placeholder').first(); + + await button.click({ force: true, timeout: 1_000 }).catch(async () => { + await placeholder.click({ force: true, timeout: 1_000 }).catch(async () => { + await placeholder.evaluate((node) => { (node as HTMLElement).click(); }); }); - await page.waitForTimeout(400); - } + }); + await page.waitForTimeout(400); } async function typeIntoField(page: Page, locator: Locator, value: string): Promise {