TestStep
代表 [TestRun] 中的一个步骤。
🌐 Represents a step in the [TestRun].
方法
🌐 Methods
titlePath
Added in: v1.10返回从根步骤到此步骤的步骤标题列表。
🌐 Returns a list of step titles from the root step down to this step.
用法
testStep.titlePath();
返回
属性
🌐 Properties
annotations
Added in: v1.51适用于当前测试步骤的注释列表。
🌐 The list of annotations applicable to the current test step.
用法
testStep.annotations
类型
- [数组]<[对象]>
attachments
Added in: v1.50在步骤执行中通过 testInfo.attach() 附加的文件或缓冲区列表。
🌐 The list of files or buffers attached in the step execution through testInfo.attach().
用法
testStep.attachments
类型
- [数组]<[对象]>
category
Added in: v1.10步骤类别用于区分来源和详细程度不同的步骤。内置类别有:
🌐 Step category to differentiate steps with different origin and verbosity. Built-in categories are:
expect用于期望调用fixture用于夹具的设置和拆卸hook用于钩子的初始化和拆卸pw:api用于 Playwright API 调用。test.step用于 test.step API 调用。test.attach用于 testInfo.attach API 调用。
用法
testStep.category
类型
duration
Added in: v1.10运行时间以毫秒为单位。
🌐 Running time in milliseconds.
用法
testStep.duration
类型
error
Added in: v1.10步骤执行期间抛出的错误(如果有)。
🌐 Error thrown during the step execution, if any.
用法
testStep.error
类型
location
Added in: v1.10源中定义步骤的可选位置。
🌐 Optional location in the source where the step is defined.
用法
testStep.location
类型
parent
Added in: v1.10父步骤(如果有)。
🌐 Parent step, if any.
用法
testStep.parent
类型
startTime
Added in: v1.10此特定测试步骤的开始时间。
🌐 Start time of this particular test step.
用法
testStep.startTime
类型
steps
Added in: v1.10此步骤内的步骤列表。
🌐 List of steps inside this step.
用法
testStep.steps
类型
- [数组]<[测试步骤]>
title
Added in: v1.10用户友好的测试步骤标题。
🌐 User-friendly test step title.
用法
testStep.title
类型