Dataset testing runs a test plan in parallel with several datasets.
For example, we want to run the following test plan (saved in “finding-fastest-routes.feature”) in order to test :
- the fastest route to London
- the shortest route to Rome
Feature: Finding fastest routes
Scenario: no run : Finding routes to "Paris"
When I enter "Paris" into "Destination"
And I click on "Go"
Scenario: Finding the fastest route to "London"
When I find routes to "London"
And I select "Fastest route" in "Found routes"
We will create two datasets for the two cases.
For convenience, a dataset model for our test plan can be generate by executing the following command (described in “yascribe client command line“) :
java -jar yascribe-jcl.jar --gen-dataset finding-fastest-routes.feature
The generated dataset model is a .yaml
file named “finding-fastest-routes.dataset.xxx.yaml” :
scribe: "Finding fastest routes"
scenarios:
Finding the fastest route to "London":
variables:
London: "London"
Destination: "Destination"
Go: "Go"
Fastest route: "Fastest route"
Found routes: "Found routes"
Duplicate the datset model file to two new files :
- finding-fastest-routes.dataset.1.yaml
- finding-fastest-routes.dataset.2.yaml
Modify the second file by replacing :
- “London” by “Rome”
- “Fastest route” by “Shortest route”
scribe: "Finding fastest routes"
scenarios:
Finding the fastest route to "London":
variables:
London: "Rome"
Destination: "Destination"
Go: "Go"
Fastest route: "Shortest route"
Found routes: "Found routes"
Launch the test plan. The test plan will be run in parallel with the two datasets.