2021-07-22 19:56:36 -07:00
# class: TestResult
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-07-22 19:56:36 -07:00
* langs: js
A result of a single [TestCase] run.
## property: TestResult.attachments
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-07-22 19:56:36 -07:00
- type: < [Array]< [Object]>>
- `name` < [string]> Attachment name.
- `contentType` < [string]> Content type of this attachment to properly present in the report, for example `'application/json'` or `'image/png'` .
2022-04-06 19:02:10 -07:00
- `path` ?< [string]> Optional path on the filesystem to the attached file.
- `body` ?< [Buffer]> Optional attachment body used instead of a file.
2021-07-22 19:56:36 -07:00
The list of files or buffers attached during the test execution through [`property: TestInfo.attachments` ].
## property: TestResult.duration
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-07-22 19:56:36 -07:00
- type: < [float]>
Running time in milliseconds.
## property: TestResult.error
2022-07-05 16:24:50 -08:00
* since: v1.10
2022-04-06 19:02:10 -07:00
- type: ?< [TestError]>
2021-07-22 19:56:36 -07:00
2022-04-06 19:02:10 -07:00
First error thrown during test execution, if any. This is equal to the first
2022-02-02 19:33:51 -07:00
element in [`property: TestResult.errors` ].
## property: TestResult.errors
2022-07-05 16:24:50 -08:00
* since: v1.10
2022-02-02 19:33:51 -07:00
- type: < [Array]< [TestError]>>
Errors thrown during the test execution.
2021-07-22 19:56:36 -07:00
## property: TestResult.retry
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-07-22 19:56:36 -07:00
- type: < [int]>
When test is retries multiple times, each retry attempt is given a sequential number.
2022-03-25 19:30:45 +01:00
Learn more about [test retries ](../test-retries.md#retries ).
2021-07-22 19:56:36 -07:00
## property: TestResult.startTime
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-07-22 19:56:36 -07:00
- type: < [Date]>
Start time of this particular test run.
## property: TestResult.status
2022-07-05 16:24:50 -08:00
* since: v1.10
2022-08-02 12:55:43 -07:00
- type: < [TestStatus]< "passed"|"failed"|"timedOut"|"skipped"|"interrupted">>
2021-07-22 19:56:36 -07:00
The status of this test result. See also [`property: TestCase.expectedStatus` ].
## property: TestResult.stderr
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-07-22 19:56:36 -07:00
- type: < [Array]< [string]|[Buffer]>>
Anything written to the standard error during the test run.
## property: TestResult.stdout
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-07-22 19:56:36 -07:00
- type: < [Array]< [string]|[Buffer]>>
Anything written to the standard output during the test run.
2021-08-02 17:17:20 -07:00
## property: TestResult.steps
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-08-02 17:17:20 -07:00
- type: < [Array]< [TestStep]>>
List of steps inside this test run.
2021-07-22 19:56:36 -07:00
## property: TestResult.workerIndex
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-07-22 19:56:36 -07:00
- type: < [int]>
2022-04-08 15:23:23 -07:00
Index 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` .
2021-07-22 19:56:36 -07:00
2022-03-25 19:30:45 +01:00
Learn more about [parallelism and sharding ](../test-parallel.md ) with Playwright Test.