I am new to learning WebdriverIO/JavaScript/WebUI Automation. I have one describe()
function and inside it I have multiple it()
statements.
I want to run those it()
statements, in parallel, or in sequence one after the other.
const assert = require('assert')
const LoginPage = require('../pages/login.page')
describe('Test suite', () => {
it('Should display error when password is missing',() => {
// ...
})
it('Should display error when email is missing',() => {
// ...
})
it('Should display error when email and password are missing',() => {
// ...
})
it('Should display error when email is incorrect',() => {
// ...
})
it('Should display error when password is incorrect',() => {
// ...
})
it('Should display error when password case is incorrect',() => {
// ...
})
it('Should login with valid email and password',() => {
// ...
})
})
You cannot run your it-statements
in parallel. WebdriverIO only grants you the ability to run different files in parallel, meaning you have to separate your logic in comprehensive test-suites, which can be run via multiple WDIO processes.
For this you have to setup the maxInstances: 2,
(or more, depending on your requirements) inside your wdio.conf.js
file.
Example: Let's consider you have two features: Login (LoginFlows.js
) & Register (RegisterFlows.js
). If you have maxInstances: 2,
, and you run both features, you will get two separate WDIO sessions running, one for each of your test suites (two browser sessions will be assigned).
You can read more about it here. As for running them in a sequence, that is the default behaviour.
So, you can only run different files in parallel, considering each file represents one feature test suite. Hope that things are a bit more clear now!