Skip to content

Commit aa627e2

Browse files
Add another Gherkin example
1 parent 2e9f62c commit aa627e2

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

docs/api/commands/prompt.mdx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,35 @@ describe('Feature: User Status Management', () => {
423423
})
424424
```
425425

426+
#### Gherkin example 3: Admin manages user status
427+
428+
```javascript
429+
it('Scenario Outline: Admin manages user status', () => {
430+
cy.visit('/users')
431+
432+
const Examples = [
433+
{ status: 'pending', action: 'activates', new_status: 'active' },
434+
{ status: 'active', action: 'deactivates', new_status: 'inactive' },
435+
{ status: 'inactive', action: 'activates', new_status: 'active' }
436+
];
437+
438+
Examples.forEach(example => {
439+
cy.prompt([
440+
`Given there is a(n) ${example.status} user on the page`,
441+
`When the admin ${example.action} the user`,
442+
`Then the user status should change to ${example.new_status}`,
443+
])
444+
})
445+
})
446+
```
447+
448+
The commands in the generated code may look like:
449+
450+
<DocsImage
451+
src="/img/api/prompt/gherkin-example-cy-prompt-command-log.png"
452+
alt="Command log for Gherkin example 3"
453+
/>
454+
426455
### Login flow
427456

428457
```javascript
122 KB
Loading

0 commit comments

Comments
 (0)