playwright / latest / api / class-teststep.html

TestStep

Represents a step in the [TestRun].

Methods​

titlePath​

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

Usage

testStep.titlePath();

Returns

Properties​

category​

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

  • hook for fixtures and hooks initialization and teardown
  • expect for expect calls
  • pw:api for Playwright API calls.
  • test.step for test.step API calls.

Usage

testStep.category

Type

duration​

Running time in milliseconds.

Usage

testStep.duration

Type

error​

Error thrown during the step execution, if any.

Usage

testStep.error

Type

location​

Optional location in the source where the step is defined.

Usage

testStep.location

Type

parent​

Parent step, if any.

Usage

testStep.parent

Type

startTime​

Start time of this particular test step.

Usage

testStep.startTime

Type

  • [Date]

steps​

List of steps inside this step.

Usage

testStep.steps

Type

title​

User-friendly test step title.

Usage

testStep.title

Type

© 2024 Microsoft
Licensed under the Apache License, Version 2.0.
https://playwright.dev/docs/api/class-teststep