Étape 2 de l'expérimentation — un seul scénario minimal (remplir email/password sur l'écran de connexion) pour vérifier que addCucumberPreprocessorPlugin@22.2.0 + l'esbuild plugin fonctionnent de bout en bout, pas juste au chargement. Steps volontairement autonomes dans login-smoke.steps.ts (pas de fichier partagé) — tout ce fichier est prévu pour être supprimé une fois validé. cypress.config.ts : specPattern couvre maintenant *.cy.ts ET *.feature en parallèle (le reste de la suite reste en .cy.ts classique pour l'instant). Testé en local jusqu'au mur GPU/Electron habituel de cet environnement (chargement de la config + bundling esbuild passent, pas d'ERR_REQUIRE_ESM) — la vraie exécution du scénario reste à vérifier via la CI.
21 lines
746 B
TypeScript
21 lines
746 B
TypeScript
import { Given, Then, When } from "@badeball/cypress-cucumber-preprocessor";
|
|
|
|
// Throwaway smoke test — see login-smoke.feature. Steps are deliberately
|
|
// minimal/self-contained here rather than shared, since this whole file is
|
|
// meant to be deleted once it's proven the preprocessor works.
|
|
|
|
Given("I am not signed in", () => {
|
|
cy.intercept("GET", "**/auth/me", { statusCode: 401 });
|
|
});
|
|
|
|
When("I visit {string}", (path: string) => {
|
|
cy.visit(path);
|
|
});
|
|
|
|
When("I fill in the {string} field with {string}", (fieldId: string, value: string) => {
|
|
cy.get(`#${fieldId}`).type(value);
|
|
});
|
|
|
|
Then("the {string} field should have the value {string}", (fieldId: string, value: string) => {
|
|
cy.get(`#${fieldId}`).should("have.value", value);
|
|
});
|