TestStep
Represents a step in the [TestRun].
Methodsâ
titlePathâ
Added in: v1.10Returns a list of step titles from the root step down to this step.
Usage
testStep.titlePath();
Returns
Propertiesâ
annotationsâ
Added in: v1.51The list of annotations applicable to the current test step.
Usage
testStep.annotations
Type
attachmentsâ
Added in: v1.50The list of files or buffers attached in the step execution through testInfo.attach().
Usage
testStep.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.
-
categoryâ
Added in: v1.10Step 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 test attachmen calls.
Usage
testStep.category
Type
durationâ
Added in: v1.10Running time in milliseconds.
Usage
testStep.duration
Type
errorâ
Added in: v1.10Error thrown during the step execution, if any.
Usage
testStep.error
Type
locationâ
Added in: v1.10Optional location in the source where the step is defined.
Usage
testStep.location
Type
parentâ
Added in: v1.10Parent step, if any.
Usage
testStep.parent
Type
startTimeâ
Added in: v1.10Start time of this particular test step.
Usage
testStep.startTime
Type
stepsâ
Added in: v1.10List of steps inside this step.
Usage
testStep.steps
Type
titleâ
Added in: v1.10User-friendly test step title.
Usage
testStep.title
Type