Skip to content

Commit 79d98a8

Browse files
test(e2e-webdriverio): add integration tests
1 parent 6f58920 commit 79d98a8

File tree

5 files changed

+73
-7
lines changed

5 files changed

+73
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
jest.setTimeout(process.env.APPVEYOR ? 120000 : 60000)
2+
3+
const create = require('@vue/cli-test-utils/createTestProject')
4+
5+
test('should work', async () => {
6+
const project = await create('e2e-webdriverio', {
7+
plugins: {
8+
'@vue/cli-plugin-babel': {},
9+
'@vue/cli-plugin-e2e-webdriverio': {},
10+
'@vue/cli-plugin-eslint': {
11+
config: 'airbnb',
12+
lintOn: 'save'
13+
}
14+
}
15+
})
16+
17+
if (!process.env.CI) {
18+
await project.run(`vue-cli-service test:e2e`)
19+
} else if (!process.env.APPVEYOR) {
20+
await project.run(`vue-cli-service test:e2e --headless`)
21+
}
22+
})
23+
24+
test('should work with TS', async () => {
25+
const project = await create('e2e-webdriverio-ts', {
26+
plugins: {
27+
'@vue/cli-plugin-typescript': {
28+
'classComponent': true,
29+
'tsLint': true,
30+
'lintOn': ['save']
31+
},
32+
'@vue/cli-plugin-e2e-webdriverio': {}
33+
}
34+
})
35+
36+
if (!process.env.CI) {
37+
await project.run(`vue-cli-service test:e2e`)
38+
} else if (!process.env.APPVEYOR) {
39+
await project.run(`vue-cli-service test:e2e --headless`)
40+
}
41+
})

packages/@vue/cli-plugin-e2e-webdriverio/generator/template/wdio.local.conf.js

-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,3 @@ exports.config = {
1919
}
2020
}]
2121
}
22-
23-
24-
console.log(process.argv);

packages/@vue/cli-plugin-e2e-webdriverio/ui.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = api => {
22
api.describeTask({
33
match: /vue-cli-service test:e2e/,
44
description: 'org.vue.webdriverio.tasks.test.description',
5-
link: 'https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-e2e-webdriverio#injected-commands',
5+
link: 'https://github.com/vuejs/vue-cli',
66
prompts: [],
77
onBeforeRun: () => {}
88
})

packages/@vue/cli/lib/promptModules/__tests__/e2e.spec.js

+30-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test('cypress', async () => {
1414
},
1515
{
1616
message: 'Pick an E2E testing solution',
17-
choices: ['Cypress', 'Nightwatch'],
17+
choices: ['Cypress', 'Nightwatch', 'WebdriverIO'],
1818
choose: 0
1919
}
2020
]
@@ -42,7 +42,7 @@ test('nightwatch', async () => {
4242
},
4343
{
4444
message: 'Pick an E2E testing solution',
45-
choices: ['Cypress', 'Nightwatch'],
45+
choices: ['Cypress', 'Nightwatch', 'WebdriverIO'],
4646
choose: 1
4747
},
4848
{
@@ -65,3 +65,31 @@ test('nightwatch', async () => {
6565
{ pluginsOnly: true }
6666
)
6767
})
68+
69+
test('webdriverio', async () => {
70+
const expectedPrompts = [
71+
{
72+
message: 'features',
73+
choices: ['E2E Testing'],
74+
check: [0]
75+
},
76+
{
77+
message: 'Pick an E2E testing solution',
78+
choices: ['Cypress', 'Nightwatch', 'WebdriverIO'],
79+
choose: 2
80+
}
81+
]
82+
83+
const expectedOptions = {
84+
plugins: {
85+
'@vue/cli-plugin-e2e-webdriverio': {}
86+
}
87+
}
88+
89+
await assertPromptModule(
90+
moduleToTest,
91+
expectedPrompts,
92+
expectedOptions,
93+
{ pluginsOnly: true }
94+
)
95+
})

packages/@vue/cli/lib/promptModules/e2e.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = cli => {
2727
short: 'Nightwatch'
2828
},
2929
{
30-
name: 'WebDriverIO (WebDriver/DevTools based)',
30+
name: 'WebdriverIO (WebDriver/DevTools based)',
3131
value: 'webdriverio',
3232
short: 'WebdriverIO'
3333
}

0 commit comments

Comments
 (0)