# Scenarios
A scenario contains lines of instructions on what to do to achieve the desired action.
# List of scenarios
To view the list of scenarios in a feature, select the desired feature and the Scenarios pane would be shown with the list.
Each scenario list item shows:
- the unique ID of the scenario;
- the title of the scenario; and
- the number of lines of instructions in the scenario.
# Rearrange scenarios
When a feature or project is being tested with the runner, the scenarios are tested in order of listing. If the order needs to change, use to rearrange them.
Click to start rearranging.
Click on the desired scenario list item to move it up to the desired position. Then click to save the position or to cancel.
# Create a new scenario
To create a new scenario, click at the top right corner of the pane. Then fill out the scenario information on the shown page.
Select the desired gherkin scenario keyword from the dropdown and fill out the field(s) beside each to complete the line.
Delete any of the scenario lines by click on the left side of each line.
Duplicate any line by clicking .
Rearrange the lines by click on the left of each line to move the line up to the desired position.
# Scenario Lines
Each line of a scenario could either be an action to perform or a state to check.
Use the When
keyword to specify actions to perform and the Then
keyword for state checks.
Actions to perform must always come before state checks.
Where multiple When
s or Then
s are needed, use And
or But
keywords to join them as required.
# Scenario Options
Click on to the right of each scenario list item to view the options for the scenario.
# Edit a scenario
Click from the desired scenario's options and update the scenario information as desired in the form that is shown to the right.
# Delete a scenario
Click delete from the desired scenario's options and confirm deletion.
NOTE: Deleted scenarios CANNOT be retrieved.
# Other Options
- Copy ID: Copies the id of the scenario to the clipboard. This may be needed for the cli runner.
- Export as PDF: Exports the scenario to a PDF file that's downloaded automatically via your browser.
- Backup: Creates a zipped backup of the scenario in the background and sends an email to download the zip file when ready.
"Export as PDF" and "Backup" options are disabled if scenario doesn't contain any scenario.
# Import backup
Zip files created with the backup option above can be imported later. Use to import zip files.
An email will be sent once the scenario has been successfully imported. If there's an error while importing, an email would be sent to indicate this as well.
Note that only zip files containing proper backup files can be uploaded. It is therefore advised to only import zip files created with the backup option.