TestStep
Source URL: https://playwright.dev/docs/api/class-teststep
TestStep | Playwright
섹션 제목: “TestStep | Playwright”Represents a step in the [TestRun].
Methods
섹션 제목: “Methods”titlePath
섹션 제목: “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
섹션 제목: “Properties”annotations
섹션 제목: “annotations”Added in: v1.51 testStep.annotations
The list of annotations applicable to the current test step.
Usage
testStep.annotationsType
Annotation type, for example 'skip'.
* `description` [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "string") _(optional)_Optional description.
* `location` [Location](https://playwright.dev/docs/api/class-location "Location") _(optional)_Optional location in the source where the annotation is added.
attachments
섹션 제목: “attachments”Added in: v1.50 testStep.attachments
The list of files or buffers attached in the step execution through testInfo.attach().
Usage
testStep.attachmentsType
Attachment name.
* `contentType` [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "string")Content type of this attachment to properly present in the report, for example 'application/json' or 'image/png'.
* `path` [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "string") _(optional)_Optional path on the filesystem to the attached file.
* `body` [Buffer](https://nodejs.org/api/buffer.html#buffer_class_buffer "Buffer") _(optional)_Optional attachment body used instead of a file.
category
섹션 제목: “category”Added in: v1.10 testStep.category
Step category to differentiate steps with different origin and verbosity. Built-in categories are:
expectfor expect callsfixturefor fixtures setup and teardownhookfor hooks initialization and teardownpw:apifor Playwright API calls.test.stepfor test.step API calls.test.attachfor testInfo.attach API calls.
Usage
testStep.categoryType
duration
섹션 제목: “duration”Added in: v1.10 testStep.duration
Running time in milliseconds.
Usage
testStep.durationType
error
섹션 제목: “error”Added in: v1.10 testStep.error
Error thrown during the step execution, if any.
Usage
testStep.errorType
location
섹션 제목: “location”Added in: v1.10 testStep.location
Optional location in the source where the step is defined.
Usage
testStep.locationType
parent
섹션 제목: “parent”Added in: v1.10 testStep.parent
Parent step, if any.
Usage
testStep.parentType
startTime
섹션 제목: “startTime”Added in: v1.10 testStep.startTime
Start time of this particular test step.
Usage
testStep.startTimeType
steps
섹션 제목: “steps”Added in: v1.10 testStep.steps
List of steps inside this step.
Usage
testStep.stepsType
title
섹션 제목: “title”Added in: v1.10 testStep.title
User-friendly test step title.
Usage
testStep.titleType