fix(web-tests): scroll to the sources section before asserting visibility

CI's e2e run confirmed the real cause: SourcesSection renders near the
bottom of /parametres/foyer (after name, invite code, members), inside
.app-content's own scrollable region — a bare `.should("be.visible")`
doesn't auto-scroll (only interaction commands like `.click()`/`.check()`
do), so the checkbox row was still clipped by that container's overflow
when the assertion ran. Adds a dedicated "I scroll to the section" step
and uses it before the sources-section assertions in household-settings.feature.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Nicolas 2026-08-20 13:56:42 +02:00
parent deec91c5a3
commit 4db2085826
2 changed files with 9 additions and 0 deletions

View file

@ -61,6 +61,7 @@ Feature: Household settings
And the household's enabled sources are empty And the household's enabled sources are empty
And saving the source selection will succeed And saving the source selection will succeed
When I visit "/parametres/foyer" When I visit "/parametres/foyer"
And I scroll to the section "Sources disponibles"
Then I should see the section "Sources disponibles" Then I should see the section "Sources disponibles"
And I should see "TheMealDB" And I should see "TheMealDB"
And I should see "Officielle" And I should see "Officielle"

View file

@ -125,6 +125,14 @@ Then("I should see the section {string}", (legend: string) => {
cy.contains("legend", legend).should("be.visible"); 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) => { Then("the checkbox {string} should be checked", (label: string) => {
cy.contains("label", label).find("input[type=checkbox]").should("be.checked"); cy.contains("label", label).find("input[type=checkbox]").should("be.checked");
}); });