From 03671f3b91d0d1170792d57ffa3a1718247f4081 Mon Sep 17 00:00:00 2001 From: Paul Nothaft <53005142+the-luap@users.noreply.github.com> Date: Mon, 10 Aug 2026 09:53:18 +0200 Subject: [PATCH] test(e2e): anchor the admin login button locator so SSO doesn't break it (#1012) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With OIDC enabled the login page also renders a 'Sign in with ' button whose accessible name matches the unanchored /Sign In/ locator, so Playwright strict mode failed every test that logs in — 7 of 13 in the local smoke suite, which is also the pre-push gate. CI never hit it because its databases seed without OIDC config. Anchors the regex to the full accessible name in all six call sites. --- tests/e2e/admin-account-settings.spec.ts | 2 +- tests/e2e/dark-mode.spec.ts | 2 +- tests/e2e/seo-settings.spec.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/admin-account-settings.spec.ts b/tests/e2e/admin-account-settings.spec.ts index a5aa0384..fcc486ec 100644 --- a/tests/e2e/admin-account-settings.spec.ts +++ b/tests/e2e/admin-account-settings.spec.ts @@ -13,7 +13,7 @@ test('admin can update account email via settings page', async ({ page }, testIn await page.goto('/admin/login'); await page.getByLabel(/Email|E-Mail/i).fill(ADMIN_EMAIL); await page.getByLabel(/Password|Passwort/i).fill(ADMIN_PASSWORD); - await page.getByRole('button', { name: /Sign In|Log in|Anmelden/i }).click(); + await page.getByRole('button', { name: /^(Sign In|Log in|Anmelden)$/i }).click(); await expect(page.getByRole('heading', { name: /Dashboard|Übersicht/i })).toBeVisible({ timeout: 20000 }); await page.goto('/admin/settings'); diff --git a/tests/e2e/dark-mode.spec.ts b/tests/e2e/dark-mode.spec.ts index 6890217f..09008529 100644 --- a/tests/e2e/dark-mode.spec.ts +++ b/tests/e2e/dark-mode.spec.ts @@ -8,7 +8,7 @@ async function loginToAdmin(page) { await page.goto('/admin/login'); await page.getByLabel(/Email|E-Mail/i).fill(ADMIN_EMAIL); await page.getByLabel(/Password|Passwort/i).fill(ADMIN_PASSWORD); - await page.getByRole('button', { name: /Sign In|Log in|Anmelden/i }).click(); + await page.getByRole('button', { name: /^(Sign In|Log in|Anmelden)$/i }).click(); await expect(page.getByRole('heading', { name: /Dashboard|Übersicht/i })).toBeVisible({ timeout: 20000 }); } diff --git a/tests/e2e/seo-settings.spec.ts b/tests/e2e/seo-settings.spec.ts index f5222921..9dfa2989 100644 --- a/tests/e2e/seo-settings.spec.ts +++ b/tests/e2e/seo-settings.spec.ts @@ -8,7 +8,7 @@ async function loginAndGoToSeoSettings(page) { await page.goto('/admin/login'); await page.getByLabel(/Email|E-Mail/i).fill(ADMIN_EMAIL); await page.getByLabel(/Password|Passwort/i).fill(ADMIN_PASSWORD); - await page.getByRole('button', { name: /Sign In|Log in|Anmelden/i }).click(); + await page.getByRole('button', { name: /^(Sign In|Log in|Anmelden)$/i }).click(); await expect(page.getByRole('heading', { name: /Dashboard|Übersicht/i })).toBeVisible({ timeout: 20000 }); await page.goto('/admin/settings');