File: class-teststep.md | Updated: 11/18/2025
On this page
Represents a step in the [TestRun].
Methods
Added in: v1.10 testStep.titlePath
Returns a list of step titles from the root step down to this step.
Usage
testStep.titlePath();
Returns
Properties
Added in: v1.51 testStep.annotations
The list of annotations applicable to the current test step.
Usage
testStep.annotations
Type
Added in: v1.50 testStep.attachments
The list of files or buffers attached in the step execution through testInfo.attach() .
Usage
testStep.attachments
Type
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.
Added in: v1.10 testStep.category
Step category to differentiate steps with different origin and verbosity. Built-in categories are:
expect for expect callsfixture for fixtures setup and teardownhook for hooks initialization and teardownpw:api for Playwright API calls.test.step for test.step API calls.test.attach for testInfo.attach API calls.Usage
testStep.category
Type
Added in: v1.10 testStep.duration
Running time in milliseconds.
Usage
testStep.duration
Type
Added in: v1.10 testStep.error
Error thrown during the step execution, if any.
Usage
testStep.error
Type
Added in: v1.10 testStep.location
Optional location in the source where the step is defined.
Usage
testStep.location
Type
Added in: v1.10 testStep.parent
Parent step, if any.
Usage
testStep.parent
Type
Added in: v1.10 testStep.startTime
Start time of this particular test step.
Usage
testStep.startTime
Type
Added in: v1.10 testStep.steps
List of steps inside this step.
Usage
testStep.steps
Type
Added in: v1.10 testStep.title
User-friendly test step title.
Usage
testStep.title
Type