Skip to content

Instantly share code, notes, and snippets.

@tsh-code
Last active April 10, 2019 14:08
Show Gist options
  • Save tsh-code/db39941daacbb0db4fee31588b80dc04 to your computer and use it in GitHub Desktop.
Save tsh-code/db39941daacbb0db4fee31588b80dc04 to your computer and use it in GitHub Desktop.
Configure browser capabilities
const browsersConfiguration = (config, commandArgs) => {
return async () => {
const browsersSettings = [];
const browserConfigs = getExtendedBrowsersConfigs(config, commandArgs);
const allSpecs = glob.sync(config.features.map(file => path.join(config.projectPath, file, '**/*.feature'))[0]);
const isParallel =
commandArgs.parallel !== undefined && Number.isInteger(commandArgs.parallel) && commandArgs.parallel !== 0;
const numberOfInstances = isParallel
? commandArgs.parallel >= allSpecs.length
? allSpecs.length
: commandArgs.parallel
: 1;
const expectedArrayLength = Math.ceil(allSpecs.length / numberOfInstances);
const chunkedSpecs = chunkSpecs(commandArgs, allSpecs, expectedArrayLength, numberOfInstances);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment