Get Help

Get-CatTest

Returns the tests of the open project — every test CAT loaded and generated — as objects, without running anything.

Synopsis

Get-CatTest

Parameters

None (common parameters only).

What it does

Writes the tests CAT loaded when the project was opened: the ones written in the project file, the ones loaded from every test list, and the ones generated from metadata — in the order CAT loaded them. It is the way to see what a run would execute, and to pick test IDs for Invoke-CatTest -TestID.

Output

One List<TestDefinition> object (assign it, or wrap the call in parentheses, to work with the items). Each item has TestDefinitionID (the GUID -TestID takes — new on every open), Suite, Order, TestCase, Name, TestFullName ([Suite].[Order].[TestCase].[Name], absent parts omitted), Description, FirstDataSource, FirstQuery, SecondDataSource, SecondQuery, Expectation, ExpectedRowCount, Tolerance, Tags (string[]), Timeout, MaximumErrorsLogged, Metadata, TestListID, TestTemplateID, and the *Raw twins with the values as written.

Errors

There is no CAT project open. Use Open-CatProject to open it. when nothing is open.

Examples

Open-CatProject
$tests = Get-CatTest
$tests.Count
$tests | Where-Object Tags -contains 'ManualOnly' | Select-Object TestFullName

# run only the tests of one suite, by ID
$ids = ($tests | Where-Object Suite -eq 'Departures').TestDefinitionID
Invoke-CatTest -TestID $ids