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