Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow parallel envs with cucumber #4095

Merged
merged 4 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions lib/runner/cli/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ class CliRunner {

if (plugins.length > 0) {
plugins.forEach((plugin) => {
if (plugin.globals && Utils.isFunction(plugin.globals.registerEventHandlers)){
if (plugin.globals && Utils.isFunction(plugin.globals.registerEventHandlers)) {
plugin.globals.registerEventHandlers(NightwatchEventHub);
}
});
Expand Down Expand Up @@ -450,7 +450,11 @@ class CliRunner {
}

isTestWorkersEnabled() {
const testWorkers = this.test_settings.testWorkersEnabled && !singleSourceFile(this.argv);
if (this.testRunner.supportsParallelTestSuiteRun === false) {
return false;
}

const testWorkers = this.test_settings.testWorkersEnabled && !singleSourceFile(this.argv);
if (!testWorkers) {

if (this.argv.debug) {
Expand All @@ -466,7 +470,7 @@ class CliRunner {

if (isMobile(desiredCapabilities) && !this.usingServer(this.testEnvSettings[env])) {

if (Concurrency.isWorker()) {
if (Concurrency.isWorker()) {
Logger.info('Disabling parallelism while running tests on mobile platform');
}

Expand Down
4 changes: 4 additions & 0 deletions lib/runner/test-runners/cucumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ class CucumberSuite extends TestSuite {

class CucumberRunnner extends Runner {
get supportsConcurrency() {
return true;
}

get supportsParallelTestSuiteRun() {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ describe('Cucumber integration - parallel running single formatter', function()
parallel: true,
verbose: true,
timeout: 10,
env: 'chrome,firefox',
silent: false,
tags: ['not @fail'],
format: 'progress',
Expand Down
15 changes: 14 additions & 1 deletion test/extra/cucumber-config-parallel.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ module.exports = {
feature_path: path.join(__dirname, '../cucumber-integration-tests/sample_cucumber_tests/parallel/sample.feature')
}
},

test_settings: {
chrome: {
desiredCapabilities: {
browserName: 'chrome'
}
},
firefox: {
desiredCapabilities: {
browserName: 'firefox'
}
}
},
output: false,
silent: false
}
};
Loading