@testingbot/cli 1.0.0
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/LICENSE +21 -0
- package/README.md +375 -0
- package/dist/auth.d.ts +16 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +47 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +329 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/logger.d.ts +4 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +20 -0
- package/dist/models/credentials.d.ts +9 -0
- package/dist/models/credentials.d.ts.map +1 -0
- package/dist/models/credentials.js +20 -0
- package/dist/models/espresso_options.d.ts +116 -0
- package/dist/models/espresso_options.d.ts.map +1 -0
- package/dist/models/espresso_options.js +194 -0
- package/dist/models/maestro_options.d.ts +101 -0
- package/dist/models/maestro_options.d.ts.map +1 -0
- package/dist/models/maestro_options.js +176 -0
- package/dist/models/testingbot_error.d.ts +3 -0
- package/dist/models/testingbot_error.d.ts.map +1 -0
- package/dist/models/testingbot_error.js +5 -0
- package/dist/models/xcuitest_options.d.ts +88 -0
- package/dist/models/xcuitest_options.d.ts.map +1 -0
- package/dist/models/xcuitest_options.js +146 -0
- package/dist/providers/espresso.d.ts +67 -0
- package/dist/providers/espresso.d.ts.map +1 -0
- package/dist/providers/espresso.js +527 -0
- package/dist/providers/login.d.ts +18 -0
- package/dist/providers/login.d.ts.map +1 -0
- package/dist/providers/login.js +284 -0
- package/dist/providers/maestro.d.ts +92 -0
- package/dist/providers/maestro.d.ts.map +1 -0
- package/dist/providers/maestro.js +1010 -0
- package/dist/providers/xcuitest.d.ts +67 -0
- package/dist/providers/xcuitest.d.ts.map +1 -0
- package/dist/providers/xcuitest.js +529 -0
- package/dist/upload.d.ts +21 -0
- package/dist/upload.d.ts.map +1 -0
- package/dist/upload.js +94 -0
- package/dist/utils/file-type-detector.d.ts +15 -0
- package/dist/utils/file-type-detector.d.ts.map +1 -0
- package/dist/utils/file-type-detector.js +38 -0
- package/dist/utils/platform.d.ts +26 -0
- package/dist/utils/platform.d.ts.map +1 -0
- package/dist/utils/platform.js +58 -0
- package/dist/utils.d.ts +15 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +48 -0
- package/package.json +78 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class XCUITestOptions {
|
|
4
|
+
_app;
|
|
5
|
+
_testApp;
|
|
6
|
+
_device;
|
|
7
|
+
_version;
|
|
8
|
+
_realDevice;
|
|
9
|
+
_tabletOnly;
|
|
10
|
+
_phoneOnly;
|
|
11
|
+
_name;
|
|
12
|
+
_build;
|
|
13
|
+
// Screen orientation
|
|
14
|
+
_orientation;
|
|
15
|
+
// Localization
|
|
16
|
+
_language;
|
|
17
|
+
_locale;
|
|
18
|
+
_timeZone;
|
|
19
|
+
// Geolocation
|
|
20
|
+
_geoLocation;
|
|
21
|
+
// Network throttling
|
|
22
|
+
_throttleNetwork;
|
|
23
|
+
// Execution mode
|
|
24
|
+
_quiet;
|
|
25
|
+
_async;
|
|
26
|
+
_report;
|
|
27
|
+
_reportOutputDir;
|
|
28
|
+
constructor(app, testApp, device, options) {
|
|
29
|
+
this._app = app;
|
|
30
|
+
this._testApp = testApp;
|
|
31
|
+
this._device = device;
|
|
32
|
+
this._version = options?.version;
|
|
33
|
+
this._realDevice = options?.realDevice ?? false;
|
|
34
|
+
this._tabletOnly = options?.tabletOnly ?? false;
|
|
35
|
+
this._phoneOnly = options?.phoneOnly ?? false;
|
|
36
|
+
this._name = options?.name;
|
|
37
|
+
this._build = options?.build;
|
|
38
|
+
this._orientation = options?.orientation;
|
|
39
|
+
this._language = options?.language;
|
|
40
|
+
this._locale = options?.locale;
|
|
41
|
+
this._timeZone = options?.timeZone;
|
|
42
|
+
this._geoLocation = options?.geoLocation;
|
|
43
|
+
this._throttleNetwork = options?.throttleNetwork;
|
|
44
|
+
this._quiet = options?.quiet ?? false;
|
|
45
|
+
this._async = options?.async ?? false;
|
|
46
|
+
this._report = options?.report;
|
|
47
|
+
this._reportOutputDir = options?.reportOutputDir;
|
|
48
|
+
}
|
|
49
|
+
get app() {
|
|
50
|
+
return this._app;
|
|
51
|
+
}
|
|
52
|
+
get testApp() {
|
|
53
|
+
return this._testApp;
|
|
54
|
+
}
|
|
55
|
+
get device() {
|
|
56
|
+
return this._device;
|
|
57
|
+
}
|
|
58
|
+
get version() {
|
|
59
|
+
return this._version;
|
|
60
|
+
}
|
|
61
|
+
get realDevice() {
|
|
62
|
+
return this._realDevice;
|
|
63
|
+
}
|
|
64
|
+
get tabletOnly() {
|
|
65
|
+
return this._tabletOnly;
|
|
66
|
+
}
|
|
67
|
+
get phoneOnly() {
|
|
68
|
+
return this._phoneOnly;
|
|
69
|
+
}
|
|
70
|
+
get name() {
|
|
71
|
+
return this._name;
|
|
72
|
+
}
|
|
73
|
+
get build() {
|
|
74
|
+
return this._build;
|
|
75
|
+
}
|
|
76
|
+
get orientation() {
|
|
77
|
+
return this._orientation;
|
|
78
|
+
}
|
|
79
|
+
get language() {
|
|
80
|
+
return this._language;
|
|
81
|
+
}
|
|
82
|
+
get locale() {
|
|
83
|
+
return this._locale;
|
|
84
|
+
}
|
|
85
|
+
get timeZone() {
|
|
86
|
+
return this._timeZone;
|
|
87
|
+
}
|
|
88
|
+
get geoLocation() {
|
|
89
|
+
return this._geoLocation;
|
|
90
|
+
}
|
|
91
|
+
get throttleNetwork() {
|
|
92
|
+
return this._throttleNetwork;
|
|
93
|
+
}
|
|
94
|
+
get quiet() {
|
|
95
|
+
return this._quiet;
|
|
96
|
+
}
|
|
97
|
+
get async() {
|
|
98
|
+
return this._async;
|
|
99
|
+
}
|
|
100
|
+
get report() {
|
|
101
|
+
return this._report;
|
|
102
|
+
}
|
|
103
|
+
get reportOutputDir() {
|
|
104
|
+
return this._reportOutputDir;
|
|
105
|
+
}
|
|
106
|
+
getCapabilities() {
|
|
107
|
+
const caps = {
|
|
108
|
+
platformName: 'iOS',
|
|
109
|
+
deviceName: this._device || '*',
|
|
110
|
+
};
|
|
111
|
+
if (this._version)
|
|
112
|
+
caps.version = this._version;
|
|
113
|
+
if (this._realDevice)
|
|
114
|
+
caps.realDevice = 'true';
|
|
115
|
+
if (this._tabletOnly)
|
|
116
|
+
caps.tabletOnly = true;
|
|
117
|
+
if (this._phoneOnly)
|
|
118
|
+
caps.phoneOnly = true;
|
|
119
|
+
if (this._name)
|
|
120
|
+
caps.name = this._name;
|
|
121
|
+
if (this._build)
|
|
122
|
+
caps.build = this._build;
|
|
123
|
+
return caps;
|
|
124
|
+
}
|
|
125
|
+
getXCUITestOptions() {
|
|
126
|
+
const opts = {};
|
|
127
|
+
// Screen orientation
|
|
128
|
+
if (this._orientation)
|
|
129
|
+
opts.orientation = this._orientation;
|
|
130
|
+
// Localization
|
|
131
|
+
if (this._language)
|
|
132
|
+
opts.language = this._language;
|
|
133
|
+
if (this._locale)
|
|
134
|
+
opts.locale = this._locale;
|
|
135
|
+
if (this._timeZone)
|
|
136
|
+
opts.timeZone = this._timeZone;
|
|
137
|
+
// Geolocation
|
|
138
|
+
if (this._geoLocation)
|
|
139
|
+
opts.geoLocation = this._geoLocation;
|
|
140
|
+
// Network throttling
|
|
141
|
+
if (this._throttleNetwork)
|
|
142
|
+
opts.throttle_network = this._throttleNetwork;
|
|
143
|
+
return Object.keys(opts).length > 0 ? opts : undefined;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
exports.default = XCUITestOptions;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import EspressoOptions from '../models/espresso_options';
|
|
2
|
+
import Credentials from '../models/credentials';
|
|
3
|
+
export interface EspressoRunInfo {
|
|
4
|
+
id: number;
|
|
5
|
+
status: 'WAITING' | 'READY' | 'DONE' | 'FAILED';
|
|
6
|
+
capabilities: {
|
|
7
|
+
deviceName: string;
|
|
8
|
+
platformName: string;
|
|
9
|
+
version?: string;
|
|
10
|
+
};
|
|
11
|
+
success: number;
|
|
12
|
+
report?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface EspressoStatusResponse {
|
|
15
|
+
runs: EspressoRunInfo[];
|
|
16
|
+
success: boolean;
|
|
17
|
+
completed: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface EspressoResult {
|
|
20
|
+
success: boolean;
|
|
21
|
+
runs: EspressoRunInfo[];
|
|
22
|
+
}
|
|
23
|
+
export interface EspressoSocketMessage {
|
|
24
|
+
id: number;
|
|
25
|
+
payload: string;
|
|
26
|
+
}
|
|
27
|
+
export default class Espresso {
|
|
28
|
+
private readonly URL;
|
|
29
|
+
private readonly POLL_INTERVAL_MS;
|
|
30
|
+
private readonly MAX_POLL_ATTEMPTS;
|
|
31
|
+
private credentials;
|
|
32
|
+
private options;
|
|
33
|
+
private upload;
|
|
34
|
+
private appId;
|
|
35
|
+
private activeRunIds;
|
|
36
|
+
private isShuttingDown;
|
|
37
|
+
private signalHandler;
|
|
38
|
+
private socket;
|
|
39
|
+
private updateServer;
|
|
40
|
+
private updateKey;
|
|
41
|
+
constructor(credentials: Credentials, options: EspressoOptions);
|
|
42
|
+
private validate;
|
|
43
|
+
private ensureOutputDirectory;
|
|
44
|
+
run(): Promise<EspressoResult>;
|
|
45
|
+
private uploadApp;
|
|
46
|
+
private uploadTestApp;
|
|
47
|
+
private runTests;
|
|
48
|
+
private getStatus;
|
|
49
|
+
private waitForCompletion;
|
|
50
|
+
private displayRunStatus;
|
|
51
|
+
private clearLine;
|
|
52
|
+
private formatElapsedTime;
|
|
53
|
+
private getStatusInfo;
|
|
54
|
+
private fetchReports;
|
|
55
|
+
private sleep;
|
|
56
|
+
private extractErrorMessage;
|
|
57
|
+
private setupSignalHandlers;
|
|
58
|
+
private removeSignalHandlers;
|
|
59
|
+
private handleShutdown;
|
|
60
|
+
private stopActiveRuns;
|
|
61
|
+
private stopRun;
|
|
62
|
+
private connectToUpdateServer;
|
|
63
|
+
private disconnectFromUpdateServer;
|
|
64
|
+
private handleEspressoData;
|
|
65
|
+
private handleEspressoError;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=espresso.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"espresso.d.ts","sourceRoot":"","sources":["../../src/providers/espresso.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,4BAA4B,CAAC;AAEzD,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAUhD,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;IAChD,YAAY,EAAE;QACZ,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,eAAe,EAAE,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,eAAe,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAyD;IAC7E,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAQ;IACzC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAO;IAEzC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,OAAO,CAAk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