メインコンテンツにスキップ

TestResult

TestCase の単一実行の結果。


プロパティ

attachments

v1.10で追加 testResult.attachments

testInfo.attachments を介してテスト実行中に添付されたファイルまたはバッファのリスト。

使用法

testResult.attachments

  • Array<Object>
    • name string

      添付ファイル名。

    • contentType string

      レポートで適切に表示するための、この添付ファイルのコンテンツタイプ。例: 'application/json''image/png'

    • path string (任意)

      添付ファイルへのファイルシステム上のオプションのパス。

    • body Buffer (任意)

      ファイルの代わりに使用されるオプションの添付ファイルボディ。


duration

v1.10で追加 testResult.duration

ミリ秒単位の実行時間。

使用法

testResult.duration


error

v1.10で追加 testResult.error

テスト実行中にスローされた最初のエラー(もしあれば)。これは testResult.errors の最初の要素と同じです。

使用法

testResult.error


errors

v1.10で追加 testResult.errors

テスト実行中にスローされたエラー。

使用法

testResult.errors


parallelIndex

v1.30で追加 testResult.parallelIndex

0 から workers - 1 の間のワーカーのインデックス。同時に実行されているワーカーは異なる parallelIndex を持つことが保証されています。

使用法

testResult.parallelIndex


retry

v1.10で追加 testResult.retry

テストが複数回再試行される場合、各再試行試行には連番が与えられます。

テストの再試行 についてもっと学ぶ。

使用法

testResult.retry


startTime

v1.10で追加 testResult.startTime

この特定のテスト実行の開始時間。

使用法

testResult.startTime


status

v1.10で追加 testResult.status

このテスト結果のステータス。testCase.expectedStatus も参照してください。

使用法

testResult.status

  • "passed" | "failed" | "timedOut" | "skipped" | "interrupted"

stderr

v1.10で追加 testResult.stderr

テスト実行中に標準エラーに書き込まれたもの。

使用法

testResult.stderr


stdout

v1.10で追加 testResult.stdout

テスト実行中に標準出力に書き込まれたもの。

使用法

testResult.stdout


steps

v1.10で追加 testResult.steps

このテスト実行内のステップのリスト。

使用法

testResult.steps


workerIndex

v1.10で追加 testResult.workerIndex

テストが実行されたワーカーのインデックス。テストが一度も実行されなかった場合(たとえば、ユーザーがテストを中断した場合)、唯一の結果は workerIndex-1 に等しいものになります。

Playwright Testでの並列処理とシャーディング についてもっと学ぶ。

使用法

testResult.workerIndex