Skip to content

Commit

Permalink
disable parallelism in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
swrdfish committed May 3, 2023
1 parent e3f6595 commit 2eedda5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
11 changes: 6 additions & 5 deletions lib/runner/cli/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,6 @@ class CliRunner {
this.argv.config = path.resolve(this.argv.config);
}

if (!this.argv.parallel && this.argv.debug && (this.argv.env === 'chrome' || Utils.isChrome(Settings.DEFAULTS.desiredCapabilities))) {
Logger.log(`\n ${Logger.colors.red('Nightwatch Inspector')} is not supported in parallel mode`);
this.argv.serial = true;
}

return require(this.argv.config);
}

Expand Down Expand Up @@ -394,6 +389,12 @@ class CliRunner {
return false;
}

if (this.argv.debug) {
Logger.info('Disabling parallelism while running in debug mode');

return false;
}

for (const env of this.testEnvArray) {
const {webdriver = {}} = this.testEnvSettings[env];
const desiredCapabilities = this.testEnvSettings[env].capabilities || this.testEnvSettings[env].desiredCapabilities;
Expand Down
2 changes: 1 addition & 1 deletion lib/settings/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class Settings {
get testWorkersEnabled() {
const {test_workers} = this.settings;

return this.argv.serial ? false : (this.argv.parallel || test_workers === true || (test_workers && test_workers.enabled && test_workers.workers !== 1));
return (this.argv.serial || this.argv.debug) ? false : (this.argv.parallel || test_workers === true || (test_workers && test_workers.enabled && test_workers.workers !== 1));
}

/**
Expand Down
1 change: 0 additions & 1 deletion test/src/cli/testCliRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,6 @@ describe('Test CLI Runner', function() {
}).setup();

assert.strictEqual(runner.argv.env, 'chrome');
assert.strictEqual(runner.argv.serial, true);
assert.strictEqual(runner.test_settings.parallel_mode, false);
assert.strictEqual(runner.test_settings.desiredCapabilities.browserName, 'chrome');
});
Expand Down

0 comments on commit 2eedda5

Please sign in to comment.