TestResult
A result of a single TestCase run.
Properties
attachments
Added in: v1.10The list of files or buffers attached during the test execution through testInfo.attachments.
Usage
testResult.attachments
Type
- Array<Object>
-
name
stringAttachment name.
-
contentType
stringContent type of this attachment to properly present in the report, for example
'application/json'
or'image/png'
. -
path
string (optional)Optional path on the filesystem to the attached file.
-
body
Buffer (optional)Optional attachment body used instead of a file.
-
duration
Added in: v1.10Running time in milliseconds.
Usage
testResult.duration
Type
error
Added in: v1.10First error thrown during test execution, if any. This is equal to the first element in testResult.errors.
Usage
testResult.error
Type
errors
Added in: v1.10Errors thrown during the test execution.
Usage
testResult.errors
Type
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
.
Usage
testResult.parallelIndex
Type
retry
Added in: v1.10When test is retries multiple times, each retry attempt is given a sequential number.
Learn more about test retries.
Usage
testResult.retry
Type
startTime
Added in: v1.10Start time of this particular test run.
Usage
testResult.startTime
Type
- [Date]
status
Added in: v1.10The status of this test result. See also testCase.expectedStatus.
Usage
testResult.status
Type
- "passed" | "failed" | "timedOut" | "skipped" | "interrupted"
stderr
Added in: v1.10Anything written to the standard error during the test run.
Usage
testResult.stderr
Type
stdout
Added in: v1.10Anything written to the standard output during the test run.
Usage
testResult.stdout
Type
steps
Added in: v1.10List of steps inside this test run.
Usage
testResult.steps
Type
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.
Usage
testResult.workerIndex
Type