Skip to content

Commit ce78e97

Browse files
committed
test(e2e): improve runner
1 parent 9bfda17 commit ce78e97

File tree

4 files changed

+38
-10
lines changed

4 files changed

+38
-10
lines changed

Diff for: .circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
defaults: &defaults
44
working_directory: ~/project/vue-router
55
docker:
6-
- image: circleci/node:10-browsers
6+
- image: circleci/node:lts-browsers
77

88
jobs:
99
install:

Diff for: test/e2e/nightwatch.browserstack.js

+12
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@ const nwConf = {
4646
}
4747
},
4848

49+
firefox: {
50+
desiredCapabilities: {
51+
browser: 'firefox'
52+
}
53+
},
54+
55+
safari: {
56+
desiredCapabilities: {
57+
browser: 'safari'
58+
}
59+
},
60+
4961
ie: {
5062
desiredCapabilities: {
5163
browser: 'internet explorer',

Diff for: test/e2e/nightwatch.config.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,12 @@ module.exports = {
5959
browserName: 'firefox',
6060
acceptSslCerts: true
6161
}
62-
}
62+
},
6363

64-
// phantomjs: {
65-
// desiredCapabilities: {
66-
// browserName: 'phantomjs',
67-
// javascriptEnabled: true,
68-
// acceptSslCerts: true,
69-
// },
70-
// },
64+
ie: {
65+
desiredCapabilities: {
66+
browser: 'internet explorer'
67+
}
68+
}
7169
}
7270
}

Diff for: test/e2e/runner.js

+19-1
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,26 @@ const NW_CONFIG = isLocal
3737
: resolve(__dirname, './nightwatch.config.js')
3838

3939
// add a configuration by default if not provided
40-
if (args.indexOf('-c') < -1) {
40+
// add a configuration by default if not provided
41+
if (args.indexOf('-c') < 0) {
4142
args.push('-c', NW_CONFIG)
43+
// check if multiple envs are provided. The way Nightwatch works
44+
// requires to explicitely provide the conf
45+
const envs = args[args.indexOf('-e') + 1]
46+
if (!envs || envs.indexOf(',') > -1) {
47+
console.warn(
48+
`Specify the conf with providing multiple browsers:\n$ yarn run test:e2e ${args.join(
49+
' '
50+
)} -c ${NW_CONFIG}`
51+
)
52+
process.exit(1)
53+
}
54+
} else if (isLocal) {
55+
const conf = args[args.indexOf('-c') + 1]
56+
if (resolve('.', conf) !== NW_CONFIG) {
57+
console.warn('The passed config should be', NW_CONFIG)
58+
process.exit(1)
59+
}
4260
}
4361

4462
function adaptArgv (argv) {

0 commit comments

Comments
 (0)