Test Runners - ChrisMell/OEL-wiki GitHub Wiki
Test Runners and Their Configuration
Test runners are java unit test classes that connect other requisite components of the test framework together, to execute the test.
(displayed is a test runner that is configured to run the feature associated with the tag @53458.)
They are simple classes, located in the src/test/java directory, that the tester creates by entering the following tags:
@RunWith(CucumberWithSerenity.class) - informs the program of which version of cucumber to use.
@CucumberOptions() - contains the following information:
- tags - These pieces of text correspond to features and scenarios, in the feature file, that the test runner is specified to run.
- plugins - any plugins used in the framework
- gluecode - points to the folders within the project directory that contain the step definitions, used in the target test.
- feature - points to the folders within the project directory that contain the feature files, used in the target test.
There is a test runner for each iteration, the only difference in the files being the tags used. For example, the iteration 1 test runner uses the tag ‘@i1’.
More On Tags
Cucumber supports the use of tags to control which scenarios or feature files get run during an execution and which get ignored. Tags are located before the feature or scenario keywords in Gherkin (plain English/business language), and are indicated by the @ symbol before them, such as ‘@i1’ for example. Tags can be applied to both the entire feature and/or individual scenarios.
In this framework, each feature file can be grouped in only one iteration. Therefore, every feature is given a tag for the iteration that it was developed in that applies to the whole feature. Iteration 1 features all have the tag ‘@i1’ above the feature keyword.