测试步骤
表示[TestRun]中的一个步骤。
方法
titlePath
Added in: v1.10返回从根步骤到当前步骤的所有步骤标题列表。
用法
testStep.titlePath();
返回
属性
注解
Added in: v1.51适用于当前测试步骤的注释列表。
用法
testStep.annotations
类型
附件
Added in: v1.50通过testInfo.attach()在步骤执行中附加的文件或缓冲区列表。
用法
testStep.attachments
类型
类别
Added in: v1.10步骤类别用于区分不同来源和详细程度的步骤。内置类别包括:
hook
用于夹具和钩子的初始化与拆卸expect
用于期望调用pw:api
用于Playwright API调用。test.step
用于 test.step API 调用。
用法
testStep.category
类型
持续时间
Added in: v1.10运行时间(毫秒)。
用法
testStep.duration
类型
错误
Added in: v1.10步骤执行期间抛出的错误(如果有的话)。
用法
testStep.error
类型
位置
Added in: v1.10步骤定义在源代码中的可选位置。
用法
testStep.location
类型
父级
Added in: v1.10父步骤(如果有的话)。
用法
testStep.parent
类型
开始时间
Added in: v1.10这个特定测试步骤的开始时间。
用法
testStep.startTime
类型
步骤
Added in: v1.10此步骤内的步骤列表。
用法
testStep.steps
类型
标题
Added in: v1.10用户友好的测试步骤标题。
用法
testStep.title
类型