-
Notifications
You must be signed in to change notification settings - Fork 4
/
prompts.js
60 lines (57 loc) · 1.43 KB
/
prompts.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
/* eslint-disable no-return-assign */
const {
PLUGIN_NAME,
DEFAULT_BASE_URL,
DEFAULT_CAPABILITIES,
DEFAULT_SPECS,
DEFAULT_MODE,
MODES,
} = require('./lib/constants')
const en = require('./locales/en.json').io.piktur[PLUGIN_NAME].tasks.test
const { capabilities } = require('./lib/capabilities')
module.exports = (pkg) => {
let name
return [
{
name: name = 'config',
type: 'input',
default: undefined,
message: en[name],
}, {
name: name = 'specs',
type: 'input',
default: DEFAULT_SPECS,
message: en[name],
}, {
name: name = 'baseUrl',
type: 'input',
default: DEFAULT_BASE_URL,
message: en[name],
}, {
name: name = 'capabilities',
type: 'checkbox',
choices: capabilities.names.map(name => ({ name, value: name, checked: false })),
default: DEFAULT_CAPABILITIES,
message: en[name],
// when: ({ config }) => config === '',
}, {
name: name = 'headless',
type: 'confirm',
default: false,
message: en[name],
// when: ({ config }) => config === '',
}, {
name: name = 'debug',
type: 'confirm',
default: false,
message: en[name],
// when: ({ config }) => config === '',
}, {
name: name = 'mode',
type: 'list',
choices: MODES.map(name => ({ name, value: name, checked: false })),
default: DEFAULT_MODE,
message: en[name],
},
]
}