Get-CatTestResult
Returns the result of every test of the last run in this session — verdict, message, duration, the queries — as objects.
On this page
Synopsis
Get-CatTestResult
Parameters
None (common parameters only).
What it does
Writes the per-test results CAT kept from the last Invoke-CatProject / Invoke-CatTest in this session. Before any run it returns nothing; a new Open-CatProject discards the previous results.
Output
One list object of ITestOutput items (assign it to work with the items): TestResult (Passed, Failed, Error, Inconclusive), TestFullName, TestSuite, TestCase, TestName, Description, Message (the verdict’s explanation, including the sample of offending rows), RawMessage, ExceptionMessage, FirstDataSource, FirstQuery, SecondDataSource, SecondQuery, Expectation, NumberOfErrors, StartTime, EndTime, Duration, ThreadNumber, TestDefinition, TestDefinitionGuid.
Errors
There is no CAT session active… when no session exists.
Examples
Invoke-CatProject -Path 'D:\Testing\DwhTests.cat.yaml' -LoggingLevel None
$results = Get-CatTestResult
$results | Where-Object TestResult -ne 'Passed' | Select-Object TestResult, TestFullName, Message
# the failed tests as a CSV for someone else
$results | Where-Object TestResult -eq 'Failed' |
Select-Object TestFullName, Message, FirstQuery | Export-Csv failed.csv -NoTypeInformation
Related
- Introduction — session model, logging, errors, sign-in.
Get-CatTestResultSummary— the counts.- Outputs — the same results as files or tables, written by the run itself.