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

TestStep

[TestRun] のステップを表します。


メソッド

titlePath

v1.10で追加 testStep.titlePath

ルートステップからこのステップまでのステップタイトルのリストを返します。

使用例

testStep.titlePath();

戻り値


プロパティ

annotations

v1.51で追加 testStep.annotations

現在のテストステップに適用可能なアノテーションのリスト。

使用例

testStep.annotations

  • Array<Object>
    • type string

      アノテーションの型。例えば 'skip' など。

    • description string (任意)

      任意の説明。


attachments

v1.50で追加 testStep.attachments

testInfo.attach() を通じてステップ実行に添付されたファイルまたはバッファのリスト。

使用例

testStep.attachments

  • Array<Object>
    • name string

      添付ファイル名。

    • contentType string

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

    • path string (任意)

      添付ファイルへのファイルシステム上の任意のパス。

    • body Buffer (任意)

      ファイルの代わりに使われる任意の添付ファイルボディ。


category

v1.10で追加 testStep.category

異なる起源と詳細度を持つステップを区別するためのステップカテゴリ。組み込みのカテゴリは以下の通りです。

  • フィクスチャとフックの初期化とティアダウンのための hook
  • expect呼び出しのための expect
  • Playwright API呼び出しのための pw:api
  • test.step API呼び出しのための test.step

使用例

testStep.category


duration

v1.10で追加 testStep.duration

ミリ秒単位の実行時間。

使用例

testStep.duration


error

v1.10で追加 testStep.error

ステップ実行中にスローされたエラー(もしあれば)。

使用例

testStep.error


location

v1.10で追加 testStep.location

ステップが定義されているソース内の任意の場所。

使用例

testStep.location


parent

v1.10で追加 testStep.parent

親ステップ(もしあれば)。

使用例

testStep.parent


startTime

v1.10で追加 testStep.startTime

この特定のテストステップの開始時間。

使用例

testStep.startTime


steps

v1.10で追加 testStep.steps

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

使用例

testStep.steps


title

v1.10で追加 testStep.title

ユーザーフレンドリーなテストステップタイトル。

使用例

testStep.title