TestStep.category property values
TestStep.category is a string property (since v1.10) that differentiates steps with different origin and verbosity. Built-in categories are: 'expect' for expect calls, 'fixture' for fixtures setup and teardown, 'hook' for hooks initialization and teardown, 'pw:api' for Playwright API calls, 'test.step' for test.step API calls, and 'test.attach' for testInfo.attach API calls.
TestStep.duration property
TestStep.duration is a float property (since v1.10) that represents the running time in milliseconds.
TestStep.location property
TestStep.location is an optional Location property (since v1.10) that represents the optional location in the source where the step is defined.
TestStep.error property
TestStep.error is an optional TestError property (since v1.10) that contains the error thrown during the step execution, if any.
TestStep.parent property
TestStep.parent is an optional TestStep property (since v1.10) that references the parent step, if any.
TestStep.params property
TestStep.params is an optional Object property with string keys and any values (since v1.63) that contains step-dependent parameters when available. For Playwright API calls, it contains the target locator and call arguments such as url. For test.step API calls, it contains the parameters passed by the test author. Playwright API calls only report a curated set of arguments per call, and long string values are truncated. Unbounded arguments such as page content, evaluated expressions or request bodies are never reported.
TestStep.params examples
Example params values: { locator: 'getByRole(\'button\')' } for click operations, { url: 'https://example.com' } for navigation, { locator: 'getByLabel(\'Password\')', value: 'secret' } for fill operations, and { orderId: 42 } for test.step calls with custom parameters.
TestStep.startTime property
TestStep.startTime is a Date property (since v1.10) that represents the start time of the particular test step.
TestStep.steps property
TestStep.steps is an Array of TestStep objects (since v1.10) that represents the list of steps inside this step.
TestStep.annotations property
TestStep.annotations is an Array property (since v1.51) that contains the list of annotations applicable to the current test step. Each annotation is an object with: type (string, required, for example 'skip'), description (string, optional), and location (Location, optional, in the source where the annotation is added).
TestStep.attachments property
TestStep.attachments is an Array property (since v1.50) that contains the list of files or buffers attached in the step execution through TestInfo.attach. Each attachment is an object with: name (string, required), contentType (string, required, for proper presentation in the report, for example 'application/json' or 'image/png'), path (string, optional, filesystem path to the attached file), and body (Buffer, optional, attachment body used instead of a file).
TestStep.title property
TestStep.title is a string property (since v1.10) that contains a user-friendly test step title, for example 'Click' or 'Navigate'.
TestStep.subtitle property
TestStep.subtitle is an optional string property (since v1.63) that contains a user-friendly test step subtitle that complements the title, when available. For Playwright API calls, it is the target locator or the navigation url. For example, a Click step has the clicked locator as a subtitle. test.step steps carry the subtitle passed by the test author. User interfaces typically render the subtitle next to the title or on a separate line.
TestStep.subtitle examples
Example subtitle values: 'getByRole(\'button\')' for a Click step, 'example.com/index.html' for a Navigate step, and 'SKU 42' for a custom test.step call.
TestStep.titlePath method
TestStep.titlePath is a method (since v1.10) that returns an Array of strings representing a list of step titles from the root step down to this step.
TestStep class definition
TestStep represents a step in a TestResult. It has been available since v1.10 in JavaScript.