18 Creating Scenarios
Learn how to create scenarios to be tested and automated in Oracle Communications Solution Test Automation Platform.
There are two ways to create a scenario:
- Using A Single Case File: For a simple scenario, you can create a
single .scenario file which contains the case details. The following format
shows how to create a .scenario file with a single
case:
Scenario: Name of the E2E Scenario Description: Description of the E2E Scenario Description can be of multiple lines> Tags: Tag1, Tag2 Case: Case Name Description: Case Description Tags: Tag1, Tag2 Given/When/Then/And Step description Data: | name | value | | name | value | Validate: | name | value | | name | value | Save: | Path | Variable | - Using Multiple Case Files: For larger scenarios containing
complex multi-product or end-to-end scenarios, you can split it into multiple
.case files, These are configured in the scenario.config
configuration file. To set up the case file, see "Case".
For more information on setting up the scenario folder, see "Scenarios Folder".
Case
A case represents a logical grouping of steps within a scenario. Cases allow you to modularize your automation scripts, improving readability, maintainability, and re-usability. Ideally, each case should focus on a single product or functionality within a broader scenario.
The file extension for a case is .case. You can break down your scenario into multiple case files under the scenario folder, ensuring easy distinction between functionalities and their test results.
Case: Case Name
Description: Case Description
Tags: Tag1, Tag2
Given/When/Then/And Step description
Data:
| name | value |
| name | value |
Validate:
| name | value |
| name | value |
Save:
| Path | Variable |If your scenario contains just one case, you do not create a separate .case file. Instead, you define the case within the .scenario file. For more information, see "Creating Scenarios".
You can use tags to categorize cases for easy identification and filtering based on various contexts like use case, feature, or functionality. For more information, see "Using Tags to Filter Components".
Note:
If any required global variable is missing, the setup case will fail.Step
A step is the fundamental building block of a case within the STAP automation framework. Each step represents a single action or verification within the overall case flow.
The step uses the BDD syntax of the Given-When-Then structure to clearly define the step's behavior within the context of the use case:
- Given: Defines the initial state or preconditions.
- When: Describes the action being performed.
- Then: Specifies the expected outcome or verification.
Complete the sentence after each keyword (Given, When, Then) with appropriate text following the comma, period, or semicolon.
Using Tags to Filter Components
Tags provide a mechanism for organizing, categorizing, and managing all automation components within STAP, including Scenarios, Cases, Steps, and Actions. You can plan and define a consistent set of tags before starting automation development.
You can filter Scenarios for execution based on specific tags. You can also select and run Cases within a Scenario using tags as criteria. Furthermore, you can generate automation execution configurations by filtering components based on tag criteria.
You might use the following information to set up tags:
- Product Name
- Feature Name
- Use Case ID/Name
- Release
- Test Type (for example, Functional, Regression, Performance)
- Priority (for example, High, Medium, Low)
- Customer
- Topology/Setup/Environment
- Group/Category