Skip to content

Commit be67ff0

Browse files
add ci wdio config + update workflow
1 parent 65c90c3 commit be67ff0

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
run: npm install chromedriver --detect_chromedriver_version
3030

3131
- name: Execute all tests
32-
run: npm test
32+
run: npm run test:ci

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"description": "An example project for WebdriverIO 7 JavaScript using Applitools Ultrafast Grid",
55
"main": "index.js",
66
"scripts": {
7-
"test": "wdio"
7+
"test": "wdio",
8+
"test:ci": "wdio wdio-ci.conf.js"
89
},
910
"author": "Applitools Team <[email protected]> (http://www.applitools.com/)",
1011
"license": "ISC",

wdio-ci.conf.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// For Demonstration
2+
// ---
3+
// In order to run WebdriverIO and subsequently an instance of Chrome using
4+
// continuous integration, particularly in this case, a GitHub Actions workflow,
5+
// we need to run Google Chrome headless. Here we're pulling in the base config
6+
// defined at wdio.conf.js and applying a new capabilities configuration that
7+
// adds the headless configuration to Chrome. When running Chrome headless
8+
// locally on a desktop environment, you will not be able to visibly see the
9+
// tests running in the browser.
10+
11+
const baseConfig = require('./wdio.conf.js');
12+
13+
exports.config = Object.assign({}, baseConfig.config, {
14+
capabilities: [
15+
{
16+
maxInstances: 5,
17+
browserName: 'chrome',
18+
'goog:chromeOptions': {
19+
args: ['--headless', '--disable-gpu'],
20+
},
21+
},
22+
],
23+
})

wdio.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ exports.config = {
6161
browserName: 'chrome',
6262
acceptInsecureCerts: true,
6363
'goog:chromeOptions': {
64-
args: ['headless']
64+
args: ['--headless', '--disable-gpu']
6565
}
6666
// If outputDir is provided WebdriverIO can capture driver session logs
6767
// it is possible to configure which logTypes to include/exclude.

0 commit comments

Comments
 (0)