20 Creating Scenarios
This chapter details how to create scenarios to be tested and automated in Oracle Communications Solution Test Automation Platform.
There are two ways to create a scenario:
- Single File: Created for a simple scenario containing a smaller set of cases and steps. It is stored in a single .scenario file.
- Multi-Case File: Created for bigger scenarios containing complex
multi-product or end-to-end scenarios. The scenario is split into multiple
.case files and configured in the scenario.config configuration
file.
For more information on the scenario folder, see "Scenario".
Single File Scenario
Scenario:<<space>><Name of the E2E Scenario>
Description:<<space>><Description of the E2E Scenario>
<Description can be of multiple lines>
<<line space>>
<Description can have empty lines in between.>
<Entire text after Description: keyword till next keyword is considered as description>
Tags:<<space>><List of tags separated by ','>
Case:<<space>><Case Name> ====> Can have multiple cases in a scenario
Description:<<space>><<Case Description>>
Tags:<<space>><<List of tags separated by ','>
Given/When/Then/And<<space>><Step description>[<.|,|;><more step description>] ====> can have multiple steps in a case
Data:<<no text after this>>
| name | value |
| name | value |
Validate:<<no text after this>>
| name | value |
| name | value |
Save:<<no text after this>>
| Path | Variable |
Multi-Case Files Scenario
The following format shows how to create a multi-case file scenario:
- Header.info: Contains the scenario details in the following
format:
Scenario:<<space>><Name of the E2E Scenario> Description:<<space>><Description of the E2E Scenario> <Description can be of multiple lines> <<line space>> <Description can have empty lines in between.> <Entire text after Description: keyword till next keyword is considered as description> Tags:<<space>><List of tags separated by ','>
- Case files: Each .case file covers a specific logical
step in a scenario. This logical criteria may be for any product. Use the
following format when creating a case
file:
Case:<<space>><Case Name> ====> Can have only one case definition Description:<<space>><<Case Description>> Tags:<<space>><<List of tags separated by ','> Given/When/Then/And<<space>><Step description>[<.|,|;><more step description>] ====> can have multiple steps in a case Data:<<no text after this>> | name | value | | name | value | Validate:<<no text after this>> | name | value | | name | value | Save:<<no text after this>> | Path | Variable |
- scenario.config : Contains the list of files to be merged to
create the .scenario file at run time. Use the following format when
creating a scenario configuration
file:
#==================================================================== # Scenario Configuration File #===================================================================== # Merges the following scenario files in the specified order to run the scenario Header.info 1.Launch.case 2.Buying.case 3.fusionCDM.case 4.BRM.case 5.Care.case
Using Multiple Scenarios
Scenarios can be grouped to compile and run based on specific needs. This allows independent execution of groups, so the failure of one group does not halt the execution of others. This reduces the dependency of execution failures between independent scenarios.
Each group can be assigned a unique name and configured with a separate execution mode (serial or parallel). The execution mode dictates how the scenarios within a group are run.
To initiate a run, define at least one group entry. If multiple groups are not required, all scenarios can be listed under a single "group" keyword. You must define an execution.config.json file within the Scenarios folder to group scenarios.
{
name keyword : parameter //optional
description : parameter //optional
release : parameter //optional
milestone : parameter //optional
build : parameter //optional
level : parameter //optional
reportTitle : parameter //optional
execution keyword : parameter //optional
group keyword : [
{
<<group 1>>
name keyword : parameter //optional
execution keyword : parameter //optional
scenarios keyword : [
<<folder name>>,
<<folder name>>
]
},
{
<< group 2>>
name keyword : parameter //optional
execution keyword : parameter //optional
group keyword : [
{
<<subgroup 1>>
name keyword : parameter //optional
execution keyword : parameter //optional
scenarios keyword : [
<<folder name>>,
<<folder name>>
]
},
{
<<subgroup 2>>
name keyword : parameter //optional
execution keyword : parameter //optional
scenarios keyword : [
<<folder name>>,
<<folder name>>
]
}
]
}
]
}
- Execution (Optional): Execution can be configured as serial or parallel for each group or subgroup. This parameter is optional, and if not defined, groups will default to serial execution.
- Group: Groups are defined under the "group" keyword, and each group can contain subgroups or scenario folder entries. Each group has a unique name and its own execution mode. At least one "group" entry is required to define the scenario list.
- Name: Groups can be identified by user-entered names, and if no name is provided, a unique group ID is assigned.
- Scenarios:
- If multiple .scenario files exist in a single folder, only the first .scenario file is run. Each group contains a scenarios list, which specifies the parent folder names where .scenario or .scenario.config files reside.
- If .scenario files are located in nested folders, the parent folder names relative to the scenarios folder should be specified. Each group contains a scenarios list, which specifies the parent folder names where .scenario or .scenario.config files reside.
- If .scenario files are located in nested folders, the parent folder names relative to the scenarios folder should be specified. Optional fields include a description, release version, milestone, build, level, and report title. The default report title is Automation Report.
{
"execution" : "parallel",
"group" : [
{
"name" : "groupOne",
"execution" : "serial",
"scenarios" : [
"ToDo-E2E-Automation",
"ToDo-FunctionsAndOperators"
]
},
{
"name" : "groupTwo",
"execution" : "parallel",
"group" : [
{
"name" : "subGroupOne",
"execution" : "serial",
"scenarios" : [
"ToDo-E2E-Automation",
"ToDo-FunctionsAndOperators"
]
},
{
"name" : "subGroupTwo",
"execution" : "serial",
"scenarios" : [
"ToDo-E2E-Automation"
]
}
]
}
]
}