diff --git a/frontend/test/playwright/e2e/attribution.spec.ts b/frontend/test/playwright/e2e/attribution.spec.ts index bab45b33394..538de279a98 100644 --- a/frontend/test/playwright/e2e/attribution.spec.ts +++ b/frontend/test/playwright/e2e/attribution.spec.ts @@ -17,13 +17,16 @@ const copyAttribution = async ( ) => { const formatPattern = new RegExp(formatTitle[formatId], "i") + // Ensure the page is fully hydrated before interacting with it. + const copyButton = getCopyButton(page) + await expect(copyButton).toBeEnabled() + await page.getByRole("tab", { name: formatPattern }).click() await expect( page.getByRole("tabpanel", { name: formatPattern }) ).toBeVisible() - const copyButton = getCopyButton(page) await expect(copyButton).toHaveAttribute("id", `copyattr-${formatId}`) await copyButton.click()