如果存在測試失敗或錯誤,且已啟用螢幕截圖,則會在傳送 DELETE 之前擷取螢幕截圖。

若要為測試失敗/錯誤啟用螢幕截圖,請在您的 nightwatch.json 中,於所需的 test_settings 環境下設定 screenshots 屬性。例如:

nightwatch.json

{
  "test_settings" : {
    "default" : {
      "screenshots" : {
        "enabled" : true,
        "on_failure" : true,
        "path" : "./screens"
      }
    }
  }
}