Le vrai (et seul) problème du run précédent : "Step implementation
missing for 'I am not signed in'" — pas un souci ESM/CJS cette fois,
juste une convention de nommage. Le pattern stepDefinitions par défaut
du preprocessor cherche, pour cypress/e2e/login-smoke.feature :
- cypress/e2e/login-smoke/**/*.{js,mjs,ts,tsx}
- cypress/e2e/login-smoke.{js,mjs,ts,tsx} <- même basename, SANS ".steps"
- cypress/support/step_definitions/**/*.{js,mjs,ts,tsx}
`login-smoke.steps.ts` ne correspond à aucun des trois. Confirmé par
le message d'erreur lui-même (Cypress liste les 3 patterns essayés).
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);
|
|
});
|