Skip to content

Create users from table input (Cypress)

Example: Create users from table input: [email protected]

### ✅ Create users from table input: [email protected]
- **Given** the admin is on the create user page
- **When** the admin submits the following user details
**Details**
| email | role |
| --- | --- |
| [email protected] | user |
- **Then** the user "[email protected]" should exist with role "user"
import { story } from 'executable-stories-cypress';
const createUserExamples = [
{ email: "[email protected]", role: "user" },
{ email: "[email protected]", role: "admin" },
];
for (const row of createUserExamples) {
it(`Create users from table input: ${row.email}`, () => {
story.init();
story.given("the admin is on the create user page");
story.when("the admin submits the following user details");
story.table({
label: "Details",
columns: ["email", "role"],
rows: [[row.email, row.role]],
});
story.then(`the user "${row.email}" should exist with role "${row.role}"`);
});
}