From 9846472dded62b8ecb313df1edf27163262d7ece Mon Sep 17 00:00:00 2001 From: Benjamin Audren Date: Thu, 18 Apr 2019 15:30:43 +0200 Subject: [PATCH] Fix #15: restore screenshots on failed scenarios --- template/src/support/hooks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/src/support/hooks.js b/template/src/support/hooks.js index ec7fff7..a65a595 100644 --- a/template/src/support/hooks.js +++ b/template/src/support/hooks.js @@ -11,7 +11,7 @@ defineSupportCode(function ({ Before, After }) { }); After(function (scenario) { - if (scenario.status === 'failed') { + if (scenario.result.status === 'failed') { const errorDate = dateFormat(new Date(), 'yyyy-mm-dd-HHMMss'); return browser.saveScreenshot(`./output/errorShots/screenshot-error-${errorDate}.png`); }