Skip to content

Commit

Permalink
test(e2e-webdriverio): add integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed May 15, 2020
1 parent 6f58920 commit 79d98a8
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 7 deletions.
@@ -0,0 +1,41 @@
jest.setTimeout(process.env.APPVEYOR ? 120000 : 60000)

const create = require('@vue/cli-test-utils/createTestProject')

test('should work', async () => {
const project = await create('e2e-webdriverio', {
plugins: {
'@vue/cli-plugin-babel': {},
'@vue/cli-plugin-e2e-webdriverio': {},
'@vue/cli-plugin-eslint': {
config: 'airbnb',
lintOn: 'save'
}
}
})

if (!process.env.CI) {
await project.run(`vue-cli-service test:e2e`)
} else if (!process.env.APPVEYOR) {
await project.run(`vue-cli-service test:e2e --headless`)
}
})

test('should work with TS', async () => {
const project = await create('e2e-webdriverio-ts', {
plugins: {
'@vue/cli-plugin-typescript': {
'classComponent': true,
'tsLint': true,
'lintOn': ['save']
},
'@vue/cli-plugin-e2e-webdriverio': {}
}
})

if (!process.env.CI) {
await project.run(`vue-cli-service test:e2e`)
} else if (!process.env.APPVEYOR) {
await project.run(`vue-cli-service test:e2e --headless`)
}
})
Expand Up @@ -19,6 +19,3 @@ exports.config = {
}
}]
}


console.log(process.argv);
2 changes: 1 addition & 1 deletion packages/@vue/cli-plugin-e2e-webdriverio/ui.js
Expand Up @@ -2,7 +2,7 @@ module.exports = api => {
api.describeTask({
match: /vue-cli-service test:e2e/,
description: 'org.vue.webdriverio.tasks.test.description',
link: 'https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-e2e-webdriverio#injected-commands',
link: 'https://github.com/vuejs/vue-cli',
prompts: [],
onBeforeRun: () => {}
})
Expand Down
32 changes: 30 additions & 2 deletions packages/@vue/cli/lib/promptModules/__tests__/e2e.spec.js
Expand Up @@ -14,7 +14,7 @@ test('cypress', async () => {
},
{
message: 'Pick an E2E testing solution',
choices: ['Cypress', 'Nightwatch'],
choices: ['Cypress', 'Nightwatch', 'WebdriverIO'],
choose: 0
}
]
Expand Down Expand Up @@ -42,7 +42,7 @@ test('nightwatch', async () => {
},
{
message: 'Pick an E2E testing solution',
choices: ['Cypress', 'Nightwatch'],
choices: ['Cypress', 'Nightwatch', 'WebdriverIO'],
choose: 1
},
{
Expand All @@ -65,3 +65,31 @@ test('nightwatch', async () => {
{ 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
}
]

const expectedOptions = {
plugins: {
'@vue/cli-plugin-e2e-webdriverio': {}
}
}

await assertPromptModule(
moduleToTest,
expectedPrompts,
expectedOptions,
{ pluginsOnly: true }
)
})
2 changes: 1 addition & 1 deletion packages/@vue/cli/lib/promptModules/e2e.js
Expand Up @@ -27,7 +27,7 @@ module.exports = cli => {
short: 'Nightwatch'
},
{
name: 'WebDriverIO (WebDriver/DevTools based)',
name: 'WebdriverIO (WebDriver/DevTools based)',
value: 'webdriverio',
short: 'WebdriverIO'
}
Expand Down

0 comments on commit 79d98a8

Please sign in to comment.