TestStep
表示 [TestRun] 中的一个步骤。
- testStep.category
- testStep.duration
- testStep.error
- testStep.location
- testStep.parent
- testStep.startTime
- testStep.steps
- testStep.title
- testStep.titlePath()
testStep.titlePath()
Added in: v1.10返回从根步骤到此步骤的步骤标题列表。
testStep.category
Added in: v1.10- type: <string>
步骤类别,用于区分具有不同来源和详细程度的步骤。内置类别包括:
hook用于夹具(fixtures)和钩子(hooks)的初始化和拆卸expect用于 expect 调用pw:api用于 Playwright API 调用test.step用于 test.step API 调用
testStep.duration
Added in: v1.10- type: <number>
运行时间(以毫秒为单位)。
testStep.error
Added in: v1.10- type: <TestError>
步骤执行期间抛出的错误(如果有)。
testStep.location
Added in: v1.10- type: <Location>
定义步骤的源代码中的可选位置。
testStep.parent
Added in: v1.10- type: <TestStep>
父步骤(如果有)。
testStep.startTime
Added in: v1.10- type: <[Date]>
此特定测试步骤的开始时间。
testStep.steps
Added in: v1.10此步骤内的步骤列表。
testStep.title
Added in: v1.10- type: <string>
用户友好的测试步骤标题。