I need to run test cases on multiple browsers, while using webdriverIO. Despite going through several articles and documentation of WDIO, I couldn't find a way in which works.
this is my wdio.conf.js.
exports.config = {
baseUrl: 'http://127.0.0.1:8100/',
path: '/wd/hub',
specs: [
'./e2e/**/*-wdio.e2e-spec.ts'
],
maxInstances: 10,
// capabilities: [
// {
// browserName: 'Chrome',
// },
// {
// browserName: 'Firefox',
// }
// ],
capabilities: {
myChromeBrowser: {
desiredCapabilities: {
browserName: 'Chrome',
}
},
myFirefoxBrowser: {
desiredCapabilities: {
browserName: 'Firefox',
}
}
},
sync: true,
waitforTimeout: 10000,
services: ['selenium-standalone'],
framework: 'jasmine',
jasmineNodeOpts: {
defaultTimeoutInterval: 50000,
expectationResultHandler: function(passed, assertion) { }
},
before: function () {
require('ts-node/register');
require('ts-node').register({
project: 'e2e'
});
},
}
These are the devDependencies I have used in package.json:
"devDependencies": {
"ts-node": "^3.3.0",
"wdio-appium-service": "^0.2.3",
"wdio-firefox-profile-service": "^0.1.0",
"wdio-jasmine-framework": "^0.3.2",
"wdio-selenium-standalone-service": "0.0.9",
"wdio-spec-reporter": "^0.1.2",
"wdio-typescript-service": "0.0.3",
"webdriverio": "^4.9.8"
}
As you can see, I have tried both "capabilities": []
and "capabilities": {}
but following official docs, and even after that, only two instances of Chrome
run. I have also tried installing Firefox's
plugin/dependencies by following installation doc.
Can anybody point out, what have i missed or wrongly configured? Currently two instances of google Chrome launches and the test cases run on them, while I want the test cases to run in chrome and firefox separately.
Additionally please check your "Camel Casing" on your browser names. Because you have
Firefox
instead offirefox
- you are probably having it launch the second instance of Chrome.