TestStep
代表 [TestRun] 中的一個步驟。
方法
titlePath
Added in: v1.10從根步驟到此步驟,返回步驟標題的列表。
用法
testStep.titlePath();
返回
屬性
attachments
Added in: v1.50步驟執行中透過 testInfo.attach() 附加的檔案或緩衝區列表。
用法
testStep.attachments
類型
category
Added in: v1.10步驟類別,用於區分不同來源和詳細程度的步驟。內建類別包括
hook
用於 fixture 和 hook 的初始化和拆卸expect
用於 expect 呼叫pw:api
用於 Playwright API 呼叫。test.step
用於 test.step API 呼叫。
用法
testStep.category
類型
duration
Added in: v1.10運行時間,以毫秒為單位。
用法
testStep.duration
類型
error
Added in: v1.10步驟執行期間拋出的錯誤(如果有的話)。
用法
testStep.error
類型
location
Added in: v1.10步驟定義在原始碼中的可選位置。
用法
testStep.location
類型
parent
Added in: v1.10父步驟(如果有的話)。
用法
testStep.parent
類型
startTime
Added in: v1.10此特定測試步驟的開始時間。
用法
testStep.startTime
類型
steps
Added in: v1.10此步驟內部的步驟列表。
用法
testStep.steps
類型
title
Added in: v1.10使用者友善的測試步驟標題。
用法
testStep.title
類型