diff --git a/e2e/public-content.test.ts b/e2e/public-content.test.ts index 50288b7..5fd2243 100644 --- a/e2e/public-content.test.ts +++ b/e2e/public-content.test.ts @@ -50,9 +50,13 @@ async function setRouteVisibility( // New users default to profile_visibility='private' (locked-account // model). Tests that need an anon visitor to see the profile in full // have to flip the owner to public first. +// +// The radio is targeted by name+value rather than getByLabel because +// the Private radio's help-text label happens to contain the word +// "public", which trips Playwright's strict-mode match. async function setProfileVisibilityPublic(page: Page) { await page.goto("/settings"); - await page.getByLabel("Public").check(); + await page.locator('input[type=radio][name=profileVisibility][value=public]').check(); await page.getByRole("button", { name: /^Save$/ }).first().click(); await page.waitForLoadState("networkidle"); } diff --git a/e2e/social.test.ts b/e2e/social.test.ts index 522c6be..dd0ca1b 100644 --- a/e2e/social.test.ts +++ b/e2e/social.test.ts @@ -28,11 +28,10 @@ async function registerUser(page: Page, email: string, username: string) { async function setProfileVisibility(page: Page, value: "public" | "private") { await page.goto("/settings"); - if (value === "public") { - await page.getByLabel("Public").check(); - } else { - await page.getByLabel(/Private/).check(); - } + // Target the radio by name+value; getByLabel collides because the + // help text of one radio mentions the other's word ("public" appears + // in the Private radio's helper sentence). + await page.locator(`input[type=radio][name=profileVisibility][value=${value}]`).check(); await page.getByRole("button", { name: /^Save$/ }).first().click(); await page.waitForLoadState("networkidle"); }