Skip to content

Commit 55faab4

Browse files
test: use various services to verify compatibility
Currently we are only testing using the selenium-standalone service. Since other services interact with the browser differently we must run the tests using those services to check we are compatible with them. Update the test setup so that we check: Puppeteer (default wdio behaviour), Chromedriver, Geckodriver and Selenium Standalone.
1 parent 92e5ee4 commit 55faab4

File tree

6 files changed

+53
-17
lines changed

6 files changed

+53
-17
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"project": "*/**/tsconfig.json"
1111
},
1212
"plugins": ["@typescript-eslint"],
13-
"ignorePatterns": "wdio.conf.js",
13+
"ignorePatterns": "wdio.conf.*",
1414
"rules": {
1515
"babel/new-cap": "off",
1616
"func-names": "off",

package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
"lint": "kcd-scripts lint",
1414
"test:unit": "kcd-scripts test --no-watch --config=jest.config.js",
1515
"validate": "kcd-scripts validate build,lint,test,typecheck",
16-
"test": "wdio wdio.conf.js",
16+
"test:puppeteer": "wdio wdio.conf.js",
17+
"test:selenium-standalone": "wdio wdio.conf.selenium-standalone.js",
18+
"test:chromedriver": "wdio wdio.conf.chromedriver.js",
19+
"test:geckodriver": "wdio wdio.conf.geckodriver.js",
20+
"test": "npm-run-all test:puppeteer test:selenium-standalone test:chromedriver test:geckodriver",
1721
"semantic-release": "semantic-release",
1822
"typecheck:async": "tsc -p ./test/async/tsconfig.json",
1923
"typecheck:sync": "tsc -p ./test/sync/tsconfig.json",
@@ -49,7 +53,11 @@
4953
"npm-run-all": "^4.1.5",
5054
"semantic-release": "^17.0.2",
5155
"ts-node": "^9.1.1",
52-
"typescript": "^4.4.2"
56+
"typescript": "^4.4.2",
57+
"chromedriver": "^105.0.1",
58+
"geckodriver": "^3.0.2",
59+
"wdio-chromedriver-service": "^7.3.2",
60+
"wdio-geckodriver-service": "^2.0.0"
5361
},
5462
"repository": {
5563
"type": "git",

wdio.conf.chromedriver.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const baseConfig = require('./wdio.conf')
2+
3+
exports.config = {
4+
...baseConfig.config,
5+
services: ['chromedriver'],
6+
}

wdio.conf.geckodriver.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const baseConfig = require('./wdio.conf')
2+
3+
exports.config = {
4+
...baseConfig.config,
5+
services: ['geckodriver'],
6+
capabilities: [
7+
{
8+
maxInstances: 5,
9+
browserName: 'firefox',
10+
acceptInsecureCerts: true,
11+
'moz:firefoxOptions': {
12+
args: process.env.CI ? ['--headless'] : [],
13+
},
14+
},
15+
]
16+
}

wdio.conf.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,6 @@ exports.config = {
6161
args: process.env.CI ? ['--headless'] : [],
6262
},
6363
},
64-
{
65-
maxInstances: 5,
66-
browserName: 'firefox',
67-
acceptInsecureCerts: true,
68-
'moz:firefoxOptions': {
69-
args: process.env.CI ? ['--headless'] : [],
70-
},
71-
},
7264
],
7365
//
7466
// ===================
@@ -117,12 +109,7 @@ exports.config = {
117109
// Services take over a specific job you don't want to take care of. They enhance
118110
// your test setup with almost no effort. Unlike plugins, they don't add new
119111
// commands. Instead, they hook themselves up into the test process.
120-
services: [
121-
[
122-
'selenium-standalone',
123-
{drivers: {firefox: true, chrome: !process.env.CI || {version: '94'}}},
124-
],
125-
],
112+
services: [],
126113

127114
// Framework you want to run your specs with.
128115
// The following are supported: Mocha, Jasmine, and Cucumber

wdio.conf.selenium-standalone.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const baseConfig = require('./wdio.conf')
2+
3+
exports.config = {
4+
...baseConfig.config,
5+
capabilities: [
6+
...baseConfig.config.capabilities,
7+
{
8+
maxInstances: 5,
9+
browserName: 'firefox',
10+
acceptInsecureCerts: true,
11+
'moz:firefoxOptions': {
12+
args: process.env.CI ? ['--headless'] : [],
13+
},
14+
},
15+
],
16+
services: [
17+
['selenium-standalone', {drivers: {firefox: true, chrome: true}}]
18+
],
19+
}

0 commit comments

Comments
 (0)