playwright/docs/src/test-reporter-api/class-teststep.md
Dmitry Gozman 4123a55be5
chore: generate more types (#13358)
As a result, fix documentation issues:
- Removed `TestStep.data` that is not a thing.
- Added `TestConfig.name` documentation.
- Refined a lot of optional types in the documentation.
- Aligned `test.fail()` and `test.slow()` docs with `test.skip()`.
- Strict set of docs vs types inconsistensies in the generator
2022-04-06 13:36:20 -07:00

1.1 KiB

class: TestStep

  • langs: js

Represents a step in the [TestRun].

property: TestStep.category

  • type: <[string]>

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.

property: TestStep.duration

  • type: <[float]>

Running time in milliseconds.

property: TestStep.location

  • type: <[Location]>

Optional location in the source where the step is defined.

property: TestStep.error

  • type: <[TestError]>

Optional error thrown during the step execution, if any.

property: TestStep.parent

  • type: <[TestStep]>

Optional parent step, if any.

property: TestStep.startTime

  • type: <[Date]>

Start time of this particular test step.

property: TestStep.steps

  • type: <[Array]<[TestStep]>>

List of steps inside this step.

property: TestStep.title

  • type: <[string]>

User-friendly test step title.

method: TestStep.titlePath

  • returns: <[Array]<[string]>>

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