Skip to main content

TestStep

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

¥Represents a step in the [TestRun].


方法

¥Methods

titlePath

Added in: v1.10 testStep.titlePath

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

¥Returns a list of step titles from the root step down to this step.

用法

¥Usage

testStep.titlePath();

返回

¥Returns


属性

¥Properties

category

Added in: v1.10 testStep.category

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

¥Step category to differentiate steps with different origin and verbosity. Built-in categories are:

  • hook 用于夹具和钩子初始化和拆卸

    ¥hook for fixtures and hooks initialization and teardown

  • expect 用于期待调用

    ¥expect for expect calls

  • pw:api 用于 Playwright API 调用。

    ¥pw:api for Playwright API calls.

  • test.step 用于 test.step API 调用。

    ¥test.step for test.step API calls.

用法

¥Usage

testStep.category

类型

¥Type


duration

Added in: v1.10 testStep.duration

运行时间以毫秒为单位。

¥Running time in milliseconds.

用法

¥Usage

testStep.duration

类型

¥Type


error

Added in: v1.10 testStep.error

步骤执行期间抛出的错误(如果有)。

¥Error thrown during the step execution, if any.

用法

¥Usage

testStep.error

类型

¥Type


location

Added in: v1.10 testStep.location

源中定义步骤的可选位置。

¥Optional location in the source where the step is defined.

用法

¥Usage

testStep.location

类型

¥Type


parent

Added in: v1.10 testStep.parent

父步骤(如果有)。

¥Parent step, if any.

用法

¥Usage

testStep.parent

类型

¥Type


startTime

Added in: v1.10 testStep.startTime

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

¥Start time of this particular test step.

用法

¥Usage

testStep.startTime

类型

¥Type

  • [日期]

    ¥[Date]


steps

Added in: v1.10 testStep.steps

此步骤内的步骤列表。

¥List of steps inside this step.

用法

¥Usage

testStep.steps

类型

¥Type


title

Added in: v1.10 testStep.title

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

¥User-friendly test step title.

用法

¥Usage

testStep.title

类型

¥Type