From 3b78582d29a6967fc1ff3d8482f22c17c5e3669c Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sat, 5 Sep 2026 11:00:47 +0200 Subject: [PATCH] =?UTF-8?q?test(recipe-form):=20corrige=20la=20visibilit?= =?UTF-8?q?=C3=A9=20flaky=20de=20l'=C3=A9tape=20d'ingr=C3=A9dient=20pr?= =?UTF-8?q?=C3=A9charg=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le step Gherkin partagé « the recipe should include the ingredient » utilisait un `.should("be.visible")` nu sur `.ingredient-row__name`. Sur le formulaire d'édition de recette, la liste d'ingrédients peut se trouver sous le pli du scroll propre à `.app-content` (Nom/Description/ Photo/Portions/Visibilité/Régimes viennent avant) — un `.should` seul ne scrolle pas automatiquement, contrairement aux commandes d'interaction (`.click()`/`.check()`). Repéré comme bug pré-existant et hors périmètre lors de la vérification de #29/#30 (voir la note dans tech-step-metadata-editor-redesign.md). Même correctif que « I should see the highlighted technique » (common.steps.ts) et « I should see the highlighted temperature » (recipes.ts) : `.scrollIntoView()` avant l'assertion. Reproduit avant correctif (recipe-form.feature, scénario « Preloads an existing recipe's ingredients when editing »: 4/5 puis 5/5 après le correctif). Suite e2e complète: 27/28 fichiers verts (la seule exception, admin-monitoring.cy.ts, est un flake distinct et sans rapport, signalé séparément). Co-Authored-By: Claude Sonnet 5 --- apps/web/cypress/support/step_definitions/common.steps.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/web/cypress/support/step_definitions/common.steps.ts b/apps/web/cypress/support/step_definitions/common.steps.ts index c74aac9..272a2ef 100644 --- a/apps/web/cypress/support/step_definitions/common.steps.ts +++ b/apps/web/cypress/support/step_definitions/common.steps.ts @@ -180,7 +180,12 @@ Then("the ingredient {string} should be visible in the picker", (name: string) = }); Then("the recipe should include the ingredient {string}", (name: string) => { - cy.contains(".ingredient-row__name", name).should("be.visible"); + // Same reasoning as "I should see the highlighted technique" above: on the + // recipe-edit form the ingredients list can sit below the fold of + // `.app-content`'s own scroll (Nom/Description/Photo/Portions/Visibilité/ + // Régimes all come first), and a bare `.should("be.visible")` doesn't + // auto-scroll — only interaction commands like `.click()`/`.check()` do. + cy.contains(".ingredient-row__name", name).scrollIntoView().should("be.visible"); }); Then("there should be {int} ingredient rows", (count: number) => {