@testingbot/cli 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +67 -8
- package/dist/models/espresso_options.d.ts +9 -0
- package/dist/models/espresso_options.d.ts.map +1 -1
- package/dist/models/espresso_options.js +14 -0
- package/dist/models/maestro_options.d.ts +19 -7
- package/dist/models/maestro_options.d.ts.map +1 -1
- package/dist/models/maestro_options.js +17 -8
- package/dist/models/testingbot_error.d.ts +3 -0
- package/dist/models/testingbot_error.d.ts.map +1 -1
- package/dist/models/testingbot_error.js +5 -0
- package/dist/models/xcuitest_options.d.ts +9 -0
- package/dist/models/xcuitest_options.d.ts.map +1 -1
- package/dist/models/xcuitest_options.js +14 -0
- package/dist/providers/base_provider.d.ts +119 -0
- package/dist/providers/base_provider.d.ts.map +1 -0
- package/dist/providers/base_provider.js +296 -0
- package/dist/providers/espresso.d.ts +14 -21
- package/dist/providers/espresso.d.ts.map +1 -1
- package/dist/providers/espresso.js +39 -168
- package/dist/providers/login.d.ts +1 -0
- package/dist/providers/login.d.ts.map +1 -1
- package/dist/providers/login.js +17 -8
- package/dist/providers/maestro.d.ts +54 -22
- package/dist/providers/maestro.d.ts.map +1 -1
- package/dist/providers/maestro.js +683 -286
- package/dist/providers/xcuitest.d.ts +14 -21
- package/dist/providers/xcuitest.d.ts.map +1 -1
- package/dist/providers/xcuitest.js +39 -168
- package/dist/upload.d.ts +11 -4
- package/dist/upload.d.ts.map +1 -1
- package/dist/upload.js +80 -35
- package/dist/utils/connectivity.d.ts +25 -0
- package/dist/utils/connectivity.d.ts.map +1 -0
- package/dist/utils/connectivity.js +118 -0
- package/dist/utils/error-helpers.d.ts +26 -0
- package/dist/utils/error-helpers.d.ts.map +1 -0
- package/dist/utils/error-helpers.js +237 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +7 -2
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
[](https://github.com/testingbot/testingbotctl/actions/workflows/test.yml)
|
|
2
|
+
[](https://www.npmjs.com/package/@testingbot/cli)
|
|
2
3
|
|
|
3
4
|
# TestingBot CLI
|
|
4
5
|
|
|
@@ -97,8 +98,8 @@ testingbot maestro app.apk ./flows/smoke ./flows/regression ./flows/e2e
|
|
|
97
98
|
# With device selection
|
|
98
99
|
testingbot maestro app.apk ./flows --device "Pixel 8" --deviceVersion "14"
|
|
99
100
|
|
|
100
|
-
#
|
|
101
|
-
testingbot maestro app.
|
|
101
|
+
# Android app on real device with tags
|
|
102
|
+
testingbot maestro app.apk ./flows --device "Samsung Galaxy S24" --real-device --include-tags "smoke,regression"
|
|
102
103
|
|
|
103
104
|
# With environment variables
|
|
104
105
|
testingbot maestro app.apk ./flows -e API_URL=https://staging.example.com -e API_KEY=secret
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0BpC,QAAA,MAAM,OAAO,SAAgB,CAAC;AAwkB9B,eAAe,OAAO,CAAC"}
|
package/dist/cli.js
CHANGED
|
@@ -14,6 +14,7 @@ const package_json_1 = __importDefault(require("../package.json"));
|
|
|
14
14
|
const maestro_options_1 = __importDefault(require("./models/maestro_options"));
|
|
15
15
|
const maestro_1 = __importDefault(require("./providers/maestro"));
|
|
16
16
|
const login_1 = __importDefault(require("./providers/login"));
|
|
17
|
+
const testingbot_error_1 = __importDefault(require("./models/testingbot_error"));
|
|
17
18
|
const program = new commander_1.Command();
|
|
18
19
|
program
|
|
19
20
|
.name('testingbot')
|
|
@@ -59,6 +60,11 @@ const espressoCommand = program
|
|
|
59
60
|
// Report options
|
|
60
61
|
.option('--report <format>', 'Download test report after completion: html or junit.', (val) => val.toLowerCase())
|
|
61
62
|
.option('--report-output-dir <path>', 'Directory to save test reports (required when --report is used).')
|
|
63
|
+
// CI/CD metadata
|
|
64
|
+
.option('--commit-sha <sha>', 'The commit SHA of this upload.')
|
|
65
|
+
.option('--pull-request-id <id>', 'The ID of the pull request this upload originated from.')
|
|
66
|
+
.option('--repo-name <name>', 'Repository name (e.g., GitHub repo slug).')
|
|
67
|
+
.option('--repo-owner <owner>', 'Repository owner (e.g., GitHub organization or user slug).')
|
|
62
68
|
// Authentication
|
|
63
69
|
.option('--api-key <key>', 'TestingBot API key.')
|
|
64
70
|
.option('--api-secret <secret>', 'TestingBot API secret.')
|
|
@@ -71,6 +77,14 @@ const espressoCommand = program
|
|
|
71
77
|
espressoCommand.help();
|
|
72
78
|
return;
|
|
73
79
|
}
|
|
80
|
+
const metadata = args.commitSha || args.pullRequestId || args.repoName || args.repoOwner
|
|
81
|
+
? {
|
|
82
|
+
commitSha: args.commitSha,
|
|
83
|
+
pullRequestId: args.pullRequestId,
|
|
84
|
+
repoName: args.repoName,
|
|
85
|
+
repoOwner: args.repoOwner,
|
|
86
|
+
}
|
|
87
|
+
: undefined;
|
|
74
88
|
const options = new espresso_options_1.default(app, testApp, args.device, {
|
|
75
89
|
version: args.platformVersion,
|
|
76
90
|
realDevice: args.realDevice,
|
|
@@ -95,13 +109,18 @@ const espressoCommand = program
|
|
|
95
109
|
async: args.async,
|
|
96
110
|
report: args.report,
|
|
97
111
|
reportOutputDir: args.reportOutputDir,
|
|
112
|
+
metadata,
|
|
98
113
|
});
|
|
99
114
|
const credentials = await auth_1.default.getCredentials({
|
|
100
115
|
apiKey: args.apiKey,
|
|
101
116
|
apiSecret: args.apiSecret,
|
|
102
117
|
});
|
|
103
118
|
if (credentials === null) {
|
|
104
|
-
throw new
|
|
119
|
+
throw new testingbot_error_1.default('No TestingBot credentials found. Please authenticate using one of these methods:\n' +
|
|
120
|
+
' 1. Run "testingbot login" to authenticate via browser (recommended)\n' +
|
|
121
|
+
' 2. Use --api-key and --api-secret options\n' +
|
|
122
|
+
' 3. Set TB_KEY and TB_SECRET environment variables\n' +
|
|
123
|
+
' 4. Create ~/.testingbot file with content: key:secret');
|
|
105
124
|
}
|
|
106
125
|
const espresso = new espresso_1.default(credentials, options);
|
|
107
126
|
const result = await espresso.run();
|
|
@@ -131,8 +150,7 @@ const maestroCommand = program
|
|
|
131
150
|
.option('--device-locale <locale>', 'Device locale (e.g., "en_US", "de_DE").')
|
|
132
151
|
.option('--timezone <timezone>', 'Device timezone (e.g., "America/New_York", "Europe/London").')
|
|
133
152
|
// Test metadata
|
|
134
|
-
.option('--name <name>', '
|
|
135
|
-
.option('--build <build>', 'Build identifier for grouping test runs.')
|
|
153
|
+
.option('--name <name>', 'Name for this Maestro run.')
|
|
136
154
|
// Network and geo
|
|
137
155
|
.option('--throttle-network <speed>', 'Network throttling: 4G, 3G, Edge, airplane, or disable.', (val) => val)
|
|
138
156
|
.option('--geo-country-code <code>', 'Geographic IP location (ISO country code, e.g., "US", "DE").')
|
|
@@ -153,8 +171,15 @@ const maestroCommand = program
|
|
|
153
171
|
.option('--report <format>', 'Download test report after completion: html or junit.', (val) => val.toLowerCase())
|
|
154
172
|
.option('--report-output-dir <path>', 'Directory to save test reports (required when --report is used).')
|
|
155
173
|
// Artifact download
|
|
156
|
-
.option('--download-artifacts', 'Download test artifacts (
|
|
174
|
+
.option('--download-artifacts [mode]', 'Download test artifacts after completion. Mode: all (default) or failed.', (val) => (val === 'failed' ? 'failed' : 'all'))
|
|
157
175
|
.option('--artifacts-output-dir <path>', 'Directory to save artifacts zip (defaults to current directory).')
|
|
176
|
+
.option('--ignore-checksum-check', 'Skip checksum verification and always upload the app.')
|
|
177
|
+
.option('--shard-split <number>', 'Number of chunks to split flows into (by default each flow runs on its own session).', (val) => parseInt(val, 10))
|
|
178
|
+
// CI/CD metadata
|
|
179
|
+
.option('--commit-sha <sha>', 'The commit SHA of this upload.')
|
|
180
|
+
.option('--pull-request-id <id>', 'The ID of the pull request this upload originated from.')
|
|
181
|
+
.option('--repo-name <name>', 'Repository name (e.g., GitHub repo slug).')
|
|
182
|
+
.option('--repo-owner <owner>', 'Repository owner (e.g., GitHub organization or user slug).')
|
|
158
183
|
// Authentication
|
|
159
184
|
.option('--api-key <key>', 'TestingBot API key.')
|
|
160
185
|
.option('--api-secret <secret>', 'TestingBot API secret.')
|
|
@@ -188,13 +213,20 @@ const maestroCommand = program
|
|
|
188
213
|
env[key] = value;
|
|
189
214
|
}
|
|
190
215
|
}
|
|
216
|
+
const metadata = args.commitSha || args.pullRequestId || args.repoName || args.repoOwner
|
|
217
|
+
? {
|
|
218
|
+
commitSha: args.commitSha,
|
|
219
|
+
pullRequestId: args.pullRequestId,
|
|
220
|
+
repoName: args.repoName,
|
|
221
|
+
repoOwner: args.repoOwner,
|
|
222
|
+
}
|
|
223
|
+
: undefined;
|
|
191
224
|
const options = new maestro_options_1.default(app, flows, args.device, {
|
|
192
225
|
includeTags: args.includeTags,
|
|
193
226
|
excludeTags: args.excludeTags,
|
|
194
227
|
platformName: args.platform,
|
|
195
228
|
version: args.deviceVersion,
|
|
196
229
|
name: args.name,
|
|
197
|
-
build: args.build,
|
|
198
230
|
orientation: args.orientation,
|
|
199
231
|
locale: args.deviceLocale,
|
|
200
232
|
timeZone: args.timezone,
|
|
@@ -207,15 +239,24 @@ const maestroCommand = program
|
|
|
207
239
|
report: args.report,
|
|
208
240
|
reportOutputDir: args.reportOutputDir,
|
|
209
241
|
realDevice: args.realDevice,
|
|
210
|
-
downloadArtifacts: args.downloadArtifacts
|
|
242
|
+
downloadArtifacts: args.downloadArtifacts === true
|
|
243
|
+
? 'all'
|
|
244
|
+
: args.downloadArtifacts,
|
|
211
245
|
artifactsOutputDir: args.artifactsOutputDir,
|
|
246
|
+
ignoreChecksumCheck: args.ignoreChecksumCheck,
|
|
247
|
+
shardSplit: args.shardSplit,
|
|
248
|
+
metadata,
|
|
212
249
|
});
|
|
213
250
|
const credentials = await auth_1.default.getCredentials({
|
|
214
251
|
apiKey: args.apiKey,
|
|
215
252
|
apiSecret: args.apiSecret,
|
|
216
253
|
});
|
|
217
254
|
if (credentials === null) {
|
|
218
|
-
throw new
|
|
255
|
+
throw new testingbot_error_1.default('No TestingBot credentials found. Please authenticate using one of these methods:\n' +
|
|
256
|
+
' 1. Run "testingbot login" to authenticate via browser (recommended)\n' +
|
|
257
|
+
' 2. Use --api-key and --api-secret options\n' +
|
|
258
|
+
' 3. Set TB_KEY and TB_SECRET environment variables\n' +
|
|
259
|
+
' 4. Create ~/.testingbot file with content: key:secret');
|
|
219
260
|
}
|
|
220
261
|
const maestro = new maestro_1.default(credentials, options);
|
|
221
262
|
const result = await maestro.run();
|
|
@@ -261,6 +302,11 @@ const xcuitestCommand = program
|
|
|
261
302
|
// Report options
|
|
262
303
|
.option('--report <format>', 'Download test report after completion: html or junit.', (val) => val.toLowerCase())
|
|
263
304
|
.option('--report-output-dir <path>', 'Directory to save test reports (required when --report is used).')
|
|
305
|
+
// CI/CD metadata
|
|
306
|
+
.option('--commit-sha <sha>', 'The commit SHA of this upload.')
|
|
307
|
+
.option('--pull-request-id <id>', 'The ID of the pull request this upload originated from.')
|
|
308
|
+
.option('--repo-name <name>', 'Repository name (e.g., GitHub repo slug).')
|
|
309
|
+
.option('--repo-owner <owner>', 'Repository owner (e.g., GitHub organization or user slug).')
|
|
264
310
|
// Authentication
|
|
265
311
|
.option('--api-key <key>', 'TestingBot API key.')
|
|
266
312
|
.option('--api-secret <secret>', 'TestingBot API secret.')
|
|
@@ -273,6 +319,14 @@ const xcuitestCommand = program
|
|
|
273
319
|
xcuitestCommand.help();
|
|
274
320
|
return;
|
|
275
321
|
}
|
|
322
|
+
const metadata = args.commitSha || args.pullRequestId || args.repoName || args.repoOwner
|
|
323
|
+
? {
|
|
324
|
+
commitSha: args.commitSha,
|
|
325
|
+
pullRequestId: args.pullRequestId,
|
|
326
|
+
repoName: args.repoName,
|
|
327
|
+
repoOwner: args.repoOwner,
|
|
328
|
+
}
|
|
329
|
+
: undefined;
|
|
276
330
|
const options = new xcuitest_options_1.default(app, testApp, args.device, {
|
|
277
331
|
version: args.platformVersion,
|
|
278
332
|
realDevice: args.realDevice,
|
|
@@ -290,13 +344,18 @@ const xcuitestCommand = program
|
|
|
290
344
|
async: args.async,
|
|
291
345
|
report: args.report,
|
|
292
346
|
reportOutputDir: args.reportOutputDir,
|
|
347
|
+
metadata,
|
|
293
348
|
});
|
|
294
349
|
const credentials = await auth_1.default.getCredentials({
|
|
295
350
|
apiKey: args.apiKey,
|
|
296
351
|
apiSecret: args.apiSecret,
|
|
297
352
|
});
|
|
298
353
|
if (credentials === null) {
|
|
299
|
-
throw new
|
|
354
|
+
throw new testingbot_error_1.default('No TestingBot credentials found. Please authenticate using one of these methods:\n' +
|
|
355
|
+
' 1. Run "testingbot login" to authenticate via browser (recommended)\n' +
|
|
356
|
+
' 2. Use --api-key and --api-secret options\n' +
|
|
357
|
+
' 3. Set TB_KEY and TB_SECRET environment variables\n' +
|
|
358
|
+
' 4. Create ~/.testingbot file with content: key:secret');
|
|
300
359
|
}
|
|
301
360
|
const xcuitest = new xcuitest_1.default(credentials, options);
|
|
302
361
|
const result = await xcuitest.run();
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export type TestSize = 'small' | 'medium' | 'large';
|
|
2
2
|
export type ReportFormat = 'html' | 'junit';
|
|
3
3
|
export type ThrottleNetwork = '4G' | '3G' | 'Edge' | 'airplane';
|
|
4
|
+
export interface RunMetadata {
|
|
5
|
+
commitSha?: string;
|
|
6
|
+
pullRequestId?: string;
|
|
7
|
+
repoName?: string;
|
|
8
|
+
repoOwner?: string;
|
|
9
|
+
}
|
|
4
10
|
export interface CustomNetworkProfile {
|
|
5
11
|
uploadSpeed: number;
|
|
6
12
|
downloadSpeed: number;
|
|
@@ -59,6 +65,7 @@ export default class EspressoOptions {
|
|
|
59
65
|
private _async;
|
|
60
66
|
private _report?;
|
|
61
67
|
private _reportOutputDir?;
|
|
68
|
+
private _metadata?;
|
|
62
69
|
constructor(app: string, testApp: string, device?: string, options?: {
|
|
63
70
|
version?: string;
|
|
64
71
|
realDevice?: boolean;
|
|
@@ -83,6 +90,7 @@ export default class EspressoOptions {
|
|
|
83
90
|
async?: boolean;
|
|
84
91
|
report?: ReportFormat;
|
|
85
92
|
reportOutputDir?: string;
|
|
93
|
+
metadata?: RunMetadata;
|
|
86
94
|
});
|
|
87
95
|
get app(): string;
|
|
88
96
|
get testApp(): string;
|
|
@@ -110,6 +118,7 @@ export default class EspressoOptions {
|
|
|
110
118
|
get async(): boolean;
|
|
111
119
|
get report(): ReportFormat | undefined;
|
|
112
120
|
get reportOutputDir(): string | undefined;
|
|
121
|
+
get metadata(): RunMetadata | undefined;
|
|
113
122
|
getCapabilities(): EspressoCapabilities;
|
|
114
123
|
getEspressoOptions(): EspressoRunOptions | undefined;
|
|
115
124
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"espresso_options.d.ts","sourceRoot":"","sources":["../../src/models/espresso_options.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"espresso_options.d.ts","sourceRoot":"","sources":["../../src/models/espresso_options.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AACpD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;AAC5C,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,UAAU,CAAC;AAEhE,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC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;IAED,IAAW,UAAU,IAAI,MAAM,EAAE,GAAG,SAAS,CAE5C;IAED,IAAW,aAAa,IAAI,MAAM,EAAE,GAAG,SAAS,CAE/C;IAED,IAAW,IAAI,IAAI,QAAQ,EAAE,GAAG,SAAS,CAExC;IAED,IAAW,QAAQ,IAAI,MAAM,GAAG,SAAS,CAExC;IAED,IAAW,MAAM,IAAI,MAAM,GAAG,SAAS,CAEtC;IAED,IAAW,QAAQ,IAAI,MAAM,GAAG,SAAS,CAExC;IAED,IAAW,WAAW,IAAI,MAAM,GAAG,SAAS,CAE3C;IAED,IAAW,eAAe,IACtB,eAAe,GACf,oBAAoB,GACpB,SAAS,CAEZ;IAED,IAAW,KAAK,IAAI,OAAO,CAE1B;IAED,IAAW,KAAK,IAAI,OAAO,CAE1B;IAED,IAAW,MAAM,IAAI,YAAY,GAAG,SAAS,CAE5C;IAED,IAAW,eAAe,IAAI,MAAM,GAAG,SAAS,CAE/C;IAED,IAAW,QAAQ,IAAI,WAAW,GAAG,SAAS,CAE7C;IAEM,eAAe,IAAI,oBAAoB;IAgBvC,kBAAkB,IAAI,kBAAkB,GAAG,SAAS;CA0B5D"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const testingbot_error_1 = __importDefault(require("./testingbot_error"));
|
|
3
7
|
class EspressoOptions {
|
|
4
8
|
_app;
|
|
5
9
|
_testApp;
|
|
@@ -32,6 +36,8 @@ class EspressoOptions {
|
|
|
32
36
|
_async;
|
|
33
37
|
_report;
|
|
34
38
|
_reportOutputDir;
|
|
39
|
+
// Metadata
|
|
40
|
+
_metadata;
|
|
35
41
|
constructor(app, testApp, device, options) {
|
|
36
42
|
this._app = app;
|
|
37
43
|
this._testApp = testApp;
|
|
@@ -40,6 +46,10 @@ class EspressoOptions {
|
|
|
40
46
|
this._realDevice = options?.realDevice ?? false;
|
|
41
47
|
this._tabletOnly = options?.tabletOnly ?? false;
|
|
42
48
|
this._phoneOnly = options?.phoneOnly ?? false;
|
|
49
|
+
// Validate contradictory options
|
|
50
|
+
if (this._tabletOnly && this._phoneOnly) {
|
|
51
|
+
throw new testingbot_error_1.default('Cannot specify both --phone-only and --tablet-only options');
|
|
52
|
+
}
|
|
43
53
|
this._name = options?.name;
|
|
44
54
|
this._build = options?.build;
|
|
45
55
|
this._testRunner = options?.testRunner;
|
|
@@ -59,6 +69,7 @@ class EspressoOptions {
|
|
|
59
69
|
this._async = options?.async ?? false;
|
|
60
70
|
this._report = options?.report;
|
|
61
71
|
this._reportOutputDir = options?.reportOutputDir;
|
|
72
|
+
this._metadata = options?.metadata;
|
|
62
73
|
}
|
|
63
74
|
get app() {
|
|
64
75
|
return this._app;
|
|
@@ -138,6 +149,9 @@ class EspressoOptions {
|
|
|
138
149
|
get reportOutputDir() {
|
|
139
150
|
return this._reportOutputDir;
|
|
140
151
|
}
|
|
152
|
+
get metadata() {
|
|
153
|
+
return this._metadata;
|
|
154
|
+
}
|
|
141
155
|
getCapabilities() {
|
|
142
156
|
const caps = {
|
|
143
157
|
platformName: 'Android',
|
|
@@ -7,12 +7,18 @@ export interface MaestroConfig {
|
|
|
7
7
|
export type Orientation = 'PORTRAIT' | 'LANDSCAPE';
|
|
8
8
|
export type ThrottleNetwork = '4G' | '3G' | 'Edge' | 'airplane' | 'disable';
|
|
9
9
|
export type ReportFormat = 'html' | 'junit';
|
|
10
|
+
export type ArtifactDownloadMode = 'all' | 'failed';
|
|
11
|
+
export interface RunMetadata {
|
|
12
|
+
commitSha?: string;
|
|
13
|
+
pullRequestId?: string;
|
|
14
|
+
repoName?: string;
|
|
15
|
+
repoOwner?: string;
|
|
16
|
+
}
|
|
10
17
|
export interface MaestroCapabilities {
|
|
11
18
|
platformName?: 'Android' | 'iOS';
|
|
12
19
|
version?: string;
|
|
13
20
|
deviceName: string;
|
|
14
21
|
name?: string;
|
|
15
|
-
build?: string;
|
|
16
22
|
orientation?: Orientation;
|
|
17
23
|
locale?: string;
|
|
18
24
|
timeZone?: string;
|
|
@@ -35,7 +41,6 @@ export default class MaestroOptions {
|
|
|
35
41
|
private _platformName?;
|
|
36
42
|
private _version?;
|
|
37
43
|
private _name?;
|
|
38
|
-
private _build?;
|
|
39
44
|
private _orientation?;
|
|
40
45
|
private _locale?;
|
|
41
46
|
private _timeZone?;
|
|
@@ -48,15 +53,17 @@ export default class MaestroOptions {
|
|
|
48
53
|
private _report?;
|
|
49
54
|
private _reportOutputDir?;
|
|
50
55
|
private _realDevice;
|
|
51
|
-
private _downloadArtifacts
|
|
56
|
+
private _downloadArtifacts?;
|
|
52
57
|
private _artifactsOutputDir?;
|
|
58
|
+
private _ignoreChecksumCheck;
|
|
59
|
+
private _shardSplit?;
|
|
60
|
+
private _metadata?;
|
|
53
61
|
constructor(app: string, flows: string | string[], device?: string, options?: {
|
|
54
62
|
includeTags?: string[];
|
|
55
63
|
excludeTags?: string[];
|
|
56
64
|
platformName?: 'Android' | 'iOS';
|
|
57
65
|
version?: string;
|
|
58
66
|
name?: string;
|
|
59
|
-
build?: string;
|
|
60
67
|
orientation?: Orientation;
|
|
61
68
|
locale?: string;
|
|
62
69
|
timeZone?: string;
|
|
@@ -69,8 +76,11 @@ export default class MaestroOptions {
|
|
|
69
76
|
report?: ReportFormat;
|
|
70
77
|
reportOutputDir?: string;
|
|
71
78
|
realDevice?: boolean;
|
|
72
|
-
downloadArtifacts?:
|
|
79
|
+
downloadArtifacts?: ArtifactDownloadMode;
|
|
73
80
|
artifactsOutputDir?: string;
|
|
81
|
+
ignoreChecksumCheck?: boolean;
|
|
82
|
+
shardSplit?: number;
|
|
83
|
+
metadata?: RunMetadata;
|
|
74
84
|
});
|
|
75
85
|
get app(): string;
|
|
76
86
|
get flows(): string[];
|
|
@@ -80,7 +90,6 @@ export default class MaestroOptions {
|
|
|
80
90
|
get platformName(): 'Android' | 'iOS' | undefined;
|
|
81
91
|
get version(): string | undefined;
|
|
82
92
|
get name(): string | undefined;
|
|
83
|
-
get build(): string | undefined;
|
|
84
93
|
get orientation(): Orientation | undefined;
|
|
85
94
|
get locale(): string | undefined;
|
|
86
95
|
get timeZone(): string | undefined;
|
|
@@ -93,8 +102,11 @@ export default class MaestroOptions {
|
|
|
93
102
|
get report(): ReportFormat | undefined;
|
|
94
103
|
get reportOutputDir(): string | undefined;
|
|
95
104
|
get realDevice(): boolean;
|
|
96
|
-
get downloadArtifacts():
|
|
105
|
+
get downloadArtifacts(): ArtifactDownloadMode | undefined;
|
|
97
106
|
get artifactsOutputDir(): string | undefined;
|
|
107
|
+
get ignoreChecksumCheck(): boolean;
|
|
108
|
+
get shardSplit(): number | undefined;
|
|
109
|
+
get metadata(): RunMetadata | undefined;
|
|
98
110
|
getMaestroOptions(): MaestroRunOptions | undefined;
|
|
99
111
|
getCapabilities(detectedPlatform?: 'Android' | 'iOS'): MaestroCapabilities;
|
|
100
112
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maestro_options.d.ts","sourceRoot":"","sources":["../../src/models/maestro_options.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;CACtC;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,WAAW,CAAC;AACnD,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;AAC5E,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"maestro_options.d.ts","sourceRoot":"","sources":["../../src/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ED,IAAW,QAAQ,IAAI,MAAM,GAAG,SAAS,CAExC;IAED,IAAW,eAAe,IAAI,eAAe,GAAG,SAAS,CAExD;IAED,IAAW,cAAc,IAAI,MAAM,GAAG,SAAS,CAE9C;IAED,IAAW,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAEnD;IAED,IAAW,cAAc,IAAI,MAAM,GAAG,SAAS,CAE9C;IAED,IAAW,KAAK,IAAI,OAAO,CAE1B;IAED,IAAW,KAAK,IAAI,OAAO,CAE1B;IAED,IAAW,MAAM,IAAI,YAAY,GAAG,SAAS,CAE5C;IAED,IAAW,eAAe,IAAI,MAAM,GAAG,SAAS,CAE/C;IAED,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED,IAAW,iBAAiB,IAAI,oBAAoB,GAAG,SAAS,CAE/D;IAED,IAAW,kBAAkB,IAAI,MAAM,GAAG,SAAS,CAElD;IAED,IAAW,mBAAmB,IAAI,OAAO,CAExC;IAED,IAAW,UAAU,IAAI,MAAM,GAAG,SAAS,CAE1C;IAED,IAAW,QAAQ,IAAI,WAAW,GAAG,SAAS,CAE7C;IAEM,iBAAiB,IAAI,iBAAiB,GAAG,SAAS;IAmBlD,eAAe,CACpB,gBAAgB,CAAC,EAAE,SAAS,GAAG,KAAK,GACnC,mBAAmB;CAiCvB"}
|
|
@@ -9,7 +9,6 @@ class MaestroOptions {
|
|
|
9
9
|
_platformName;
|
|
10
10
|
_version;
|
|
11
11
|
_name;
|
|
12
|
-
_build;
|
|
13
12
|
_orientation;
|
|
14
13
|
_locale;
|
|
15
14
|
_timeZone;
|
|
@@ -24,6 +23,10 @@ class MaestroOptions {
|
|
|
24
23
|
_realDevice;
|
|
25
24
|
_downloadArtifacts;
|
|
26
25
|
_artifactsOutputDir;
|
|
26
|
+
_ignoreChecksumCheck;
|
|
27
|
+
_shardSplit;
|
|
28
|
+
// Metadata
|
|
29
|
+
_metadata;
|
|
27
30
|
constructor(app, flows, device, options) {
|
|
28
31
|
this._app = app;
|
|
29
32
|
this._flows = flows ? (Array.isArray(flows) ? flows : [flows]) : [];
|
|
@@ -33,7 +36,6 @@ class MaestroOptions {
|
|
|
33
36
|
this._platformName = options?.platformName;
|
|
34
37
|
this._version = options?.version;
|
|
35
38
|
this._name = options?.name;
|
|
36
|
-
this._build = options?.build;
|
|
37
39
|
this._orientation = options?.orientation;
|
|
38
40
|
this._locale = options?.locale;
|
|
39
41
|
this._timeZone = options?.timeZone;
|
|
@@ -46,8 +48,11 @@ class MaestroOptions {
|
|
|
46
48
|
this._report = options?.report;
|
|
47
49
|
this._reportOutputDir = options?.reportOutputDir;
|
|
48
50
|
this._realDevice = options?.realDevice ?? false;
|
|
49
|
-
this._downloadArtifacts = options?.downloadArtifacts
|
|
51
|
+
this._downloadArtifacts = options?.downloadArtifacts;
|
|
50
52
|
this._artifactsOutputDir = options?.artifactsOutputDir;
|
|
53
|
+
this._ignoreChecksumCheck = options?.ignoreChecksumCheck ?? false;
|
|
54
|
+
this._shardSplit = options?.shardSplit;
|
|
55
|
+
this._metadata = options?.metadata;
|
|
51
56
|
}
|
|
52
57
|
get app() {
|
|
53
58
|
return this._app;
|
|
@@ -73,9 +78,6 @@ class MaestroOptions {
|
|
|
73
78
|
get name() {
|
|
74
79
|
return this._name;
|
|
75
80
|
}
|
|
76
|
-
get build() {
|
|
77
|
-
return this._build;
|
|
78
|
-
}
|
|
79
81
|
get orientation() {
|
|
80
82
|
return this._orientation;
|
|
81
83
|
}
|
|
@@ -118,6 +120,15 @@ class MaestroOptions {
|
|
|
118
120
|
get artifactsOutputDir() {
|
|
119
121
|
return this._artifactsOutputDir;
|
|
120
122
|
}
|
|
123
|
+
get ignoreChecksumCheck() {
|
|
124
|
+
return this._ignoreChecksumCheck;
|
|
125
|
+
}
|
|
126
|
+
get shardSplit() {
|
|
127
|
+
return this._shardSplit;
|
|
128
|
+
}
|
|
129
|
+
get metadata() {
|
|
130
|
+
return this._metadata;
|
|
131
|
+
}
|
|
121
132
|
getMaestroOptions() {
|
|
122
133
|
const opts = {};
|
|
123
134
|
if (this._includeTags && this._includeTags.length > 0) {
|
|
@@ -156,8 +167,6 @@ class MaestroOptions {
|
|
|
156
167
|
caps.version = this._version;
|
|
157
168
|
if (this._name)
|
|
158
169
|
caps.name = this._name;
|
|
159
|
-
if (this._build)
|
|
160
|
-
caps.build = this._build;
|
|
161
170
|
if (this._orientation)
|
|
162
171
|
caps.orientation = this._orientation;
|
|
163
172
|
if (this._locale)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testingbot_error.d.ts","sourceRoot":"","sources":["../../src/models/testingbot_error.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"testingbot_error.d.ts","sourceRoot":"","sources":["../../src/models/testingbot_error.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,KAAK;gBACpC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAK3D"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
class TestingBotError extends Error {
|
|
4
|
+
constructor(message, options) {
|
|
5
|
+
super(message, options);
|
|
6
|
+
this.name = 'TestingBotError';
|
|
7
|
+
Object.setPrototypeOf(this, TestingBotError.prototype);
|
|
8
|
+
}
|
|
4
9
|
}
|
|
5
10
|
exports.default = TestingBotError;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export type Orientation = 'PORTRAIT' | 'LANDSCAPE';
|
|
2
2
|
export type ReportFormat = 'html' | 'junit';
|
|
3
3
|
export type ThrottleNetwork = '4G' | '3G' | 'Edge' | 'airplane';
|
|
4
|
+
export interface RunMetadata {
|
|
5
|
+
commitSha?: string;
|
|
6
|
+
pullRequestId?: string;
|
|
7
|
+
repoName?: string;
|
|
8
|
+
repoOwner?: string;
|
|
9
|
+
}
|
|
4
10
|
export interface CustomNetworkProfile {
|
|
5
11
|
uploadSpeed: number;
|
|
6
12
|
downloadSpeed: number;
|
|
@@ -45,6 +51,7 @@ export default class XCUITestOptions {
|
|
|
45
51
|
private _async;
|
|
46
52
|
private _report?;
|
|
47
53
|
private _reportOutputDir?;
|
|
54
|
+
private _metadata?;
|
|
48
55
|
constructor(app: string, testApp: string, device?: string, options?: {
|
|
49
56
|
version?: string;
|
|
50
57
|
realDevice?: boolean;
|
|
@@ -62,6 +69,7 @@ export default class XCUITestOptions {
|
|
|
62
69
|
async?: boolean;
|
|
63
70
|
report?: ReportFormat;
|
|
64
71
|
reportOutputDir?: string;
|
|
72
|
+
metadata?: RunMetadata;
|
|
65
73
|
});
|
|
66
74
|
get app(): string;
|
|
67
75
|
get testApp(): string;
|
|
@@ -82,6 +90,7 @@ export default class XCUITestOptions {
|
|
|
82
90
|
get async(): boolean;
|
|
83
91
|
get report(): ReportFormat | undefined;
|
|
84
92
|
get reportOutputDir(): string | undefined;
|
|
93
|
+
get metadata(): RunMetadata | undefined;
|
|
85
94
|
getCapabilities(): XCUITestCapabilities;
|
|
86
95
|
getXCUITestOptions(): XCUITestRunOptions | undefined;
|
|
87
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xcuitest_options.d.ts","sourceRoot":"","sources":["../../src/models/xcuitest_options.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"xcuitest_options.d.ts","sourceRoot":"","sources":["../../src/models/xcuitest_options.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,WAAW,CAAC;AACnD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;AAC5C,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,UAAU,CAAC;AAEhE,MAAM,WAAW,WAAW;IA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CAEtC;IAED,IAAW,OAAO,IAAI,MAAM,GAAG,SAAS,CAEvC;IAED,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED,IAAW,SAAS,IAAI,OAAO,CAE9B;IAED,IAAW,IAAI,IAAI,MAAM,GAAG,SAAS,CAEpC;IAED,IAAW,KAAK,IAAI,MAAM,GAAG,SAAS,CAErC;IAED,IAAW,WAAW,IAAI,WAAW,GAAG,SAAS,CAEhD;IAED,IAAW,QAAQ,IAAI,MAAM,GAAG,SAAS,CAExC;IAED,IAAW,MAAM,IAAI,MAAM,GAAG,SAAS,CAEtC;IAED,IAAW,QAAQ,IAAI,MAAM,GAAG,SAAS,CAExC;IAED,IAAW,WAAW,IAAI,MAAM,GAAG,SAAS,CAE3C;IAED,IAAW,eAAe,IACtB,eAAe,GACf,oBAAoB,GACpB,SAAS,CAEZ;IAED,IAAW,KAAK,IAAI,OAAO,CAE1B;IAED,IAAW,KAAK,IAAI,OAAO,CAE1B;IAED,IAAW,MAAM,IAAI,YAAY,GAAG,SAAS,CAE5C;IAED,IAAW,eAAe,IAAI,MAAM,GAAG,SAAS,CAE/C;IAED,IAAW,QAAQ,IAAI,WAAW,GAAG,SAAS,CAE7C;IAEM,eAAe,IAAI,oBAAoB;IAgBvC,kBAAkB,IAAI,kBAAkB,GAAG,SAAS;CAgB5D"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const testingbot_error_1 = __importDefault(require("./testingbot_error"));
|
|
3
7
|
class XCUITestOptions {
|
|
4
8
|
_app;
|
|
5
9
|
_testApp;
|
|
@@ -25,6 +29,8 @@ class XCUITestOptions {
|
|
|
25
29
|
_async;
|
|
26
30
|
_report;
|
|
27
31
|
_reportOutputDir;
|
|
32
|
+
// Metadata
|
|
33
|
+
_metadata;
|
|
28
34
|
constructor(app, testApp, device, options) {
|
|
29
35
|
this._app = app;
|
|
30
36
|
this._testApp = testApp;
|
|
@@ -33,6 +39,10 @@ class XCUITestOptions {
|
|
|
33
39
|
this._realDevice = options?.realDevice ?? false;
|
|
34
40
|
this._tabletOnly = options?.tabletOnly ?? false;
|
|
35
41
|
this._phoneOnly = options?.phoneOnly ?? false;
|
|
42
|
+
// Validate contradictory options
|
|
43
|
+
if (this._tabletOnly && this._phoneOnly) {
|
|
44
|
+
throw new testingbot_error_1.default('Cannot specify both --phone-only and --tablet-only options');
|
|
45
|
+
}
|
|
36
46
|
this._name = options?.name;
|
|
37
47
|
this._build = options?.build;
|
|
38
48
|
this._orientation = options?.orientation;
|
|
@@ -45,6 +55,7 @@ class XCUITestOptions {
|
|
|
45
55
|
this._async = options?.async ?? false;
|
|
46
56
|
this._report = options?.report;
|
|
47
57
|
this._reportOutputDir = options?.reportOutputDir;
|
|
58
|
+
this._metadata = options?.metadata;
|
|
48
59
|
}
|
|
49
60
|
get app() {
|
|
50
61
|
return this._app;
|
|
@@ -103,6 +114,9 @@ class XCUITestOptions {
|
|
|
103
114
|
get reportOutputDir() {
|
|
104
115
|
return this._reportOutputDir;
|
|
105
116
|
}
|
|
117
|
+
get metadata() {
|
|
118
|
+
return this._metadata;
|
|
119
|
+
}
|
|
106
120
|
getCapabilities() {
|
|
107
121
|
const caps = {
|
|
108
122
|
platformName: 'iOS',
|