Import users and send welcome email
One step carries a table, the next carries a code block.
The test
Section titled “The test”import { story } from 'executable-stories-vitest';import { it } from 'vitest';
it("Import users and send welcome email", ({ task }) => { story.init(task); story.given("the following users are to be imported"); story.table({ label: "Users", columns: ["email", "name"], rows: [ ], }); story.and("the email template is"); story.code({ label: "Template", content: `Welcome {{name}}!\nThanks for joining.`, }); story.when("the import job runs"); story.then("the users should exist"); story.then("welcome emails should be sent");});import { story } from 'executable-stories-jest';
it("Import users and send welcome email", () => { story.init(); story.given("the following users are to be imported"); story.table({ label: "Users", columns: ["email", "name"], rows: [ ], }); story.and("the email template is"); story.code({ label: "Template", content: `Welcome {{name}}!\nThanks for joining.`, }); story.when("the import job runs"); story.then("the users should exist"); story.then("welcome emails should be sent");});import { test } from '@playwright/test';import { story } from 'executable-stories-playwright';
test("Import users and send welcome email", async ({}, testInfo) => { story.init(testInfo); story.given("the following users are to be imported"); story.table({ label: "Users", columns: ["email", "name"], rows: [ ], }); story.and("the email template is"); story.code({ label: "Template", content: `Welcome {{name}}!\nThanks for joining.`, }); story.when("the import job runs"); story.then("the users should exist"); story.then("welcome emails should be sent");});import { story } from 'executable-stories-cypress';
it("Import users and send welcome email", () => { story.init(); story.given("the following users are to be imported"); story.table({ label: "Users", columns: ["email", "name"], rows: [ ], }); story.and("the email template is"); story.code({ label: "Template", content: `Welcome {{name}}!\nThanks for joining.`, }); story.when("the import job runs"); story.then("the users should exist"); story.then("welcome emails should be sent");});What the report renders
Section titled “What the report renders”### ✅ Import users and send welcome email
- **Given** the following users are to be imported **Users** | email | name | | --- | --- | | [email protected] | Alice | | [email protected] | Bob |- **And** the email template is **Template**Welcome {{name}}! Thanks for joining.
- **When** the import job runs- **Then** the users should exist- **And** welcome emails should be sent