diff --git a/docs/parallel.md b/docs/parallel.md index 7f5115afd..e4dd53f2e 100644 --- a/docs/parallel.md +++ b/docs/parallel.md @@ -74,7 +74,7 @@ const testGroups = workers.createGroupsOfSuites(2); const browsers = ['firefox', 'chrome']; const configs = browsers.map(browser => { - return helpers: { + return helpers: { WebDriver: { browser } } }); @@ -127,7 +127,7 @@ If you want your tests to split according to your need this method is suited for ```js /* - Define a function to split your tests, Here its hardcoded, But you write a logic to split your tests + Define a function to split your tests. function should return an array with this format [[file1, file2], [file3], ...] diff --git a/lib/workers.js b/lib/workers.js index f96050278..fe85aa95d 100644 --- a/lib/workers.js +++ b/lib/workers.js @@ -250,12 +250,10 @@ class Workers extends EventEmitter { * @param {Number} numberOfWorkers */ createGroupsOfSuites(numberOfWorkers) { - const files = this.codecept.testFiles; - const mocha = Container.mocha(); - mocha.files = files; - mocha.loadFiles(); const groups = populateGroups(numberOfWorkers); + const mocha = Container.mocha(); + mocha.suite.suites.forEach((suite) => { const i = indexOfSmallestElement(groups); suite.tests.forEach((test) => {