forked from LambdaTest/lambdatest-cypress-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
executable file
·169 lines (167 loc) · 4.33 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
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
#!/usr/bin/env node
const { init } = require("./commands/init");
const argv = require("yargs")
.usage("Usage: $0 <command> [options]")
.command("init", "create an intial config file", {}, function (argv) {
require("./commands/init")(argv);
})
.command(
"run",
"run tests on lambdatest",
function (yargs) {
return (
yargs
.option("ccf", {
alias: "cypress-config-file",
describe: "path of the config file",
type: "string",
})
.option("lcf", {
alias: "lambdatest-config-file",
describe: "path of the lambdatest config file",
type: "string",
})
.option("s", {
alias: "specs",
describe: "path of the spec file or directory or pattern",
type: "string",
})
.option("env", {
alias: "env",
describe: "environment",
type: "string",
})
.option("bn", {
alias: "build-name",
describe: "build name",
type: "string",
})
/*.option("t", {
alias: "tags",
describe: "build tags",
type: "string",
})*/
.option("p", {
alias: "parallels",
describe: "no of parellel sessions",
type: "string",
})
.option("envs", {
alias: "envs",
describe: "environment variables",
type: "string",
})
.option("tun", {
alias: "tunnel",
describe: "tunnel",
type: "string",
})
.option("tname", {
alias: "tunnel_name",
describe: "tunnel name",
type: "string",
})
.option("brs", {
alias: "browsers",
describe: "browsers to run test format: platform:browser:version",
type: "string",
})
.option("bi", {
alias: "build-identifier",
describe: "Build Identifier / Build Counter",
type: "string",
})
.option("if", {
alias: "ignore_files",
describe: "Files to ignore in the project zip",
type: "string",
})
.option("sync", {
alias: "sync",
describe: "Sync Build",
type: "string",
})
.option("autostart", {
alias: "tat",
describe: "Tunnel Auto Start",
type: "string",
})
.option("headless", {
alias: "headless",
describe: "Run in headless mode",
type: "boolean",
})
.option("net", {
alias: "network",
describe: "Capture Network logs",
type: "string",
})
);
},
function (argv) {
require("./commands/run")(argv);
}
)
.command(
"build-info",
"info about the build",
function (yargs) {
return yargs
.option("id", {
alias: "build-id",
describe: "Build Identifier",
type: "string",
demandOption: true,
})
.option("user", {
alias: "user",
describe: "username",
type: "string",
})
.option("access_key", {
alias: "access_key",
describe: "Access Key",
type: "string",
})
.option("env", {
alias: "env",
describe: "environment",
type: "string",
});
},
function (argv) {
require("./commands/build_info")(argv);
}
)
.command(
"build-stop",
"stop all tests in the build",
function (yargs) {
return yargs
.option("id", {
alias: "build-id",
describe: "Build Identifier",
type: "string",
demandOption: true,
})
.option("user", {
alias: "user",
describe: "username",
type: "string",
})
.option("access_key", {
alias: "access_key",
describe: "Access Key",
type: "string",
})
.option("env", {
alias: "env",
describe: "environment",
type: "string",
});
},
function (argv) {
require("./commands/build_stop")(argv);
}
)
.help().argv;