TestResult
單次 TestCase 執行的結果。
屬性
attachments
新增於:v1.10在測試執行期間,透過 testInfo.attachments 附加的檔案或緩衝區清單。
用法
testResult.attachments
類型
duration
新增於:v1.10執行時間,以毫秒為單位。
用法
testResult.duration
類型
error
新增於:v1.10測試執行期間拋出的第一個錯誤(如果有的話)。這等於 testResult.errors 中的第一個元素。
用法
testResult.error
類型
errors
新增於:v1.10測試執行期間拋出的錯誤。
用法
testResult.errors
類型
parallelIndex
新增於:v1.30worker 的索引,介於 0
和 workers - 1
之間。保證同時運行的 worker 具有不同的 parallelIndex
。
用法
testResult.parallelIndex
類型
retry
新增於:v1.10當測試多次重試時,每次重試嘗試都會給予一個序號。
深入了解測試重試。
用法
testResult.retry
類型
startTime
新增於:v1.10此特定測試執行的開始時間。
用法
testResult.startTime
類型
status
新增於:v1.10此測試結果的狀態。另請參閱 testCase.expectedStatus。
用法
testResult.status
類型
- "passed" | "failed" | "timedOut" | "skipped" | "interrupted"
stderr
新增於:v1.10在測試執行期間寫入標準錯誤的任何內容。
用法
testResult.stderr
類型
stdout
新增於:v1.10在測試執行期間寫入標準輸出的任何內容。
用法
testResult.stdout
類型
steps
新增於:v1.10此測試執行內部的步驟清單。
用法
testResult.steps
類型
workerIndex
新增於:v1.10執行測試的 worker 的索引。如果測試不是單次執行(例如,當使用者中斷測試時),則唯一結果的 workerIndex
將等於 -1
。
深入了解 Playwright Test 的平行處理和分片。
用法
testResult.workerIndex
類型