From 187db59b68481f4b49209b0824d14fdc51736728 Mon Sep 17 00:00:00 2001 From: Harshit Agrawal Date: Thu, 17 Aug 2023 16:16:26 +0530 Subject: [PATCH] capabilities issue fix (cherry picked from commit 323c3940b9a57a6c750bc1ffc168de1cca711c1a) --- .../test-runners/cucumber/_setup_cucumber_runner.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/runner/test-runners/cucumber/_setup_cucumber_runner.js b/lib/runner/test-runners/cucumber/_setup_cucumber_runner.js index 603a9bdac0..90c8842a5d 100644 --- a/lib/runner/test-runners/cucumber/_setup_cucumber_runner.js +++ b/lib/runner/test-runners/cucumber/_setup_cucumber_runner.js @@ -1,6 +1,6 @@ const Nightwatch = require('../../../index.js'); const {Before, After, setDefaultTimeout} = require('@cucumber/cucumber'); -const NightwatchFormat = require('./nightwatch-format.js'); +const NightwatchFormatter = require('./nightwatch-format.js'); setDefaultTimeout(-1); @@ -65,6 +65,12 @@ Before(function({pickle, testCaseStartedId}) { if (options.auto_start_session || typeof options.auto_start_session == 'undefined') { return this.client.launchBrowser().then(browser => { this.browser = browser; + }).catch(error => { + NightwatchFormatter.setCapabilities({ + error: error + }); + + throw error; }); } });