TestResult
Added in: v1.10A result of a single TestCase run.
Properties
testResult.annotations
Added in: v1.52The list of annotations applicable to the current test. Includes:
- annotations defined on the test or suite via
test.(call)()andtest.describe(); - annotations implicitly added by methods
test.skip(),test.fixme()andtest.fail(); - annotations appended to
testInfo.annotationsduring the test execution.
Annotations are available during test execution through testInfo.annotations.
Learn more about test annotations.
Type
Array<Object>
testResult.attachments
Added in: v1.10The list of files or buffers attached during the test execution through testInfo.attachments.
Type
Array<Object>
testResult.duration
Added in: v1.10Running time in milliseconds.
Type
float
testResult.error
Added in: v1.10First error thrown during test execution, if any. This is equal to the first element in testResult.errors.
Type
TestError
testResult.errors
Added in: v1.10Errors thrown during the test execution.
Type
Array<TestError>
testResult.parallelIndex
Added in: v1.30The index of the worker between 0 and workers - 1. It is guaranteed that workers running at the same time have a different parallelIndex.
Type
int
testResult.retry
Added in: v1.10When test is retried multiple times, each retry attempt is given a sequential number.
Learn more about test retries.
Type
int
testResult.startTime
Added in: v1.10Start time of this particular test run.
Type
Date
testResult.status
Added in: v1.10The status of this test result. See also testCase.expectedStatus.
Type
"passed" | "failed" | "timedOut" | "skipped" | "interrupted"
testResult.stderr
Added in: v1.10Anything written to the standard error during the test run.
Type
Array<string | Buffer>
testResult.stdout
Added in: v1.10Anything written to the standard output during the test run.
Type
Array<string | Buffer>
testResult.steps
Added in: v1.10List of steps inside this test run.
Type
Array<TestStep>
testResult.workerIndex
Added in: v1.10Index of the worker where the test was run. If the test was not run a single time, for example when the user interrupted testing, the only result will have a workerIndex equal to -1.
Learn more about parallelism and sharding with Playwright Test.
Type
int