CAT 1.7.0
Define tags for tests
Many users asked for possibility to execute only tests that have / do not have a specific tag. In this release we introduce support for this in CAT PowerShell module and in CAT CLI (support in the CAT Studio will follow).
When you are defining tests, you can add tags like this:
Tests:
- Name: Plane capacity check on table STAGE.DEPARTURES.
Test Suite: BusinessTests
Description: >
Plane cannot be overbooked i.e. there cannot be more passangers
on the departing flight than there is seats on a plane.
Data Source: AERO_PROD
Query: |
SELECT D.*
FROM STAGE.DEPARTURES D
JOIN STAGE.PLANES P ON P.PLANE_ID = D.PLANE_ID
WHERE P.PLANE_CAPACITY < D.PASSENGERS
Expectation: set is empty
Tags: Departures, Passengers
You can split tags by either a comma (recommended) or a semicolon - both works.
Execute tests with specific tags
The above mentioned was actually already working in previous releases. But now you can filter what tests from your project are executed, based on tags.
For CAT PowerShell module:
Invoke-CatProject -IncludeTag @("Departures", "Passengers")
# or simply
Invoke-CatProject -IncludeTag "Departures, Passengers"
If you specify more tags, CAT will evaluate all tests that have defined at least one of the provided tags.
In CAT CLI:
catcli run -i "Departures, Passengers"
Instead of -i
you can also use a long form, --includeTags
.
Execute tests without specific tags
Sometimes you do NOT want to execute tests with some tags. E.g., if you have some tests you don’t want to run in you pipelines, add them a tag ManualOnly. Then in Azure DevOps / GitLab / GitHub actions / Jenkins or wherever, just run:
For CAT PowerShell module:
Invoke-CatProject -ExcludeTag "ManualOnly"
For CAT CLI:
catcli run -e "ManualOnly"
That’s it :-). Happy testing.
CAT team