feat(ui): cypress task

This commit is contained in:
Guillaume Chau
2018-05-11 20:51:42 +02:00
parent 78a6ac8fe2
commit 7ecbd2a857
2 changed files with 47 additions and 3 deletions
@@ -0,0 +1,46 @@
module.exports = api => {
api.describeTask({
match: /vue-cli-service test:e2e/,
description: 'Run e2e tests with `cypress run`',
link: 'https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-e2e-cypress#injected-commands',
prompts: [
{
name: 'headless',
type: 'confirm',
default: false,
description: 'Run in headless mode without GUI'
},
{
name: 'mode',
type: 'list',
default: 'development',
choices: [
{
name: 'development',
value: 'development'
},
{
name: 'production',
value: 'production'
},
{
name: 'test',
value: 'test'
}
],
description: 'Specify the mode the dev server should run in'
},
{
name: 'url',
type: 'input',
default: '',
description: 'Run e2e tests against given url instead of auto-starting dev server'
}
],
onBeforeRun: ({ answers, args }) => {
if (answers.headless) args.push('--headless')
if (answers.mode) args.push('--mode', answers.mode)
if (answers.url) args.push('--url', answers.url)
}
})
}
+1 -3
View File
@@ -221,9 +221,7 @@ module.exports = api => {
}
],
onBeforeRun: ({ answers, args }) => {
if (answers.noFix) {
args.push('--no-fix')
}
if (answers.noFix) args.push('--no-fix')
}
})
}