Skip to content

Instantly share code, notes, and snippets.

@tsh-code
Last active Apr 10, 2019
Embed
What would you like to do?
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