From 20ce52a562e6b8bb2bbac1b4670fea233032d8e5 Mon Sep 17 00:00:00 2001 From: Tom Calvo Date: Mon, 25 Jun 2018 15:40:20 +0200 Subject: [PATCH] added support to new promises --- xray-reporter.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/xray-reporter.js b/xray-reporter.js index 7fc9886..63661a9 100644 --- a/xray-reporter.js +++ b/xray-reporter.js @@ -61,7 +61,11 @@ const XrayReporter = (options, onPrepareDefer, onCompleteDefer, browser) => { browser.getProcessedConfig().then((config) => { result.info.summary = config.capabilities.name || 'no name'; - onPrepareDefer.fulfill(); + if(onPrepareDefer.resolve){ + onPrepareDefer.resolve(); + } else { + onPrepareDefer.fulfill(); + } }); let specPromises = []; @@ -188,7 +192,11 @@ const XrayReporter = (options, onPrepareDefer, onCompleteDefer, browser) => { }); } XrayService.createExecution(result, () => { - onCompleteDefer.fulfill(); + if(onCompleteDefer.resolve){ + onCompleteDefer.resolve(); + } else { + onCompleteDefer.fulfill(); + } }); }); };