CAT 1.8.0
Parameterize tests easily
Users asked us to provide an efficient way to parametrize tests. In our fictious airport example, we might want to have separate Azure DevOps pipelines for each terminal. Or we may want to specify terminal number when we run the pipeline. So in tests against various data sources, we want to be able to do something like this:
# ... abbreviated
Query: |
SELECT COUNT(*) as NumberOfProlems
FROM Operation.SecurityCheck
WHERE Terminal = %TERMINAL_NUMBER%
AND ...... // abbreviated
Expectation: set is empty
Now it is possible, continue reading to learn how.
Thanks Tereza Černá, Tomáš Přibyl and Oli Thompson for suggesting this feature.
Environment variables support
You already had an option to use environment variables anywhere in CAT project file (.cat.yaml
). We also supported (and still support) environment variables replacement in data sources definitions, no matter from where you load them - other YAML files, MS Excel, database…
That was not the case for test definitions loaded from external sources - other YAML files, MS Excel, database… Now it is :-)
In our example, we can run all CAT tests like this:
$Env:TERMINAL_NUMBER = '1'; Invoke-CatProject;
This PowerShell syntax in this example creates/changes the environment variable just for one session. This is handy both for manual invokation of tests and for automation scenarios. Environment variables defined in the operating system or in Azure DevOps (or any other automation platform) work too.
See full documentation for more details, including tips for troubleshooting.
Documentation updates
We got a few suggestions to update our documentation, many of them are already implemented. Please keep contacting us whenever something is wrong or not clear.
That’s it :-). Happy testing.
CAT team