I want to test run all my mocha test cases for an array of different users. All test cases will run for every user in the array. I am currently maintaining the list of users in an array in a config.
How to achieve this using webdriverio and mocha?
I want to test run all my mocha test cases for an array of different users. All test cases will run for every user in the array. I am currently maintaining the list of users in an array in a config.
How to achieve this using webdriverio and mocha?
Mocha does support it by default.
But you can update your test suite to support it, basically it will run tests in a loop:
describe('data-driven tests', function () {
var runs = [
{it: 'user 1', options: {...}},
{it: 'user 2', options: {...}},
];
before(function () {
...
});
runs.forEach(function (run) {
it('test functionality for ' + run.it, function () {
...
});
});
});