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

Parallelize tests on test block level vs. file level #3962

Closed
nadvolod opened this issue May 10, 2019 · 29 comments
Closed

Parallelize tests on test block level vs. file level #3962

nadvolod opened this issue May 10, 2019 · 29 comments

Comments

@nadvolod
Copy link
Contributor

Is your feature request related to a problem? Please describe.
As our automation suites grow, we need to be able to run our tests in parallel since that's the most powerful mechanism to help with the constant growth of tests. The challenge that myself and other clients face is that we can only parallelize at the .js file level.

So for someone that wants to run in massive parallel, that's a really annoying problem to have. For example, if I would like to run 100 tests in parallel, that means that I need 100 JS files. This problem is magnified for larger clients that like to run several hundred tests in parallel. Although doable, it's not practical as then you are forced to create JS files for the sake of achieving parallelization. And then you end up doing weird things like breaking up your feature files into multiple .js files.

Describe the solution you'd like
I would like to be able to parallelize on every test method as opposed to a test file. Of course you can keep the parallelization on file level too. This way, I can have something like 10 files with 10 tests each and run all 100 in parallel.

Describe alternatives you've considered

  • Not using webdriverio and using other frameworks that provide this capability.
  • Having one .js file per test method

Additional context
Add any other context or screenshots about the feature request here.

@wswebcreation
Copy link
Member

@nadvolod

This is currently not possible with Mocha and Jasmine, we need to look into a new testrunner that might support this.

@nadvolod
Copy link
Contributor Author

Would be awesome if we find some option @wswebcreation 👍

@naddison
Copy link
Contributor

Yeah, this is a functionality you need at the framework level, but also the concept itself might not be compatible with WDIO. The WDIO Test Runner is built around running spec files each in their own process.

If you wanted it blocks in parallel from the framework inside the runner, each instance would then be spawning their own child processes.

@nadvolod
Copy link
Contributor Author

I'm pretty new to wdio and I like what it's doing 👍 . It also means I don't understand a lot. I come from a C# and Java background and in those languages, you can parallelize at the method level and you avoid having this problem at all. Furthermore, you avoid having a single driver session run multiple tests. Which is just harder to debug because now every session is a conglomeration of say 10 individual tests.

The only argument that I heard for this so far is that you save on the initialization of the driver time because now you will only need to start a driver for files. But that math doesn't really work out:

Current: 10 files x 10 tests each x 10s per test. However, you can only parallelize 10 max. Hence the total suite run time = 10 files x 10 iterations (one for each method) = 100sec

With method level parallelization: 10 files x 10 tests each x 20s per test ( assuming an extra 10 sec per test to start a browser). 100 tests in parallel = 20 sec
I achieve these numbers right now with my C# tests. We also have clients who do way more parallelization than that and at that scale, the problem of not being able to parallelize at the method level is only magnified.

We can continue to play with the numbers, but you can see how unlikely it is that wdio suites will ever run faster than a suite that can parallelize on every method. Parallelization is the most powerful way to scale suites, not optimization on test case run time (although this helps a little). Scale horizontally, not vertically. At least until we really reach our hardware capacities. From working with clients, I'd say that's more an exception as opposed to a rule.

Also, in the last 2 weeks, I've had about 5 clients complain to me about this limitation. I'll keep sending them here. Maybe if we get enough support, is this feature viable? Or is it out of the question?

Please let me know if I'm not getting something :) As I said, I'm still a neophyte.

@naddison
Copy link
Contributor

I totally agree it would be faster.

What I'm trying to say is that WDIO is effectively a framework on top of a framework. It's like if in C# you put something on top of nUnit or in Java you put something else on top of JUnit.

WDIO supports using different runners like Mocha, Jasmina, Chai and Cucumber underneath as the test runner portion. Most of these frameworks don't parallel execute by the it block. It is totally possible, it's just a matter of finding a framework that can run it blocks in parallel and then create an adapter for it that works with @wdio/runner.

But during the creation of the adapter we may find that the concept of running it block in parallel might not translate well and there is probably an incapability architecture within WDIO that would block us. But won't know until we try.

@mgrybyk
Copy link
Member

mgrybyk commented May 10, 2019

If there is some js test runner that supports block level parallelization wdio would be able to support it (I hope, or we'll force it, lol), if you are aware of such, let us know.
It might be one of WDIO next features one day.

@nadvolod
Copy link
Contributor Author

nadvolod commented May 10, 2019

@naddisson So you’re saying there’s hope haha :)
Yea, I get it. Probably a more complicated feature to implement as its in the wdio architecture. Fingers crossed

@CrispusDH
Copy link
Contributor

CrispusDH commented May 10, 2019

I use AVA test runner with wdio. Here my small demo project.

AVA runs tests concurrently, with a separate process for each test file and has parallelism inside file. It force you to write each test (it) independently and I'd like it.

@mgrybyk
Copy link
Member

mgrybyk commented May 10, 2019

@CrispusDH do you have plans adding AVA as a test framework to wdio?

@CrispusDH
Copy link
Contributor

@mgrybyk I was thinking about it several times but currently I don't have enough skill for that. I think it would be really nice.

@wswebcreation
Copy link
Member

@mgrybyk and @CrispusDH

Ava was also the library @christian-bromann was talking about a few weeks ago to do this kind of work.
Does anybody also know if this can be achieved with Jest? We also get a lot of questions to use Jest as a test framework for WebdriverIO

@wswebcreation
Copy link
Member

Hmm, just looked into this for Jest and it looks like Jest might be able to run tests inside a testfile concurrent with a limitation of X amount of tests per testfile, see also this thread

Maybe worth investigating

@christian-bromann
Copy link
Member

FYI: this landed on the roadmap (see #4057)

@christian-bromann christian-bromann changed the title Add ability to run test methods (it blocks) in parallel versus parallelizing on .js files Parallelize tests on test block level vs. file level Jun 27, 2019
@tulasirm
Copy link

Awesome it is going to be a good feature

@David-SanchezG
Copy link

Hey guys, what about cucumber? Isn't it doing it already? I have worked with a Protractor framework that uses cucumber and we had everything running in parallel at feature/test level using maxInstances and shardTestFiles capabilities

@mgrybyk
Copy link
Member

mgrybyk commented Aug 4, 2019

Every framework supported by wdio, including Cucumber, runs test files parallel, same as protractor.

With this PR we want to run spec test blocks in parallel, like it is done in ava

@David-SanchezG
Copy link

Is it possible already to run features in parallel using few mobile devices (I. E. android emulators), could you please tell me how?

@mgrybyk
Copy link
Member

mgrybyk commented Aug 4, 2019

Yes, it's possible, depending on your need configuration may differ, please use gitter for such questions, this is wrong place to discuss it.

You might need setup grid with multiple appium nodew attached to it, and run your tests in parallel then

@matthew-horrocks
Copy link

matthew-horrocks commented Feb 11, 2020

I've been investigating moving from a c# framework to wdio, and just found this bug as I couldn't work out how to run scenarios from within the same file in parallel.

I see the Roadmap Item tag was removed - how come?

Is there a work around for this bug?

Can I verify something? Our regression set is 3000 atomic tests and we have a grid server with 100 slots.

These 3000 scenarios are split into a number of different files, with the largest file containing 500 scenarios.

The regression suite runs and all other files finish running, but the file with 500 scenarios will continue running one test at a time, despite there being 99 free slots on the grid server?

That sounds bonkers! I must be misunderstanding something? (Not blaming wdio here, as it seems that wdio just calls Jasmine/ Mocha etc.. who should do the parallelisation)

@CrispusDH
Copy link
Contributor

I've been investigating moving from a c# framework to wdio, and just found this bug as I couldn't work out how to run scenarios from within the same file in parallel.

I see the Roadmap Item tag was removed - how come?

Is there a work around for this bug?

Can I verify something? Our regression set is 3000 atomic tests and we have a grid server with 100 slots.

These 3000 scenarios are split into a number of different files, with the largest file containing 500 scenarios.

The regression suite runs and all other files finish running, but the file with 500 scenarios will continue running one test at a time, despite there being 99 free slots on the grid server?

That sounds bonkers! I must be misunderstanding something? (Not blaming wdio here, as it seems that wdio just calls Jasmine/ Mocha etc.. who should do the parallelisation)

you can use AVA test runner with WDIO. In this case you will not have all "power" of WDIO config but your tests will be concurrent by test files and parallel by test inside file.

@christian-bromann
Copy link
Member

I see the Roadmap Item tag was removed - how come?

Because we changed the way how WebdriverIO manages its roadmap.

Is there a work around for this bug?

I don't think this is a "bug". It is more a limitation/requirement that you have (and some others).

That sounds bonkers!

That is bonkers. However WebdriverIO is not able to allocate other slots in your grid server just like that. It depends on how Cucumber is running the feature files.

There are ways to mitigate this and provide a test session on a per scenario or spec basis. This is a very desirable feature that we would love to implement. If you want to get involved, we appreciate any contribution in that direction. Right now WebdriverIO creates an instance per spec/feature file. I could see a scenario where we would introduce a new options (e.g. shardingLevel = 'block|file') which would control whether to spin up a session in @wdio/runner (if file level is selected) or within a framework hook (if block level is selected).

@christian-bromann
Copy link
Member

I implemented an initial POC here: https://github.com/webdriverio/webdriverio/tree/cb-sharding

The problem is that frameworks like Mocha, Jasmine and Cucumber run one spec/feature one at a time. Even with add-ons like mocha-parallel-test it will be difficult to manage session creation. It is worth looking into Ava or other frameworks that do this.

@seanpoulter
Copy link
Contributor

It is a bit out of the box, but it is possible to achieve the same outcome with Mocha and Jasmine by using tooling to splitting each spec into multiple specs. (Hat tip to Eric Elliot for the idea). I've managed to set that up in WebdriverIO using the onPrepare hook. When the hook runs, split the files, and update the config.spec(s?).

The code to code split is pretty short. Here's the gist of it without writing new files. You can likely improve the performance a bit too. https://gist.github.com/seanpoulter/33299b0d38bc81dfeb75c6370dbdcc56

Unfortunately I dropped this exploration because the majority of my day-to-day work has been using watch mode to write page objects. Since watch mode does not handle added or removed files very well, I shelved this.

@wswebcreation
Copy link
Member

wswebcreation commented Aug 18, 2020

Note: part 1/2

@seanpoulter

Thanks for the gist, it was really usefull. I took it a step further and change my config to this. This is really buggy code, but it was just for an initial POC

const {ConfigParser} = require('@wdio/config');
const {ensureFileSync, readFileSync, removeSync, writeFileSync} = require('fs-extra');
const {parseSync, transformFromAstSync} = require('@babel/core');
const {cloneDeep} = require('lodash');

exports.config = {
    // ====================
    // Runner Configuration
    // ====================
    runner: 'local',
    // ==================
    // Specify Test Files
    // ==================
    specs: [
        './test/specs/**/*.js',
        // './test/specs/login.spec.js'
    ],
    // ============
    // Capabilities
    // ============
    maxInstances: 100,
    // capabilities can be found in the `wdio.local.chrome.conf.js` or `wdio.sauce.conf.js`
    // ===================
    // Test Configurations
    // ===================
    logLevel: 'silent',
    bail: 0,
    baseUrl: 'https://www.saucedemo.com/',
    waitforTimeout: 10000,
    connectionRetryTimeout: 90000,
    connectionRetryCount: 3,
    framework: 'jasmine',
    reporters: ['spec'],
    jasmineNodeOpts: {
        defaultTimeoutInterval: 60000,
        helpers: [require.resolve('@babel/register')],
    },
    services: [],
    onPrepare: (config) => {
        const configParser = new ConfigParser();

        // Get the specs
        const specs = config.specs;
        const exclude = config.exclude;
        const currentSpecs = configParser.getSpecs(specs, exclude);

        // Make a copy of the original spec and empty the current one
        config.originalSpecs = config.specs;
        config.specs=[];

        // Now iterate over each spec and split it into single it's per file
        currentSpecs.forEach(spec => {
            const file = readFileSync(spec, 'utf8');
            // @TODO: this is crappy, but enough for an initial POC
            const singleDescribe = file.match(/(describe\()/g).length === 1;

            if (singleDescribe) {
                const ast = parseSync(file);
                const describeIndex = findDescribeIndex(ast);
                const itIndexes = findItIndex(ast.program.body[describeIndex]);

                // Now do the magic
                createSingleItFiles(ast, describeIndex, itIndexes, spec);
                // Push the new specs into the config
                itIndexes.forEach(currentItIndex => config.specs.push(`${spec}.${currentItIndex}.js`));
            } else {
                console.log(` WARNING, THIS SPEC FILE: ${spec}
 CONTAINS MULTIPLE DESCRIBES AND CAN NOT BE SPLIT!`
                );
                config.specs.push(spec);
            }
        });
    },

    onComplete: (exitCode, config)=>{
        // When done remove the files and clean up the config.specs
        config.specs.forEach(spec=> removeSync(spec));
        config.specs = config.originalSpecs;
        delete config.originalSpecs;
    }
};

/**
 * For the describes
 */
const isCallToDescribe = (node) =>
    node.type === 'ExpressionStatement'
    && node.expression.type === 'CallExpression'
    && node.expression.callee.type === 'Identifier'
    && node.expression.callee.name.toLowerCase() === 'describe';
const findDescribeIndex = (ast) =>
    ast.program.body.reduce((array, node, index) => isCallToDescribe(node) ? [...array, index] : array, []);

/**
 * For the it's
 */
const isCallToIt = (node) =>
    node.type === 'ExpressionStatement'
    && node.expression.type === 'CallExpression'
    && node.expression.callee.type === 'Identifier'
    && node.expression.callee.name.toLowerCase() === 'it';
const findItIndex = (body) =>
    body.expression.arguments[1].body.body.reduce((array, node, index) => isCallToIt(node) ? [...array, index] : array, []);


const createSingleItFiles = (ast, describeIndex, itIndexes, spec)=> {
    itIndexes.forEach((currentItIndex) => {
        const newAst = cloneDeep(ast);
        // Get the describe
        const describe = newAst.program.body[describeIndex];
        // First one is always the StringLiteral, second one the (Arrow)FunctionExpression
        const describeArgs = describe.expression.arguments[1].body.body;
        // Filter out the before/after-All/Each and the matching it so we get
        // one it with the current before/after-All/Each
        describe.expression.arguments[1].body.body = describeArgs.filter((arg, index) => {
            return index === currentItIndex || !itIndexes.includes(index);
        });

        const newCode = transformFromAstSync(newAst).code;
        ensureFileSync(`${spec}.${currentItIndex}.js`);
        writeFileSync(`${spec}.${currentItIndex}.js`, newCode);
    });
}

The outcome, I had 24 tests divided over 8 testfiles, when I run that (with the old config) I get this log

NOT running the tests in parallel per it

$ REGION=eu wdio test/configs/wdio.saucelabs.conf.js

Execution of 8 spec files started at 2020-08-18T15:49:22.537Z

[0-4] RUNNING in googlechrome - /test/specs/login.spec.js
[0-5] RUNNING in googlechrome - /test/specs/menu.spec.js
[0-1] RUNNING in googlechrome - /test/specs/checkout.complete.spec.js
[0-3] RUNNING in googlechrome - /test/specs/checkout.summary.spec.js
[0-0] RUNNING in googlechrome - /test/specs/cart.summary.spec.js
[0-6] RUNNING in googlechrome - /test/specs/swag.item.details.spec.js
[0-2] RUNNING in googlechrome - /test/specs/checkout.personal.info.spec.js
[0-7] RUNNING in googlechrome - /test/specs/swag.items.list.spec.js
[0-1] PASSED in googlechrome - /test/specs/checkout.complete.spec.js
[0-3] PASSED in googlechrome - /test/specs/checkout.summary.spec.js
[0-4] PASSED in googlechrome - /test/specs/login.spec.js
[0-0] PASSED in googlechrome - /test/specs/cart.summary.spec.js
[0-2] PASSED in googlechrome - /test/specs/checkout.personal.info.spec.js
[0-6] PASSED in googlechrome - /test/specs/swag.item.details.spec.js
[0-5] PASSED in googlechrome - /test/specs/menu.spec.js
[0-7] PASSED in googlechrome - /test/specs/swag.items.list.spec.js

 "spec" Reporter:
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-1] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/checkout.complete.spec.js
[chrome 84.0.4147.89 windows #0-1] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-1] Session ID: 50f43a36254e4e39a97874a7fdf71c59
[chrome 84.0.4147.89 windows #0-1]
[chrome 84.0.4147.89 windows #0-1] Checkout - Complete
[chrome 84.0.4147.89 windows #0-1]    ✓ should be able to test loading of login page
[chrome 84.0.4147.89 windows #0-1]
[chrome 84.0.4147.89 windows #0-1] 1 passing (1.9s)
[chrome 84.0.4147.89 windows #0-1]
[chrome 84.0.4147.89 windows #0-1] Check out job at https://app.eu-central-1.saucelabs.com/tests/50f43a36254e4e39a97874a7fdf71c59
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-3] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/checkout.summary.spec.js
[chrome 84.0.4147.89 windows #0-3] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-3] Session ID: 77eb3a3b4f984cf4aa3c6cc6d11dad31
[chrome 84.0.4147.89 windows #0-3]
[chrome 84.0.4147.89 windows #0-3] Checkout - Summary
[chrome 84.0.4147.89 windows #0-3]    ✓ should validate that we can continue shopping
[chrome 84.0.4147.89 windows #0-3]    ✓ should validate that we can cancel checkout and go to the inventory page
[chrome 84.0.4147.89 windows #0-3]    ✓ should validate that we have 1 product in our checkout overview
[chrome 84.0.4147.89 windows #0-3]
[chrome 84.0.4147.89 windows #0-3] 3 passing (5.1s)
[chrome 84.0.4147.89 windows #0-3]
[chrome 84.0.4147.89 windows #0-3] Check out job at https://app.eu-central-1.saucelabs.com/tests/77eb3a3b4f984cf4aa3c6cc6d11dad31
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-4] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/login.spec.js
[chrome 84.0.4147.89 windows #0-4] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-4] Session ID: 71ead8baed45418cacc16ba3b1bd0525
[chrome 84.0.4147.89 windows #0-4]
[chrome 84.0.4147.89 windows #0-4] LoginPage
[chrome 84.0.4147.89 windows #0-4]    ✓ should be able to test loading of login page
[chrome 84.0.4147.89 windows #0-4]    ✓ should be able to login with a standard user
[chrome 84.0.4147.89 windows #0-4]    ✓ should not be able to login with a locked user
[chrome 84.0.4147.89 windows #0-4]
[chrome 84.0.4147.89 windows #0-4] 3 passing (6.2s)
[chrome 84.0.4147.89 windows #0-4]
[chrome 84.0.4147.89 windows #0-4] Check out job at https://app.eu-central-1.saucelabs.com/tests/71ead8baed45418cacc16ba3b1bd0525
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-0] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/cart.summary.spec.js
[chrome 84.0.4147.89 windows #0-0] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-0] Session ID: 954aea797d6c41ed9940603ddd203401
[chrome 84.0.4147.89 windows #0-0]
[chrome 84.0.4147.89 windows #0-0] Cart Summary page
[chrome 84.0.4147.89 windows #0-0]    ✓ should validate that we can continue shopping
[chrome 84.0.4147.89 windows #0-0]    ✓ should validate that we can go from the cart to the checkout page
[chrome 84.0.4147.89 windows #0-0]    ✓ should validate that a product can be removed from the cart
[chrome 84.0.4147.89 windows #0-0]
[chrome 84.0.4147.89 windows #0-0] 3 passing (6.4s)
[chrome 84.0.4147.89 windows #0-0]
[chrome 84.0.4147.89 windows #0-0] Check out job at https://app.eu-central-1.saucelabs.com/tests/954aea797d6c41ed9940603ddd203401
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-2] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/checkout.personal.info.spec.js
[chrome 84.0.4147.89 windows #0-2] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-2] Session ID: 4383e47677cf42f583b7bd6c24fcc062
[chrome 84.0.4147.89 windows #0-2]
[chrome 84.0.4147.89 windows #0-2] Checkout - Personal info
[chrome 84.0.4147.89 windows #0-2]    ✓ should validate we get an error if we don not provide all personal information
[chrome 84.0.4147.89 windows #0-2]    ✓ should validate that we can cancel the first checkout
[chrome 84.0.4147.89 windows #0-2]    ✓ should be able to continue the checkout
[chrome 84.0.4147.89 windows #0-2]
[chrome 84.0.4147.89 windows #0-2] 3 passing (7.8s)
[chrome 84.0.4147.89 windows #0-2]
[chrome 84.0.4147.89 windows #0-2] Check out job at https://app.eu-central-1.saucelabs.com/tests/4383e47677cf42f583b7bd6c24fcc062
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-6] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/swag.item.details.spec.js
[chrome 84.0.4147.89 windows #0-6] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-6] Session ID: 72d7e54f9ca14846956d0eb92101cb60
[chrome 84.0.4147.89 windows #0-6]
[chrome 84.0.4147.89 windows #0-6] Swag Item Details
[chrome 84.0.4147.89 windows #0-6]    ✓ should validate that we can go back from the details to the inventory page
[chrome 84.0.4147.89 windows #0-6]    ✓ should validate that a product can be added to a cart
[chrome 84.0.4147.89 windows #0-6]    ✓ should validate that a product can be removed from the cart
[chrome 84.0.4147.89 windows #0-6]
[chrome 84.0.4147.89 windows #0-6] 3 passing (8.7s)
[chrome 84.0.4147.89 windows #0-6]
[chrome 84.0.4147.89 windows #0-6] Check out job at https://app.eu-central-1.saucelabs.com/tests/72d7e54f9ca14846956d0eb92101cb60
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-5] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/menu.spec.js
[chrome 84.0.4147.89 windows #0-5] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-5] Session ID: 18521a46ec4748b6b1fd7c4180d480db
[chrome 84.0.4147.89 windows #0-5]
[chrome 84.0.4147.89 windows #0-5] Menu
[chrome 84.0.4147.89 windows #0-5]    ✓ should be able to the swag items overview page
[chrome 84.0.4147.89 windows #0-5]    ✓ should be able to log out
[chrome 84.0.4147.89 windows #0-5]    ✓ should be able to clear the cart
[chrome 84.0.4147.89 windows #0-5]
[chrome 84.0.4147.89 windows #0-5] 3 passing (9.7s)
[chrome 84.0.4147.89 windows #0-5]
[chrome 84.0.4147.89 windows #0-5] Check out job at https://app.eu-central-1.saucelabs.com/tests/18521a46ec4748b6b1fd7c4180d480db
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-7] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/swag.items.list.spec.js
[chrome 84.0.4147.89 windows #0-7] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-7] Session ID: b0ae2d8ad5c542399105ad1d9bc79d56
[chrome 84.0.4147.89 windows #0-7]
[chrome 84.0.4147.89 windows #0-7] Swag items list
[chrome 84.0.4147.89 windows #0-7]    ✓ should validate that all products are present
[chrome 84.0.4147.89 windows #0-7]    ✓ should validate that the details of a product can be opened
[chrome 84.0.4147.89 windows #0-7]    ✓ should validate that a product can be added to the cart
[chrome 84.0.4147.89 windows #0-7]    ✓ should validate that a product can be removed from the cart
[chrome 84.0.4147.89 windows #0-7]    ✓ should be able to open the cart summary page
[chrome 84.0.4147.89 windows #0-7]
[chrome 84.0.4147.89 windows #0-7] 5 passing (10.9s)
[chrome 84.0.4147.89 windows #0-7]
[chrome 84.0.4147.89 windows #0-7] Check out job at https://app.eu-central-1.saucelabs.com/tests/b0ae2d8ad5c542399105ad1d9bc79d56


Spec Files:      8 passed, 8 total (100% completed) in 00:00:21 

✨  Done in 22.80s.

After implementing the new onPrepare and onComplete hook I was able to run 24 single spec files, see the logs below

With single it's per spec file

$ REGION=eu wdio test/configs/wdio.saucelabs.conf.js

Execution of 8 spec files started at 2020-08-18T15:48:17.842Z

[0-8] RUNNING in googlechrome - /test/specs/checkout.summary.spec.js.2.js
[0-3] RUNNING in googlechrome - /test/specs/checkout.complete.spec.js.0.js
[0-1] RUNNING in googlechrome - /test/specs/cart.summary.spec.js.1.js
[0-7] RUNNING in googlechrome - /test/specs/checkout.summary.spec.js.1.js
[0-10] RUNNING in googlechrome - /test/specs/login.spec.js.1.js
[0-6] RUNNING in googlechrome - /test/specs/checkout.personal.info.spec.js.3.js
[0-0] RUNNING in googlechrome - /test/specs/cart.summary.spec.js.0.js
[0-2] RUNNING in googlechrome - /test/specs/cart.summary.spec.js.2.js
[0-4] RUNNING in googlechrome - /test/specs/checkout.personal.info.spec.js.1.js
[0-9] RUNNING in googlechrome - /test/specs/checkout.summary.spec.js.3.js
[0-12] RUNNING in googlechrome - /test/specs/login.spec.js.3.js
[0-14] RUNNING in googlechrome - /test/specs/menu.spec.js.3.js
[0-16] RUNNING in googlechrome - /test/specs/swag.item.details.spec.js.0.js
[0-5] RUNNING in googlechrome - /test/specs/checkout.personal.info.spec.js.2.js
[0-15] RUNNING in googlechrome - /test/specs/menu.spec.js.4.js
[0-11] RUNNING in googlechrome - /test/specs/login.spec.js.2.js
[0-19] RUNNING in googlechrome - /test/specs/swag.items.list.spec.js.0.js
[0-13] RUNNING in googlechrome - /test/specs/menu.spec.js.1.js
[0-17] RUNNING in googlechrome - /test/specs/swag.item.details.spec.js.1.js
[0-18] RUNNING in googlechrome - /test/specs/swag.item.details.spec.js.2.js
[0-20] RUNNING in googlechrome - /test/specs/swag.items.list.spec.js.1.js
[0-21] RUNNING in googlechrome - /test/specs/swag.items.list.spec.js.2.js
[0-22] RUNNING in googlechrome - /test/specs/swag.items.list.spec.js.3.js
[0-23] RUNNING in googlechrome - /test/specs/swag.items.list.spec.js.4.js
[0-10] PASSED in googlechrome - /test/specs/login.spec.js.1.js
[0-7] PASSED in googlechrome - /test/specs/checkout.summary.spec.js.1.js
[0-19] PASSED in googlechrome - /test/specs/swag.items.list.spec.js.0.js
[0-9] PASSED in googlechrome - /test/specs/checkout.summary.spec.js.3.js
[0-1] PASSED in googlechrome - /test/specs/cart.summary.spec.js.1.js
[0-3] PASSED in googlechrome - /test/specs/checkout.complete.spec.js.0.js
[0-0] PASSED in googlechrome - /test/specs/cart.summary.spec.js.0.js
[0-23] PASSED in googlechrome - /test/specs/swag.items.list.spec.js.4.js
[0-20] PASSED in googlechrome - /test/specs/swag.items.list.spec.js.1.js
[0-13] PASSED in googlechrome - /test/specs/menu.spec.js.1.js
[0-22] PASSED in googlechrome - /test/specs/swag.items.list.spec.js.3.js
[0-16] PASSED in googlechrome - /test/specs/swag.item.details.spec.js.0.js
[0-5] PASSED in googlechrome - /test/specs/checkout.personal.info.spec.js.2.js
[0-4] PASSED in googlechrome - /test/specs/checkout.personal.info.spec.js.1.js
[0-11] PASSED in googlechrome - /test/specs/login.spec.js.2.js
[0-18] PASSED in googlechrome - /test/specs/swag.item.details.spec.js.2.js
[0-6] PASSED in googlechrome - /test/specs/checkout.personal.info.spec.js.3.js
[0-17] PASSED in googlechrome - /test/specs/swag.item.details.spec.js.1.js
[0-2] PASSED in googlechrome - /test/specs/cart.summary.spec.js.2.js
[0-15] PASSED in googlechrome - /test/specs/menu.spec.js.4.js
[0-8] PASSED in googlechrome - /test/specs/checkout.summary.spec.js.2.js
[0-14] PASSED in googlechrome - /test/specs/menu.spec.js.3.js
[0-21] PASSED in googlechrome - /test/specs/swag.items.list.spec.js.2.js
[0-12] PASSED in googlechrome - /test/specs/login.spec.js.3.js

 "spec" Reporter:
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-10] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/login.spec.js.1.js
[chrome 84.0.4147.89 windows #0-10] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-10] Session ID: 53be3baccf5d415a9a779deac935c289
[chrome 84.0.4147.89 windows #0-10]
[chrome 84.0.4147.89 windows #0-10] LoginPage
[chrome 84.0.4147.89 windows #0-10]    ✓ should be able to test loading of login page
[chrome 84.0.4147.89 windows #0-10]
[chrome 84.0.4147.89 windows #0-10] 1 passing (1.3s)
[chrome 84.0.4147.89 windows #0-10]
[chrome 84.0.4147.89 windows #0-10] Check out job at https://app.eu-central-1.saucelabs.com/tests/53be3baccf5d415a9a779deac935c289
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-7] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/checkout.summary.spec.js.1.js
[chrome 84.0.4147.89 windows #0-7] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-7] Session ID: cad3632e8c0e4256b6e4b9881097557c
[chrome 84.0.4147.89 windows #0-7]
[chrome 84.0.4147.89 windows #0-7] Checkout - Summary
[chrome 84.0.4147.89 windows #0-7]    ✓ should validate that we can continue shopping
[chrome 84.0.4147.89 windows #0-7]
[chrome 84.0.4147.89 windows #0-7] 1 passing (2.2s)
[chrome 84.0.4147.89 windows #0-7]
[chrome 84.0.4147.89 windows #0-7] Check out job at https://app.eu-central-1.saucelabs.com/tests/cad3632e8c0e4256b6e4b9881097557c
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-19] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/swag.items.list.spec.js.0.js
[chrome 84.0.4147.89 windows #0-19] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-19] Session ID: 69145e3d3f654de0a9aea7ddda763133
[chrome 84.0.4147.89 windows #0-19]
[chrome 84.0.4147.89 windows #0-19] Swag items list
[chrome 84.0.4147.89 windows #0-19]    ✓ should validate that all products are present
[chrome 84.0.4147.89 windows #0-19]
[chrome 84.0.4147.89 windows #0-19] 1 passing (1.9s)
[chrome 84.0.4147.89 windows #0-19]
[chrome 84.0.4147.89 windows #0-19] Check out job at https://app.eu-central-1.saucelabs.com/tests/69145e3d3f654de0a9aea7ddda763133
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-9] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/checkout.summary.spec.js.3.js
[chrome 84.0.4147.89 windows #0-9] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-9] Session ID: 21526cd972e64de08141811e43d11506
[chrome 84.0.4147.89 windows #0-9]
[chrome 84.0.4147.89 windows #0-9] Checkout - Summary
[chrome 84.0.4147.89 windows #0-9]    ✓ should validate that we have 1 product in our checkout overview
[chrome 84.0.4147.89 windows #0-9]
[chrome 84.0.4147.89 windows #0-9] 1 passing (1.8s)
[chrome 84.0.4147.89 windows #0-9]
[chrome 84.0.4147.89 windows #0-9] Check out job at https://app.eu-central-1.saucelabs.com/tests/21526cd972e64de08141811e43d11506
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-1] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/cart.summary.spec.js.1.js
[chrome 84.0.4147.89 windows #0-1] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-1] Session ID: e54aa040653242a58f0db2593fd8fe7f
[chrome 84.0.4147.89 windows #0-1]
[chrome 84.0.4147.89 windows #0-1] Cart Summary page
[chrome 84.0.4147.89 windows #0-1]    ✓ should validate that we can go from the cart to the checkout page
[chrome 84.0.4147.89 windows #0-1]
[chrome 84.0.4147.89 windows #0-1] 1 passing (2.4s)
[chrome 84.0.4147.89 windows #0-1]
[chrome 84.0.4147.89 windows #0-1] Check out job at https://app.eu-central-1.saucelabs.com/tests/e54aa040653242a58f0db2593fd8fe7f
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-3] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/checkout.complete.spec.js.0.js
[chrome 84.0.4147.89 windows #0-3] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-3] Session ID: 0d064fc304324ae0a5c56e82cd58cc73
[chrome 84.0.4147.89 windows #0-3]
[chrome 84.0.4147.89 windows #0-3] Checkout - Complete
[chrome 84.0.4147.89 windows #0-3]    ✓ should be able to test loading of login page
[chrome 84.0.4147.89 windows #0-3]
[chrome 84.0.4147.89 windows #0-3] 1 passing (1.7s)
[chrome 84.0.4147.89 windows #0-3]
[chrome 84.0.4147.89 windows #0-3] Check out job at https://app.eu-central-1.saucelabs.com/tests/0d064fc304324ae0a5c56e82cd58cc73
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-0] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/cart.summary.spec.js.0.js
[chrome 84.0.4147.89 windows #0-0] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-0] Session ID: 062dbf8dbe674da1acca642407209f45
[chrome 84.0.4147.89 windows #0-0]
[chrome 84.0.4147.89 windows #0-0] Cart Summary page
[chrome 84.0.4147.89 windows #0-0]    ✓ should validate that we can continue shopping
[chrome 84.0.4147.89 windows #0-0]
[chrome 84.0.4147.89 windows #0-0] 1 passing (2.4s)
[chrome 84.0.4147.89 windows #0-0]
[chrome 84.0.4147.89 windows #0-0] Check out job at https://app.eu-central-1.saucelabs.com/tests/062dbf8dbe674da1acca642407209f45
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-23] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/swag.items.list.spec.js.4.js
[chrome 84.0.4147.89 windows #0-23] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-23] Session ID: cd876544f12f4b888e8caafa14b68082
[chrome 84.0.4147.89 windows #0-23]
[chrome 84.0.4147.89 windows #0-23] Swag items list
[chrome 84.0.4147.89 windows #0-23]    ✓ should be able to open the cart summary page
[chrome 84.0.4147.89 windows #0-23]
[chrome 84.0.4147.89 windows #0-23] 1 passing (2.4s)
[chrome 84.0.4147.89 windows #0-23]
[chrome 84.0.4147.89 windows #0-23] Check out job at https://app.eu-central-1.saucelabs.com/tests/cd876544f12f4b888e8caafa14b68082
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-20] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/swag.items.list.spec.js.1.js
[chrome 84.0.4147.89 windows #0-20] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-20] Session ID: c190328f8401416fb4674616500b5fa5
[chrome 84.0.4147.89 windows #0-20]
[chrome 84.0.4147.89 windows #0-20] Swag items list
[chrome 84.0.4147.89 windows #0-20]    ✓ should validate that the details of a product can be opened
[chrome 84.0.4147.89 windows #0-20]
[chrome 84.0.4147.89 windows #0-20] 1 passing (2.9s)
[chrome 84.0.4147.89 windows #0-20]
[chrome 84.0.4147.89 windows #0-20] Check out job at https://app.eu-central-1.saucelabs.com/tests/c190328f8401416fb4674616500b5fa5
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-13] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/menu.spec.js.1.js
[chrome 84.0.4147.89 windows #0-13] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-13] Session ID: 183da92b6e904747a22c735b4d0a433f
[chrome 84.0.4147.89 windows #0-13]
[chrome 84.0.4147.89 windows #0-13] Menu
[chrome 84.0.4147.89 windows #0-13]    ✓ should be able to the swag items overview page
[chrome 84.0.4147.89 windows #0-13]
[chrome 84.0.4147.89 windows #0-13] 1 passing (3.2s)
[chrome 84.0.4147.89 windows #0-13]
[chrome 84.0.4147.89 windows #0-13] Check out job at https://app.eu-central-1.saucelabs.com/tests/183da92b6e904747a22c735b4d0a433f
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-22] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/swag.items.list.spec.js.3.js
[chrome 84.0.4147.89 windows #0-22] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-22] Session ID: 96f40be7b6794c4998b88db58e6f7a7b
[chrome 84.0.4147.89 windows #0-22]
[chrome 84.0.4147.89 windows #0-22] Swag items list
[chrome 84.0.4147.89 windows #0-22]    ✓ should validate that a product can be removed from the cart
[chrome 84.0.4147.89 windows #0-22]
[chrome 84.0.4147.89 windows #0-22] 1 passing (3.4s)
[chrome 84.0.4147.89 windows #0-22]
[chrome 84.0.4147.89 windows #0-22] Check out job at https://app.eu-central-1.saucelabs.com/tests/96f40be7b6794c4998b88db58e6f7a7b
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-16] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/swag.item.details.spec.js.0.js
[chrome 84.0.4147.89 windows #0-16] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-16] Session ID: 5110cae29ae4427b856b1fdba3589f2b
[chrome 84.0.4147.89 windows #0-16]
[chrome 84.0.4147.89 windows #0-16] Swag Item Details
[chrome 84.0.4147.89 windows #0-16]    ✓ should validate that we can go back from the details to the inventory page
[chrome 84.0.4147.89 windows #0-16]
[chrome 84.0.4147.89 windows #0-16] 1 passing (2.8s)
[chrome 84.0.4147.89 windows #0-16]
[chrome 84.0.4147.89 windows #0-16] Check out job at https://app.eu-central-1.saucelabs.com/tests/5110cae29ae4427b856b1fdba3589f2b
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-5] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/checkout.personal.info.spec.js.2.js
[chrome 84.0.4147.89 windows #0-5] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-5] Session ID: 1afb25b098664a58ae18bf81e856b174
[chrome 84.0.4147.89 windows #0-5]
[chrome 84.0.4147.89 windows #0-5] Checkout - Personal info
[chrome 84.0.4147.89 windows #0-5]    ✓ should validate that we can cancel the first checkout
[chrome 84.0.4147.89 windows #0-5]
[chrome 84.0.4147.89 windows #0-5] 1 passing (2.4s)
[chrome 84.0.4147.89 windows #0-5]
[chrome 84.0.4147.89 windows #0-5] Check out job at https://app.eu-central-1.saucelabs.com/tests/1afb25b098664a58ae18bf81e856b174
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-4] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/checkout.personal.info.spec.js.1.js
[chrome 84.0.4147.89 windows #0-4] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-4] Session ID: 0d6c3d176029406980a28edabad456d8
[chrome 84.0.4147.89 windows #0-4]
[chrome 84.0.4147.89 windows #0-4] Checkout - Personal info
[chrome 84.0.4147.89 windows #0-4]    ✓ should validate we get an error if we don not provide all personal information
[chrome 84.0.4147.89 windows #0-4]
[chrome 84.0.4147.89 windows #0-4] 1 passing (3.5s)
[chrome 84.0.4147.89 windows #0-4]
[chrome 84.0.4147.89 windows #0-4] Check out job at https://app.eu-central-1.saucelabs.com/tests/0d6c3d176029406980a28edabad456d8
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-11] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/login.spec.js.2.js
[chrome 84.0.4147.89 windows #0-11] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-11] Session ID: 42056eba2e2b432d9425e4f0ea637828
[chrome 84.0.4147.89 windows #0-11]
[chrome 84.0.4147.89 windows #0-11] LoginPage
[chrome 84.0.4147.89 windows #0-11]    ✓ should be able to login with a standard user
[chrome 84.0.4147.89 windows #0-11]
[chrome 84.0.4147.89 windows #0-11] 1 passing (3.3s)
[chrome 84.0.4147.89 windows #0-11]
[chrome 84.0.4147.89 windows #0-11] Check out job at https://app.eu-central-1.saucelabs.com/tests/42056eba2e2b432d9425e4f0ea637828
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-18] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/swag.item.details.spec.js.2.js
[chrome 84.0.4147.89 windows #0-18] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-18] Session ID: b9a4a44f2aa64040ab47ff80f7c9e894
[chrome 84.0.4147.89 windows #0-18]
[chrome 84.0.4147.89 windows #0-18] Swag Item Details
[chrome 84.0.4147.89 windows #0-18]    ✓ should validate that a product can be removed from the cart
[chrome 84.0.4147.89 windows #0-18]
[chrome 84.0.4147.89 windows #0-18] 1 passing (3.6s)
[chrome 84.0.4147.89 windows #0-18]
[chrome 84.0.4147.89 windows #0-18] Check out job at https://app.eu-central-1.saucelabs.com/tests/b9a4a44f2aa64040ab47ff80f7c9e894
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-6] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/checkout.personal.info.spec.js.3.js
[chrome 84.0.4147.89 windows #0-6] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-6] Session ID: fe3709d191044f7f95e784a276f7130a
[chrome 84.0.4147.89 windows #0-6]
[chrome 84.0.4147.89 windows #0-6] Checkout - Personal info
[chrome 84.0.4147.89 windows #0-6]    ✓ should be able to continue the checkout
[chrome 84.0.4147.89 windows #0-6]
[chrome 84.0.4147.89 windows #0-6] 1 passing (3.3s)
[chrome 84.0.4147.89 windows #0-6]
[chrome 84.0.4147.89 windows #0-6] Check out job at https://app.eu-central-1.saucelabs.com/tests/fe3709d191044f7f95e784a276f7130a
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-17] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/swag.item.details.spec.js.1.js
[chrome 84.0.4147.89 windows #0-17] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-17] Session ID: 792d0bc02ce5405d9f31fb752d1324ba
[chrome 84.0.4147.89 windows #0-17]
[chrome 84.0.4147.89 windows #0-17] Swag Item Details
[chrome 84.0.4147.89 windows #0-17]    ✓ should validate that a product can be added to a cart
[chrome 84.0.4147.89 windows #0-17]
[chrome 84.0.4147.89 windows #0-17] 1 passing (3.8s)
[chrome 84.0.4147.89 windows #0-17]
[chrome 84.0.4147.89 windows #0-17] Check out job at https://app.eu-central-1.saucelabs.com/tests/792d0bc02ce5405d9f31fb752d1324ba
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-2] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/cart.summary.spec.js.2.js
[chrome 84.0.4147.89 windows #0-2] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-2] Session ID: 18b0419b444049fcbc9eb9bc3ae31371
[chrome 84.0.4147.89 windows #0-2]
[chrome 84.0.4147.89 windows #0-2] Cart Summary page
[chrome 84.0.4147.89 windows #0-2]    ✓ should validate that a product can be removed from the cart
[chrome 84.0.4147.89 windows #0-2]
[chrome 84.0.4147.89 windows #0-2] 1 passing (3.6s)
[chrome 84.0.4147.89 windows #0-2]
[chrome 84.0.4147.89 windows #0-2] Check out job at https://app.eu-central-1.saucelabs.com/tests/18b0419b444049fcbc9eb9bc3ae31371
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-15] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/menu.spec.js.4.js
[chrome 84.0.4147.89 windows #0-15] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-15] Session ID: b3a122a1f8aa47ab96105bd00d0b3ecd
[chrome 84.0.4147.89 windows #0-15]
[chrome 84.0.4147.89 windows #0-15] Menu
[chrome 84.0.4147.89 windows #0-15]    ✓ should be able to clear the cart
[chrome 84.0.4147.89 windows #0-15]
[chrome 84.0.4147.89 windows #0-15] 1 passing (4.1s)
[chrome 84.0.4147.89 windows #0-15]
[chrome 84.0.4147.89 windows #0-15] Check out job at https://app.eu-central-1.saucelabs.com/tests/b3a122a1f8aa47ab96105bd00d0b3ecd
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-8] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/checkout.summary.spec.js.2.js
[chrome 84.0.4147.89 windows #0-8] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-8] Session ID: fa2bd3f1b4bb4d1dbf9946e61af200e7
[chrome 84.0.4147.89 windows #0-8]
[chrome 84.0.4147.89 windows #0-8] Checkout - Summary
[chrome 84.0.4147.89 windows #0-8]    ✓ should validate that we can cancel checkout and go to the inventory page
[chrome 84.0.4147.89 windows #0-8]
[chrome 84.0.4147.89 windows #0-8] 1 passing (2.5s)
[chrome 84.0.4147.89 windows #0-8]
[chrome 84.0.4147.89 windows #0-8] Check out job at https://app.eu-central-1.saucelabs.com/tests/fa2bd3f1b4bb4d1dbf9946e61af200e7
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-14] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/menu.spec.js.3.js
[chrome 84.0.4147.89 windows #0-14] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-14] Session ID: 8a3991bf0e8d4e208fc5627cb2a48abc
[chrome 84.0.4147.89 windows #0-14]
[chrome 84.0.4147.89 windows #0-14] Menu
[chrome 84.0.4147.89 windows #0-14]    ✓ should be able to log out
[chrome 84.0.4147.89 windows #0-14]
[chrome 84.0.4147.89 windows #0-14] 1 passing (3.5s)
[chrome 84.0.4147.89 windows #0-14]
[chrome 84.0.4147.89 windows #0-14] Check out job at https://app.eu-central-1.saucelabs.com/tests/8a3991bf0e8d4e208fc5627cb2a48abc
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-21] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/swag.items.list.spec.js.2.js
[chrome 84.0.4147.89 windows #0-21] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-21] Session ID: 1537c7e295614f309e2c01532e763f80
[chrome 84.0.4147.89 windows #0-21]
[chrome 84.0.4147.89 windows #0-21] Swag items list
[chrome 84.0.4147.89 windows #0-21]    ✓ should validate that a product can be added to the cart
[chrome 84.0.4147.89 windows #0-21]
[chrome 84.0.4147.89 windows #0-21] 1 passing (3.7s)
[chrome 84.0.4147.89 windows #0-21]
[chrome 84.0.4147.89 windows #0-21] Check out job at https://app.eu-central-1.saucelabs.com/tests/1537c7e295614f309e2c01532e763f80
------------------------------------------------------------------
[chrome 84.0.4147.89 windows #0-12] Spec: /Users/wimselles/Sauce/Git/sauce-training/demo-js/webdriverio/web/framework/test/specs/login.spec.js.3.js
[chrome 84.0.4147.89 windows #0-12] Running: chrome (v84.0.4147.89) on windows
[chrome 84.0.4147.89 windows #0-12] Session ID: 8e8db07a52a14342b9ae49c0623f0c7c
[chrome 84.0.4147.89 windows #0-12]
[chrome 84.0.4147.89 windows #0-12] LoginPage
[chrome 84.0.4147.89 windows #0-12]    ✓ should not be able to login with a locked user
[chrome 84.0.4147.89 windows #0-12]
[chrome 84.0.4147.89 windows #0-12] 1 passing (3.1s)
[chrome 84.0.4147.89 windows #0-12]
[chrome 84.0.4147.89 windows #0-12] Check out job at https://app.eu-central-1.saucelabs.com/tests/8e8db07a52a14342b9ae49c0623f0c7c


Spec Files:      24 passed, 8 total (300% completed) in 00:00:31 

✨  Done in 36.98s.

@wswebcreation
Copy link
Member

Part 2/2

In the end:

  • it took longer, due to spinning up a single VM for each test
  • it took some processing time for parsing the files, will take longer for a bigger project
  • it used a lot of memory on my local machine to spin up multiple workers

I also ran this on the following config

config.capabilities = [
    {
        browserName: 'googlechrome',
        platformName: 'Windows 10',
        browserVersion: 'latest',
        'sauce:options': {
            ...defaultBrowserSauceOptions,
        },
        ...chromeOptions,
    },
    {
        browserName: 'firefox',
        platformName: 'Windows 10',
        browserVersion: 'latest',
        'sauce:options': {
            ...defaultBrowserSauceOptions,
        },
    },
    {
        browserName: 'internet explorer',
        platformName: 'Windows 8.1',
        browserVersion: 'latest',
        'sauce:options': {
            ...defaultBrowserSauceOptions,
            iedriverVersion: '3.141.59',
        },
    },
    {
        browserName: 'MicrosoftEdge',
        platformName: 'Windows 10',
        browserVersion: '18.17763',
        'sauce:options': {
            ...defaultBrowserSauceOptions,
        },
    },
    {
        browserName: 'MicrosoftEdge',
        platformName: 'Windows 10',
        browserVersion: 'latest',
        'sauce:options': {
            ...defaultBrowserSauceOptions,
        },
    },
    // Safari 11 is not W3C compliant,
    // see https://developer.apple.com/documentation/webkit/macos_webdriver_commands_for_safari_11_1_and_earlier
    {
        browserName: 'safari',
        platform: 'macOS 10.13',
        version: '11.1',
        ...defaultBrowserSauceOptions,
    },
    {
        browserName: 'safari',
        platformName: 'macOS 10.14',
        browserVersion: 'latest',
        'sauce:options': {
            ...defaultBrowserSauceOptions,
        },
    }
];

and it this was the endresult

Spec Files:      168 passed, 56 total (300% completed) in 00:01:38 

✨  Done in 99.99s.

against this data when I don't split the files

Spec Files:      56 passed, 56 total (100% completed) in 00:00:55 

✨  Done in 56.63s.

As you can see, almost double the time due to more memory/cpu consumption

@wswebcreation
Copy link
Member

I've released a new service that will be the first step in helping with this challenge. It can be found here.

I'll close this issue here and maybe we can continue the conversation there. Thanks for all ideas and help!

@seanpoulter
Copy link
Contributor

Well done and congratulations Wim! It isn't too surprising that running things fully in parallel can take longer. Have you tried to find the number of describes per spec that may make it run faster? I'd reach for something like _.chunk. 😁

@wswebcreation
Copy link
Member

Hi @seanpoulter

Thanks, well, it's not the splitting that makes it take longer, it's spinning up 100 workers at the same time which consumes a lot of CPU and memory. That's something for phase 2 😉

@seanpoulter
Copy link
Contributor

I think we're saying the same thing. Starting all those workers takes a lot of resources. I'm looking forward to seeing if we can get results faster than if you split the files by distributing n tests per worker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants