Tags
Labeling test for targeted runs

Targetting Test with Tags

Let say I have now several features like the two examples below: my-first-feature.feature
1
@core
2
Feature: My Feature
3
As Autokin tester
4
I want to verify that all API are working as they should
5
6
Scenario: My First Scenario
7
Given that a secure endpoint is up at reqres.in
8
When I GET /api/users/2
Copied!
The above feature file we tag that as @core feature, while below we tag that as @fix-321 to denote that this is for the fix for 321 issue.
my-second-feature.feature
1
@fix-321
2
Feature: My Feature
3
As Autokin tester
4
I want to verify that all API are working as they should
5
6
Scenario: Verify if API does not accept character id
7
Given that a secure endpoint is up at reqres.in
8
When I GET /api/users/abc
Copied!
So now we want to run the test but only focus on running @fix-321. WE can do this by using the following command.
1
./node_modules/.bin/autokin -e -t @fix-321
Copied!
If we want to run only @core then we can use the following:
1
./node_modules/.bin/autokin -e -t @core
Copied!
If we are not passing the tags -t or --tags parameter, it will run everything.

Tags for exceptions

What if we want to run everything but not the @core, then we can also use the following command:
1
./node_modules/.bin/autokin -e -t "not @core"
Copied!