Skip to content

Commit fa70678

Browse files
committed
fix(e2e): use visible links instead of buttons in checkUrl hydration wait
DSFR breadcrumb buttons are hidden on desktop viewports, causing checkUrl to timeout waiting for a visible button. Use a:visible selector instead which reliably finds navigation links.
1 parent f7a7722 commit fa70678

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

packages/app/cypress/support/commands.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ Cypress.Commands.add("clickRadio", (legendText, radioLabel) => {
5555
Cypress.Commands.add("checkUrl", url => {
5656
cy.url().should("include", url);
5757
// Wait for Next.js hydration: #content must be visible and contain
58-
// at least one interactive element (link or button), which proves
59-
// React has mounted and attached event handlers.
58+
// at least one visible link, which proves React has mounted.
59+
// Note: we use "a:visible" instead of "a, button" because DSFR
60+
// breadcrumb buttons are hidden on desktop viewports.
6061
cy.get("#content", { timeout: 30000 }).should("be.visible");
61-
cy.get("#content").find("a, button", { timeout: 10000 }).first().should("be.visible");
62+
cy.get("#content").find("a:visible", { timeout: 10000 }).first().should("exist");
6263
cy.get("#content").click({ force: true });
6364
});
6465

0 commit comments

Comments
 (0)