I have a WDIO project that has many tests. Some tests need to be run consecutively while other tests can run in parallel.
I cannot run all tests in parallel because the tests that need to be run consecutively will fail, and I cannot run all tests consecutively because it would take far too long for the execution to finish.
For these reasons I need to find a way to run these tests both consecutively and in parallel. Is it possible to configure this WDIO project to accomplish this?
I run these tests through SauceLabs and understand that I can set the maxInstances
variable to as many VMs as I'd like to run in parallel. Is it possible to set certain tests to use a high maxInstance
while other tests have a maxInstance
of 1?
Or perhaps there is a way to use logic logic via the test directories to run certain tests in parallel and others consecutively?
For example, if I have these tests:
'./tests/parallel/one.js',
'./tests/parallel/two.js',
'./tests/consecutive/three.js',
'./tests/consecutive/four.js',
Could I create some logic such as:
if(spec.includes('/consecutive/'){
//Do not run until other '/consecutive/' test finishes execution
} else {
//Run in parallel
}
How can I configure this WDIO project to run tests both consecutively and in parallel? Thank you!