Skip to content

Commit d56708d

Browse files
committed
feat(plugin): add ci tests
1 parent c5187f0 commit d56708d

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

.circleci/config.yml

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ jobs:
2626
- run:
2727
name: Test
2828
command: npm test
29+
- run:
30+
name: Integration
31+
command: npm run wdio-ci
2932

3033
node-v6:
3134
<<: *node-base

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"compile": "tsc",
1414
"lint": "tslint -p tsconfig.json",
1515
"test": "jasmine-ts \"src/**/*.spec.ts\"",
16-
"wdio-local": "wdio test/wdio.local.conf.js"
16+
"wdio-local": "wdio test/wdio.local.conf.js",
17+
"wdio-ci": "wdio test/wdio.ci.conf.js"
1718
},
1819
"repository": {
1920
"type": "git",
@@ -55,6 +56,7 @@
5556
"tslint-eslint-rules": "5.3.1",
5657
"typescript": "2.9.2",
5758
"vrsource-tslint-rules": "5.8.2",
59+
"wdio-sauce-service": "0.4.10",
5860
"wdio-cucumber-framework": "1.1.0",
5961
"webdriverio": "4.13.1"
6062
},

test/step_definitions/page.steps.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
const expected = fs.readFileSync(path.join(__dirname, '..', responses.getItems[scenario].file));
4848
return actual.equals(expected);
4949
} else {
50-
return browser.params.environment === 'TRAVIS'
50+
return browser.params.environment === 'CI'
5151
}
5252
}, 5000, 'expected download to be completed');
5353
}

test/wdio.ci.conf.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
const config = require('./wdio.conf').config;
2+
3+
config.params = {
4+
environment: 'CI',
5+
default_directory: '/tmp'
6+
};
7+
8+
config.services = ['sauce'];
9+
config.user = process.env.SAUCE_USERNAME;
10+
config.key = process.env.SAUCE_ACCESS_KEY;
11+
12+
config.capabilities = [{
13+
browserName: 'chrome',
14+
name: 'ngApimock - webdriverio',
15+
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
16+
build: process.env.TRAVIS_BUILD_NUMBER,
17+
chromeOptions: {
18+
args: ['--no-sandbox', '--test-type=browser'],
19+
prefs: {
20+
'download': {
21+
'prompt_for_download': false,
22+
'directory_upgrade': true,
23+
'default_directory': '/tmp'
24+
}
25+
}
26+
}
27+
}];
28+
29+
exports.config = config;

0 commit comments

Comments
 (0)