@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.
Files changed (54) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +375 -0
  3. package/dist/auth.d.ts +16 -0
  4. package/dist/auth.d.ts.map +1 -0
  5. package/dist/auth.js +47 -0
  6. package/dist/cli.d.ts +4 -0
  7. package/dist/cli.d.ts.map +1 -0
  8. package/dist/cli.js +329 -0
  9. package/dist/index.d.ts +3 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +8 -0
  12. package/dist/logger.d.ts +4 -0
  13. package/dist/logger.d.ts.map +1 -0
  14. package/dist/logger.js +20 -0
  15. package/dist/models/credentials.d.ts +9 -0
  16. package/dist/models/credentials.d.ts.map +1 -0
  17. package/dist/models/credentials.js +20 -0
  18. package/dist/models/espresso_options.d.ts +116 -0
  19. package/dist/models/espresso_options.d.ts.map +1 -0
  20. package/dist/models/espresso_options.js +194 -0
  21. package/dist/models/maestro_options.d.ts +101 -0
  22. package/dist/models/maestro_options.d.ts.map +1 -0
  23. package/dist/models/maestro_options.js +176 -0
  24. package/dist/models/testingbot_error.d.ts +3 -0
  25. package/dist/models/testingbot_error.d.ts.map +1 -0
  26. package/dist/models/testingbot_error.js +5 -0
  27. package/dist/models/xcuitest_options.d.ts +88 -0
  28. package/dist/models/xcuitest_options.d.ts.map +1 -0
  29. package/dist/models/xcuitest_options.js +146 -0
  30. package/dist/providers/espresso.d.ts +67 -0
  31. package/dist/providers/espresso.d.ts.map +1 -0
  32. package/dist/providers/espresso.js +527 -0
  33. package/dist/providers/login.d.ts +18 -0
  34. package/dist/providers/login.d.ts.map +1 -0
  35. package/dist/providers/login.js +284 -0
  36. package/dist/providers/maestro.d.ts +92 -0
  37. package/dist/providers/maestro.d.ts.map +1 -0
  38. package/dist/providers/maestro.js +1010 -0
  39. package/dist/providers/xcuitest.d.ts +67 -0
  40. package/dist/providers/xcuitest.d.ts.map +1 -0
  41. package/dist/providers/xcuitest.js +529 -0
  42. package/dist/upload.d.ts +21 -0
  43. package/dist/upload.d.ts.map +1 -0
  44. package/dist/upload.js +94 -0
  45. package/dist/utils/file-type-detector.d.ts +15 -0
  46. package/dist/utils/file-type-detector.d.ts.map +1 -0
  47. package/dist/utils/file-type-detector.js +38 -0
  48. package/dist/utils/platform.d.ts +26 -0
  49. package/dist/utils/platform.d.ts.map +1 -0
  50. package/dist/utils/platform.js +58 -0
  51. package/dist/utils.d.ts +15 -0
  52. package/dist/utils.d.ts.map +1 -0
  53. package/dist/utils.js +48 -0
  54. package/package.json +78 -0
@@ -0,0 +1,194 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class EspressoOptions {
4
+ _app;
5
+ _testApp;
6
+ _device;
7
+ _version;
8
+ _realDevice;
9
+ _tabletOnly;
10
+ _phoneOnly;
11
+ _name;
12
+ _build;
13
+ // Espresso-specific options
14
+ _testRunner;
15
+ _class;
16
+ _notClass;
17
+ _package;
18
+ _notPackage;
19
+ _annotation;
20
+ _notAnnotation;
21
+ _size;
22
+ // Localization
23
+ _language;
24
+ _locale;
25
+ _timeZone;
26
+ // Geolocation
27
+ _geoLocation;
28
+ // Network throttling
29
+ _throttleNetwork;
30
+ // Execution mode
31
+ _quiet;
32
+ _async;
33
+ _report;
34
+ _reportOutputDir;
35
+ constructor(app, testApp, device, options) {
36
+ this._app = app;
37
+ this._testApp = testApp;
38
+ this._device = device;
39
+ this._version = options?.version;
40
+ this._realDevice = options?.realDevice ?? false;
41
+ this._tabletOnly = options?.tabletOnly ?? false;
42
+ this._phoneOnly = options?.phoneOnly ?? false;
43
+ this._name = options?.name;
44
+ this._build = options?.build;
45
+ this._testRunner = options?.testRunner;
46
+ this._class = options?.class;
47
+ this._notClass = options?.notClass;
48
+ this._package = options?.package;
49
+ this._notPackage = options?.notPackage;
50
+ this._annotation = options?.annotation;
51
+ this._notAnnotation = options?.notAnnotation;
52
+ this._size = options?.size;
53
+ this._language = options?.language;
54
+ this._locale = options?.locale;
55
+ this._timeZone = options?.timeZone;
56
+ this._geoLocation = options?.geoLocation;
57
+ this._throttleNetwork = options?.throttleNetwork;
58
+ this._quiet = options?.quiet ?? false;
59
+ this._async = options?.async ?? false;
60
+ this._report = options?.report;
61
+ this._reportOutputDir = options?.reportOutputDir;
62
+ }
63
+ get app() {
64
+ return this._app;
65
+ }
66
+ get testApp() {
67
+ return this._testApp;
68
+ }
69
+ get device() {
70
+ return this._device;
71
+ }
72
+ get version() {
73
+ return this._version;
74
+ }
75
+ get realDevice() {
76
+ return this._realDevice;
77
+ }
78
+ get tabletOnly() {
79
+ return this._tabletOnly;
80
+ }
81
+ get phoneOnly() {
82
+ return this._phoneOnly;
83
+ }
84
+ get name() {
85
+ return this._name;
86
+ }
87
+ get build() {
88
+ return this._build;
89
+ }
90
+ get testRunner() {
91
+ return this._testRunner;
92
+ }
93
+ get class() {
94
+ return this._class;
95
+ }
96
+ get notClass() {
97
+ return this._notClass;
98
+ }
99
+ get package() {
100
+ return this._package;
101
+ }
102
+ get notPackage() {
103
+ return this._notPackage;
104
+ }
105
+ get annotation() {
106
+ return this._annotation;
107
+ }
108
+ get notAnnotation() {
109
+ return this._notAnnotation;
110
+ }
111
+ get size() {
112
+ return this._size;
113
+ }
114
+ get language() {
115
+ return this._language;
116
+ }
117
+ get locale() {
118
+ return this._locale;
119
+ }
120
+ get timeZone() {
121
+ return this._timeZone;
122
+ }
123
+ get geoLocation() {
124
+ return this._geoLocation;
125
+ }
126
+ get throttleNetwork() {
127
+ return this._throttleNetwork;
128
+ }
129
+ get quiet() {
130
+ return this._quiet;
131
+ }
132
+ get async() {
133
+ return this._async;
134
+ }
135
+ get report() {
136
+ return this._report;
137
+ }
138
+ get reportOutputDir() {
139
+ return this._reportOutputDir;
140
+ }
141
+ getCapabilities() {
142
+ const caps = {
143
+ platformName: 'Android',
144
+ deviceName: this._device || '*',
145
+ };
146
+ if (this._version)
147
+ caps.version = this._version;
148
+ if (this._realDevice)
149
+ caps.realDevice = 'true';
150
+ if (this._tabletOnly)
151
+ caps.tabletOnly = true;
152
+ if (this._phoneOnly)
153
+ caps.phoneOnly = true;
154
+ if (this._name)
155
+ caps.name = this._name;
156
+ if (this._build)
157
+ caps.build = this._build;
158
+ return caps;
159
+ }
160
+ getEspressoOptions() {
161
+ const opts = {};
162
+ if (this._testRunner)
163
+ opts.testRunner = this._testRunner;
164
+ if (this._class && this._class.length > 0)
165
+ opts.class = this._class;
166
+ if (this._notClass && this._notClass.length > 0)
167
+ opts.notClass = this._notClass;
168
+ if (this._package && this._package.length > 0)
169
+ opts.package = this._package;
170
+ if (this._notPackage && this._notPackage.length > 0)
171
+ opts.notPackage = this._notPackage;
172
+ if (this._annotation && this._annotation.length > 0)
173
+ opts.annotation = this._annotation;
174
+ if (this._notAnnotation && this._notAnnotation.length > 0)
175
+ opts.notAnnotation = this._notAnnotation;
176
+ if (this._size && this._size.length > 0)
177
+ opts.size = this._size;
178
+ // Localization
179
+ if (this._language)
180
+ opts.language = this._language;
181
+ if (this._locale)
182
+ opts.locale = this._locale;
183
+ if (this._timeZone)
184
+ opts.timeZone = this._timeZone;
185
+ // Geolocation
186
+ if (this._geoLocation)
187
+ opts.geoLocation = this._geoLocation;
188
+ // Network throttling
189
+ if (this._throttleNetwork)
190
+ opts.throttle_network = this._throttleNetwork;
191
+ return Object.keys(opts).length > 0 ? opts : undefined;
192
+ }
193
+ }
194
+ exports.default = EspressoOptions;
@@ -0,0 +1,101 @@
1
+ export interface MaestroConfig {
2
+ flows?: string[];
3
+ includeTags?: string[];
4
+ excludeTags?: string[];
5
+ executionOrder?: 'continue' | 'stop';
6
+ }
7
+ export type Orientation = 'PORTRAIT' | 'LANDSCAPE';
8
+ export type ThrottleNetwork = '4G' | '3G' | 'Edge' | 'airplane' | 'disable';
9
+ export type ReportFormat = 'html' | 'junit';
10
+ export interface MaestroCapabilities {
11
+ platformName?: 'Android' | 'iOS';
12
+ version?: string;
13
+ deviceName: string;
14
+ name?: string;
15
+ build?: string;
16
+ orientation?: Orientation;
17
+ locale?: string;
18
+ timeZone?: string;
19
+ throttleNetwork?: ThrottleNetwork;
20
+ geoCountryCode?: string;
21
+ realDevice?: string;
22
+ }
23
+ export interface MaestroRunOptions {
24
+ includeTags?: string[];
25
+ excludeTags?: string[];
26
+ env?: Record<string, string>;
27
+ version?: string;
28
+ }
29
+ export default class MaestroOptions {
30
+ private _app;
31
+ private _flows;
32
+ private _device?;
33
+ private _includeTags?;
34
+ private _excludeTags?;
35
+ private _platformName?;
36
+ private _version?;
37
+ private _name?;
38
+ private _build?;
39
+ private _orientation?;
40
+ private _locale?;
41
+ private _timeZone?;
42
+ private _throttleNetwork?;
43
+ private _geoCountryCode?;
44
+ private _env?;
45
+ private _maestroVersion?;
46
+ private _quiet;
47
+ private _async;
48
+ private _report?;
49
+ private _reportOutputDir?;
50
+ private _realDevice;
51
+ private _downloadArtifacts;
52
+ private _artifactsOutputDir?;
53
+ constructor(app: string, flows: string | string[], device?: string, options?: {
54
+ includeTags?: string[];
55
+ excludeTags?: string[];
56
+ platformName?: 'Android' | 'iOS';
57
+ version?: string;
58
+ name?: string;
59
+ build?: string;
60
+ orientation?: Orientation;
61
+ locale?: string;
62
+ timeZone?: string;
63
+ throttleNetwork?: ThrottleNetwork;
64
+ geoCountryCode?: string;
65
+ env?: Record<string, string>;
66
+ maestroVersion?: string;
67
+ quiet?: boolean;
68
+ async?: boolean;
69
+ report?: ReportFormat;
70
+ reportOutputDir?: string;
71
+ realDevice?: boolean;
72
+ downloadArtifacts?: boolean;
73
+ artifactsOutputDir?: string;
74
+ });
75
+ get app(): string;
76
+ get flows(): string[];
77
+ get device(): string | undefined;
78
+ get includeTags(): string[] | undefined;
79
+ get excludeTags(): string[] | undefined;
80
+ get platformName(): 'Android' | 'iOS' | undefined;
81
+ get version(): string | undefined;
82
+ get name(): string | undefined;
83
+ get build(): string | undefined;
84
+ get orientation(): Orientation | undefined;
85
+ get locale(): string | undefined;
86
+ get timeZone(): string | undefined;
87
+ get throttleNetwork(): ThrottleNetwork | undefined;
88
+ get geoCountryCode(): string | undefined;
89
+ get env(): Record<string, string> | undefined;
90
+ get maestroVersion(): string | undefined;
91
+ get quiet(): boolean;
92
+ get async(): boolean;
93
+ get report(): ReportFormat | undefined;
94
+ get reportOutputDir(): string | undefined;
95
+ get realDevice(): boolean;
96
+ get downloadArtifacts(): boolean;
97
+ get artifactsOutputDir(): string | undefined;
98
+ getMaestroOptions(): MaestroRunOptions | undefined;
99
+ getCapabilities(detectedPlatform?: 'Android' | 'iOS'): MaestroCapabilities;
100
+ }
101
+ //# sourceMappingURL=maestro_options.d.ts.map
@@ -0,0 +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;AAE5C,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,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AI,IAAI,MAAM,GAAG,SAAS,CAEpC;IAED,IAAW,KAAK,IAAI,MAAM,GAAG,SAAS,CAErC;IAED,IAAW,WAAW,IAAI,WAAW,GAAG,SAAS,CAEhD;IAED,IAAW,MAAM,IAAI,MAAM,GAAG,SAAS,CAEtC;IAED,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,OAAO,CAEtC;IAED,IAAW,kBAAkB,IAAI,MAAM,GAAG,SAAS,CAElD;IAEM,iBAAiB,IAAI,iBAAiB,GAAG,SAAS;IAmBlD,eAAe,CACpB,gBAAgB,CAAC,EAAE,SAAS,GAAG,KAAK,GACnC,mBAAmB;CAkCvB"}
@@ -0,0 +1,176 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class MaestroOptions {
4
+ _app;
5
+ _flows;
6
+ _device;
7
+ _includeTags;
8
+ _excludeTags;
9
+ _platformName;
10
+ _version;
11
+ _name;
12
+ _build;
13
+ _orientation;
14
+ _locale;
15
+ _timeZone;
16
+ _throttleNetwork;
17
+ _geoCountryCode;
18
+ _env;
19
+ _maestroVersion;
20
+ _quiet;
21
+ _async;
22
+ _report;
23
+ _reportOutputDir;
24
+ _realDevice;
25
+ _downloadArtifacts;
26
+ _artifactsOutputDir;
27
+ constructor(app, flows, device, options) {
28
+ this._app = app;
29
+ this._flows = flows ? (Array.isArray(flows) ? flows : [flows]) : [];
30
+ this._device = device;
31
+ this._includeTags = options?.includeTags;
32
+ this._excludeTags = options?.excludeTags;
33
+ this._platformName = options?.platformName;
34
+ this._version = options?.version;
35
+ this._name = options?.name;
36
+ this._build = options?.build;
37
+ this._orientation = options?.orientation;
38
+ this._locale = options?.locale;
39
+ this._timeZone = options?.timeZone;
40
+ this._throttleNetwork = options?.throttleNetwork;
41
+ this._geoCountryCode = options?.geoCountryCode;
42
+ this._env = options?.env;
43
+ this._maestroVersion = options?.maestroVersion;
44
+ this._quiet = options?.quiet ?? false;
45
+ this._async = options?.async ?? false;
46
+ this._report = options?.report;
47
+ this._reportOutputDir = options?.reportOutputDir;
48
+ this._realDevice = options?.realDevice ?? false;
49
+ this._downloadArtifacts = options?.downloadArtifacts ?? false;
50
+ this._artifactsOutputDir = options?.artifactsOutputDir;
51
+ }
52
+ get app() {
53
+ return this._app;
54
+ }
55
+ get flows() {
56
+ return this._flows;
57
+ }
58
+ get device() {
59
+ return this._device;
60
+ }
61
+ get includeTags() {
62
+ return this._includeTags;
63
+ }
64
+ get excludeTags() {
65
+ return this._excludeTags;
66
+ }
67
+ get platformName() {
68
+ return this._platformName;
69
+ }
70
+ get version() {
71
+ return this._version;
72
+ }
73
+ get name() {
74
+ return this._name;
75
+ }
76
+ get build() {
77
+ return this._build;
78
+ }
79
+ get orientation() {
80
+ return this._orientation;
81
+ }
82
+ get locale() {
83
+ return this._locale;
84
+ }
85
+ get timeZone() {
86
+ return this._timeZone;
87
+ }
88
+ get throttleNetwork() {
89
+ return this._throttleNetwork;
90
+ }
91
+ get geoCountryCode() {
92
+ return this._geoCountryCode;
93
+ }
94
+ get env() {
95
+ return this._env;
96
+ }
97
+ get maestroVersion() {
98
+ return this._maestroVersion;
99
+ }
100
+ get quiet() {
101
+ return this._quiet;
102
+ }
103
+ get async() {
104
+ return this._async;
105
+ }
106
+ get report() {
107
+ return this._report;
108
+ }
109
+ get reportOutputDir() {
110
+ return this._reportOutputDir;
111
+ }
112
+ get realDevice() {
113
+ return this._realDevice;
114
+ }
115
+ get downloadArtifacts() {
116
+ return this._downloadArtifacts;
117
+ }
118
+ get artifactsOutputDir() {
119
+ return this._artifactsOutputDir;
120
+ }
121
+ getMaestroOptions() {
122
+ const opts = {};
123
+ if (this._includeTags && this._includeTags.length > 0) {
124
+ opts.includeTags = this._includeTags;
125
+ }
126
+ if (this._excludeTags && this._excludeTags.length > 0) {
127
+ opts.excludeTags = this._excludeTags;
128
+ }
129
+ if (this._env && Object.keys(this._env).length > 0) {
130
+ opts.env = this._env;
131
+ }
132
+ if (this._maestroVersion) {
133
+ opts.version = this._maestroVersion;
134
+ }
135
+ return Object.keys(opts).length > 0 ? opts : undefined;
136
+ }
137
+ getCapabilities(detectedPlatform) {
138
+ // Use provided platform, or detected platform, or default based on extension
139
+ let platformName = this._platformName ?? detectedPlatform;
140
+ let deviceName = this._device;
141
+ // Fallback to extension-based detection if no platform determined
142
+ if (!platformName) {
143
+ const ext = this._app?.toLowerCase().split('.').pop();
144
+ const isAndroid = ext === 'apk' || ext === 'apks';
145
+ platformName = isAndroid ? 'Android' : 'iOS';
146
+ }
147
+ // Default device to wildcard if not specified
148
+ if (!deviceName) {
149
+ deviceName = '*';
150
+ }
151
+ const caps = {
152
+ deviceName,
153
+ platformName,
154
+ };
155
+ if (this._version)
156
+ caps.version = this._version;
157
+ if (this._name)
158
+ caps.name = this._name;
159
+ if (this._build)
160
+ caps.build = this._build;
161
+ if (this._orientation)
162
+ caps.orientation = this._orientation;
163
+ if (this._locale)
164
+ caps.locale = this._locale;
165
+ if (this._timeZone)
166
+ caps.timeZone = this._timeZone;
167
+ if (this._throttleNetwork)
168
+ caps.throttleNetwork = this._throttleNetwork;
169
+ if (this._geoCountryCode)
170
+ caps.geoCountryCode = this._geoCountryCode;
171
+ if (this._realDevice)
172
+ caps.realDevice = 'true';
173
+ return caps;
174
+ }
175
+ }
176
+ exports.default = MaestroOptions;
@@ -0,0 +1,3 @@
1
+ export default class TestingBotError extends Error {
2
+ }
3
+ //# sourceMappingURL=testingbot_error.d.ts.map
@@ -0,0 +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;CAAG"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class TestingBotError extends Error {
4
+ }
5
+ exports.default = TestingBotError;
@@ -0,0 +1,88 @@
1
+ export type Orientation = 'PORTRAIT' | 'LANDSCAPE';
2
+ export type ReportFormat = 'html' | 'junit';
3
+ export type ThrottleNetwork = '4G' | '3G' | 'Edge' | 'airplane';
4
+ export interface CustomNetworkProfile {
5
+ uploadSpeed: number;
6
+ downloadSpeed: number;
7
+ latency: number;
8
+ loss: number;
9
+ }
10
+ export interface XCUITestCapabilities {
11
+ platformName: 'iOS';
12
+ deviceName: string;
13
+ version?: string;
14
+ realDevice?: string;
15
+ tabletOnly?: boolean;
16
+ phoneOnly?: boolean;
17
+ name?: string;
18
+ build?: string;
19
+ }
20
+ export interface XCUITestRunOptions {
21
+ orientation?: Orientation;
22
+ language?: string;
23
+ locale?: string;
24
+ timeZone?: string;
25
+ geoLocation?: string;
26
+ throttle_network?: ThrottleNetwork | CustomNetworkProfile;
27
+ }
28
+ export default class XCUITestOptions {
29
+ private _app;
30
+ private _testApp;
31
+ private _device?;
32
+ private _version?;
33
+ private _realDevice;
34
+ private _tabletOnly;
35
+ private _phoneOnly;
36
+ private _name?;
37
+ private _build?;
38
+ private _orientation?;
39
+ private _language?;
40
+ private _locale?;
41
+ private _timeZone?;
42
+ private _geoLocation?;
43
+ private _throttleNetwork?;
44
+ private _quiet;
45
+ private _async;
46
+ private _report?;
47
+ private _reportOutputDir?;
48
+ constructor(app: string, testApp: string, device?: string, options?: {
49
+ version?: string;
50
+ realDevice?: boolean;
51
+ tabletOnly?: boolean;
52
+ phoneOnly?: boolean;
53
+ name?: string;
54
+ build?: string;
55
+ orientation?: Orientation;
56
+ language?: string;
57
+ locale?: string;
58
+ timeZone?: string;
59
+ geoLocation?: string;
60
+ throttleNetwork?: ThrottleNetwork | CustomNetworkProfile;
61
+ quiet?: boolean;
62
+ async?: boolean;
63
+ report?: ReportFormat;
64
+ reportOutputDir?: string;
65
+ });
66
+ get app(): string;
67
+ get testApp(): string;
68
+ get device(): string | undefined;
69
+ get version(): string | undefined;
70
+ get realDevice(): boolean;
71
+ get tabletOnly(): boolean;
72
+ get phoneOnly(): boolean;
73
+ get name(): string | undefined;
74
+ get build(): string | undefined;
75
+ get orientation(): Orientation | undefined;
76
+ get language(): string | undefined;
77
+ get locale(): string | undefined;
78
+ get timeZone(): string | undefined;
79
+ get geoLocation(): string | undefined;
80
+ get throttleNetwork(): ThrottleNetwork | CustomNetworkProfile | undefined;
81
+ get quiet(): boolean;
82
+ get async(): boolean;
83
+ get report(): ReportFormat | undefined;
84
+ get reportOutputDir(): string | undefined;
85
+ getCapabilities(): XCUITestCapabilities;
86
+ getXCUITestOptions(): XCUITestRunOptions | undefined;
87
+ }
88
+ //# sourceMappingURL=xcuitest_options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xcuitest_options.d.ts","sourceRoot":"","sources":["../../src/models/xcuitest_options.ts"],"names":[],"mappings":"AAAA,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,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,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