Skip to main content
Skip table of contents

Warning

3.3.8 Warning

説明

Warning - レポートに警告を挿入します。画像パラメータを使用して、特定のスクリーンショットに警告を関連付けることができます。関連付けられた警告は、レポート内の画像の説明の下に表示されます。関連付けられた画像がない場合、警告は単一のコンポーネントとしてレポートに表示されます。

スクリプトの実行中に、実行中のレポートプロバイダー(つまり、スクリプトに Report コマンドが含まれている)がある場合、警告コマンドを実行するとレポートの更新がトリガーされます。アクティブなレポートプロバイダーがない場合、内部テーブルに警告が作成されますが、レポートには表示されません。

SYNOPSIS

warning <description> [image=<screenshot_name>]

  • 赤色は必須パラメータです

オプション

description

-レポートに表示される警告のテキスト。

image=<スクリーンショット名>

-警告に関連付けられるスクリーンショット。スクリーンショット名は Screenshot コマンドを使用しています。

戻り値

Warningコマンドは常に0(ゼロ)を返します。

使用例

JS
Report index.html 
Exec "mozilla file://{_REPORT_FILE}" 
if ({_EXIT_CODE} > 0) {
  Warning "Mozilla failed to start. Error output: {_EXEC_ERROR}" 
}
  • Exec コマンドを使って Mozilla ブラウザで HTML レポートを開いてみて、失敗したら警告を追加してください。

JS
Screenshot image.jpg template=template1.png onfail="Warning \"The image image.jpg doesn't seem to display what is expected.\" image=image.jpg"
  • スクリーンショットを撮り、template1.png というテンプレートと比較してください。比較に失敗した場合は、画像の説明に警告を追加してください。

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.