Scenario Outline
A Scenario Outline
should always have an Examples
block, otherwise vitest-cucumber
will throw an error before running unit tests.
A Scenario Outline
example:
Run Scenario Outline
tests
When you run your tests, ScenarioOutline
is runned X times.
In this example, we have 3 value lines in Examples
.
So it will be runned 3 times and variables
contains each values:
pull-request | approves | |
---|---|---|
first run | feat: add awesome feature | Approves it |
second run | tests: add awesome feature unit tests | Approves it |
last run | big commit | Requests changes |
Currently variables
is of type any
and each value is of type string
.
If in your Examples
you have values like 1
, true
, null
, etc.
They will always be interpreted as string
.
Validation
Before running tests, vitest-cucumber checks if:
Scenario Outline
have anExamples
blockExamples
have at least one line for values- each
Examples
variable name is used at least one time in a scenario step
Synonym
Same thing if you use Scenario Template
and/or Scenarios
.