Skip to main content

TestStep

表示 [TestRun] 中的一个步骤。

testStep.titlePath()

Added in: v1.10

返回从根步骤到此步骤的步骤标题列表。

testStep.category

Added in: v1.10

步骤类别,用于区分具有不同来源和详细程度的步骤。内置类别包括:

  • hook 用于夹具(fixtures)和钩子(hooks)的初始化和拆卸
  • expect 用于 expect 调用
  • pw:api 用于 Playwright API 调用
  • test.step 用于 test.step API 调用

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
  • type: <[Date]>

此特定测试步骤的开始时间。

testStep.steps

Added in: v1.10

此步骤内的步骤列表。

testStep.title

Added in: v1.10

用户友好的测试步骤标题。