Skip to main content

TestResult

A result of a single TestCase run.


Properties​

annotations​

Added in: v1.52 testResult.annotations

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

Annotations are available during test execution through testInfo.annotations.

Learn more about test annotations.

Usage

testResult.annotations

Type

  • Array<Object>
    • type string

      Annotation type, for example 'skip' or 'fail'.

    • description string (optional)

      Optional description.

    • location Location (optional)

      Optional location in the source where the annotation is added.


attachments​

Added in: v1.10 testResult.attachments

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

Usage

testResult.attachments

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'.

    • 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.10 testResult.duration

Running time in milliseconds.

Usage

testResult.duration

Type


error​

Added in: v1.10 testResult.error

First 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.10 testResult.errors

Errors thrown during the test execution.

Usage

testResult.errors

Type


parallelIndex​

Added in: v1.30 testResult.parallelIndex

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

When test is retried multiple times, each retry attempt is given a sequential number.

Learn more about test retries.

Usage

testResult.retry

Type


startTime​

Added in: v1.10 testResult.startTime

Start time of this particular test run.

Usage

testResult.startTime

Type