-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
/
Copy pathe2e.spec.js
104 lines (93 loc) · 1.98 KB
/
e2e.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
jest.mock('fs')
jest.mock('inquirer')
const assertPromptModule = require('@vue/cli-test-utils/assertPromptModule')
const moduleToTest = require('../e2e')
test('cypress', async () => {
const expectedPrompts = [
{
message: 'features',
choices: ['E2E Testing'],
check: [0]
},
{
message: 'Pick an E2E testing solution',
choices: ['Cypress', 'Nightwatch', 'WebdriverIO'],
choose: 0
}
]
const expectedOptions = {
plugins: {
'@vue/cli-plugin-e2e-cypress': {}
}
}
await assertPromptModule(
moduleToTest,
expectedPrompts,
expectedOptions,
{ pluginsOnly: true }
)
})
test('nightwatch', async () => {
const expectedPrompts = [
{
message: 'features',
choices: ['E2E Testing'],
check: [0]
},
{
message: 'Pick an E2E testing solution',
choices: ['Cypress', 'Nightwatch', 'WebdriverIO'],
choose: 1
},
{
message: 'Pick browsers to run end-to-end test on',
choice: ['Chrome', 'Firefox'],
check: [0, 1]
}
]
const expectedOptions = {
plugins: {
'@vue/cli-plugin-e2e-nightwatch': {
webdrivers: ['chrome', 'firefox']
}
}
}
await assertPromptModule(
moduleToTest,
expectedPrompts,
expectedOptions,
{ pluginsOnly: true }
)
})
test('webdriverio', async () => {
const expectedPrompts = [
{
message: 'features',
choices: ['E2E Testing'],
check: [0]
},
{
message: 'Pick an E2E testing solution',
choices: ['Cypress', 'Nightwatch', 'WebdriverIO'],
choose: 2
},
{
message: 'Pick browsers to run end-to-end test on',
choice: ['Chrome', 'Firefox'],
check: [0, 1]
}
]
const expectedOptions = {
plugins: {
'@vue/cli-plugin-e2e-webdriverio': {
webdrivers: ['chrome', 'firefox']
}
}
}
await assertPromptModule(
moduleToTest,
expectedPrompts,
expectedOptions,
{ pluginsOnly: true }
)
})