-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
executable file
·70 lines (58 loc) · 1.8 KB
/
index.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
#!/usr/bin/env node
const yargs = require('yargs/yargs');
const { hideBin } = require('yargs/helpers');
const { launch } = require('./src/launch');
yargs(hideBin(process.argv))
.command(
'run [url]',
'launch a browser and start the tests',
yargs => {
yargs.positional('url', {
describe: 'URL exposing the tests running with mocha in the browser',
type: 'string',
default: 'http://localhost:7357',
});
yargs.option('headless', {
describe: 'launch the browser in headless mode',
type: 'boolean',
});
yargs.option('window-size', {
describe: 'specify the size of the brower window',
type: 'string',
default: '1920,1080',
});
yargs.option('iframe-size', {
describe: 'specify the size of the iframe containing the app',
type: 'string',
});
yargs.option('keep-open', {
describe: 'keep the browser open when all tests ended',
type: 'boolean',
});
yargs.option('devtool', {
describe: 'automatically open the devtool',
type: 'boolean',
});
yargs.option('screenshot', {
describe: 'save a screenshot when a test has failed',
type: 'boolean',
});
yargs.option('screenshots-dir', {
describe: 'specify a base directory where screenshots are saved',
type: 'string',
default: './screenshots',
});
yargs.option('hide-results', {
describe: "hide mocha runner's interface displaying the tests results",
type: 'boolean',
});
yargs.conflicts('headless', 'devtool');
yargs.conflicts('headless', 'keep-open');
},
launch,
)
.option('verbose', {
alias: 'v',
type: 'boolean',
description: 'Run with verbose logging',
}).argv;