Skip to content

TestResult ​

Added in: v1.10

A result of a single TestCase run.

Properties ​

testResult.annotations ​

Added in: v1.52

The list of annotations applicable to the current test. Includes:

Annotations are available during test execution through testInfo.annotations.

Learn more about test annotations.

Type

  • Array<Object>

testResult.attachments ​

Added in: v1.10

The list of files or buffers attached during the test execution through testInfo.attachments.

Type

  • Array<Object>

testResult.duration ​

Added in: v1.10

Running time in milliseconds.

Type

  • float

testResult.error ​

Added in: v1.10

First error thrown during test execution, if any. This is equal to the first element in testResult.errors.

Type

  • TestError

testResult.errors ​

Added in: v1.10

Errors thrown during the test execution.

Type

  • Array<TestError>

testResult.parallelIndex ​

Added in: v1.30

The 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.10

When 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.10

Start time of this particular test run.

Type

  • Date

testResult.status ​

Added in: v1.10

The status of this test result. See also testCase.expectedStatus.

Type

  • "passed" | "failed" | "timedOut" | "skipped" | "interrupted"

testResult.stderr ​

Added in: v1.10

Anything written to the standard error during the test run.

Type

  • Array<string | Buffer>

testResult.stdout ​

Added in: v1.10

Anything written to the standard output during the test run.

Type

  • Array<string | Buffer>

testResult.steps ​

Added in: v1.10

List of steps inside this test run.

Type

  • Array<TestStep>

testResult.workerIndex ​

Added in: v1.10

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.

Learn more about parallelism and sharding with Playwright Test.

Type

  • int

Released under the Apache 2.0 License.