From 72298dd76468c2694631c32cefafa510dacd84eb Mon Sep 17 00:00:00 2001 From: Binayak Ghosh Date: Tue, 16 May 2023 12:34:30 +0530 Subject: [PATCH] fix #3469 Manually apply commit: https://github.com/nightwatchjs/nightwatch/pull/3489/commits/25528ae349bc969e047f3d5e1183d0f95f9679e7 --- lib/core/treenode.js | 6 ++++++ lib/utils/debuggability.js | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/core/treenode.js b/lib/core/treenode.js index f81922368c..ce4f53c2f6 100644 --- a/lib/core/treenode.js +++ b/lib/core/treenode.js @@ -1,5 +1,6 @@ const EventEmitter = require('events'); const Utils = require('../utils'); +const Debuggability = require('../utils/debuggability.js'); class TreeNode { get command() { @@ -114,6 +115,11 @@ class TreeNode { handleError(err) { err.abortOnFailure = err.abortOnFailure || err.abortOnFailure === undefined; + + // Set abortOnFailure to false when command is being executed in debugMode + if (Debuggability.debugMode) { + err.abortOnFailure = false; + } let errorName = err.name !== 'Error' ? `[${err.name}] ` : ''; let originalError = `${errorName}${err.message}`; diff --git a/lib/utils/debuggability.js b/lib/utils/debuggability.js index 437f3455cf..909ee3c4d5 100644 --- a/lib/utils/debuggability.js +++ b/lib/utils/debuggability.js @@ -6,7 +6,15 @@ class Debuggability { static set stepOverAndPause(value) { this._stepOverAndPause = value; } - + + static get debugMode() { + return this._debugMode; + } + + static set debugMode(value) { + this._debugMode = value; + } + static reset() { this._stepOverAndPause = false; }