diff --git a/apps/web/cypress/e2e/household-settings.feature b/apps/web/cypress/e2e/household-settings.feature index 6334a6f..d3bc168 100644 --- a/apps/web/cypress/e2e/household-settings.feature +++ b/apps/web/cypress/e2e/household-settings.feature @@ -61,6 +61,7 @@ Feature: Household settings And the household's enabled sources are empty And saving the source selection will succeed When I visit "/parametres/foyer" + And I scroll to the section "Sources disponibles" Then I should see the section "Sources disponibles" And I should see "TheMealDB" And I should see "Officielle" diff --git a/apps/web/cypress/support/step_definitions/common.steps.ts b/apps/web/cypress/support/step_definitions/common.steps.ts index b428189..86fd61a 100644 --- a/apps/web/cypress/support/step_definitions/common.steps.ts +++ b/apps/web/cypress/support/step_definitions/common.steps.ts @@ -125,6 +125,14 @@ Then("I should see the section {string}", (legend: string) => { cy.contains("legend", legend).should("be.visible"); }); +// Needed for a section that can render below the fold of `.app-content`'s +// own scroll (see layout.cy.ts) — a bare `.should("be.visible")` doesn't +// auto-scroll (only interaction commands like `.click()`/`.check()` do), +// so a section low on a long page needs this before asserting on it. +When("I scroll to the section {string}", (legend: string) => { + cy.contains("legend", legend).scrollIntoView(); +}); + Then("the checkbox {string} should be checked", (label: string) => { cy.contains("label", label).find("input[type=checkbox]").should("be.checked"); });