Login errors
Generate one scenario per error case from an array.
The test
Section titled “The test”import { story } from 'executable-stories-vitest';import { it } from 'vitest';
const loginErrorExamples = [];for (const row of loginErrorExamples) { it(`Login errors: ${row.message}`, ({ task }) => { story.init(task); story.given("the user is on the login page"); story.when(`the user logs in with "${row.email}" and "${row.password}"`); story.then(`the error message should be "${row.message}"`); });}import { story } from 'executable-stories-jest';
const loginErrorExamples = [];for (const row of loginErrorExamples) { it(`Login errors: ${row.message}`, () => { story.init(); story.given("the user is on the login page"); story.when(`the user logs in with "${row.email}" and "${row.password}"`); story.then(`the error message should be "${row.message}"`); });}import { test } from '@playwright/test';import { story } from 'executable-stories-playwright';
const loginErrorExamples = [];for (const row of loginErrorExamples) { test(`Login errors: ${row.message}`, async ({}, testInfo) => { story.init(testInfo); story.given("the user is on the login page"); story.when(`the user logs in with "${row.email}" and "${row.password}"`); story.then(`the error message should be "${row.message}"`); });}import { story } from 'executable-stories-cypress';
const loginErrorExamples = [];for (const row of loginErrorExamples) { it(`Login errors: ${row.message}`, () => { story.init(); story.given("the user is on the login page"); story.when(`the user logs in with "${row.email}" and "${row.password}"`); story.then(`the error message should be "${row.message}"`); });}What the report renders
Section titled “What the report renders”### ✅ Login errors: Account is locked
- **Given** the user is on the login page- **Then** the error message should be "Account is locked"