appium-xcuitest-driver 10.14.1 → 10.14.3
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/CHANGELOG.md +12 -0
- package/build/lib/commands/alert.d.ts +26 -31
- package/build/lib/commands/alert.d.ts.map +1 -1
- package/build/lib/commands/alert.js +20 -29
- package/build/lib/commands/alert.js.map +1 -1
- package/build/lib/commands/appearance.d.ts +7 -9
- package/build/lib/commands/appearance.d.ts.map +1 -1
- package/build/lib/commands/appearance.js +13 -19
- package/build/lib/commands/appearance.js.map +1 -1
- package/build/lib/commands/execute.d.ts +10 -22
- package/build/lib/commands/execute.d.ts.map +1 -1
- package/build/lib/commands/execute.js +12 -28
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/location.d.ts +8 -11
- package/build/lib/commands/location.d.ts.map +1 -1
- package/build/lib/commands/location.js +7 -15
- package/build/lib/commands/location.js.map +1 -1
- package/build/lib/commands/navigation.d.ts +14 -26
- package/build/lib/commands/navigation.d.ts.map +1 -1
- package/build/lib/commands/navigation.js +10 -18
- package/build/lib/commands/navigation.js.map +1 -1
- package/build/lib/commands/pcap.d.ts +18 -38
- package/build/lib/commands/pcap.d.ts.map +1 -1
- package/build/lib/commands/pcap.js +9 -14
- package/build/lib/commands/pcap.js.map +1 -1
- package/build/lib/commands/permissions.d.ts +15 -17
- package/build/lib/commands/permissions.d.ts.map +1 -1
- package/build/lib/commands/permissions.js +12 -18
- package/build/lib/commands/permissions.js.map +1 -1
- package/build/lib/commands/proxy-helper.d.ts +11 -11
- package/build/lib/commands/proxy-helper.d.ts.map +1 -1
- package/build/lib/commands/proxy-helper.js +15 -24
- package/build/lib/commands/proxy-helper.js.map +1 -1
- package/build/lib/commands/screenshots.d.ts +15 -9
- package/build/lib/commands/screenshots.d.ts.map +1 -1
- package/build/lib/commands/screenshots.js +13 -11
- package/build/lib/commands/screenshots.js.map +1 -1
- package/build/lib/commands/simctl.d.ts +16 -22
- package/build/lib/commands/simctl.d.ts.map +1 -1
- package/build/lib/commands/simctl.js +8 -17
- package/build/lib/commands/simctl.js.map +1 -1
- package/build/lib/commands/source.d.ts +10 -8
- package/build/lib/commands/source.d.ts.map +1 -1
- package/build/lib/commands/source.js +11 -14
- package/build/lib/commands/source.js.map +1 -1
- package/build/lib/commands/timeouts.d.ts +25 -32
- package/build/lib/commands/timeouts.d.ts.map +1 -1
- package/build/lib/commands/timeouts.js +18 -14
- package/build/lib/commands/timeouts.js.map +1 -1
- package/build/lib/driver.js +1 -1
- package/build/lib/driver.js.map +1 -1
- package/build/lib/execute-method-map.d.ts.map +1 -1
- package/build/lib/execute-method-map.js +0 -2
- package/build/lib/execute-method-map.js.map +1 -1
- package/lib/commands/alert.ts +98 -0
- package/lib/commands/appearance.ts +70 -0
- package/lib/commands/{execute.js → execute.ts} +41 -37
- package/lib/commands/{location.js → location.ts} +19 -22
- package/lib/commands/{navigation.js → navigation.ts} +23 -26
- package/lib/commands/{pcap.js → pcap.ts} +28 -28
- package/lib/commands/permissions.ts +90 -0
- package/lib/commands/{proxy-helper.js → proxy-helper.ts} +26 -26
- package/lib/commands/{screenshots.js → screenshots.ts} +24 -16
- package/lib/commands/{simctl.js → simctl.ts} +27 -21
- package/lib/commands/{source.js → source.ts} +23 -20
- package/lib/commands/timeouts.ts +95 -0
- package/lib/driver.ts +1 -1
- package/lib/execute-method-map.ts +0 -2
- package/npm-shrinkwrap.json +5 -5
- package/package.json +1 -1
- package/lib/commands/alert.js +0 -88
- package/lib/commands/appearance.js +0 -71
- package/lib/commands/permissions.js +0 -85
- package/lib/commands/timeouts.js +0 -68
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../../lib/commands/location.
|
|
1
|
+
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../../lib/commands/location.ts"],"names":[],"mappings":";;AA2BA,wCAkCC;AAUD,wCAgCC;AAQD,gEAsBC;AArID,yDAA2C;AAC3C,0CAA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,sBAAc,EAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;QAC9E,MAAM,IAAI,CAAC,4BAA4B,EAAE,CAAC;QAC1C,OAAO;IACT,CAAC;IAED,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;QACvB,MAAM,IAAI,eAAM,CAAC,mBAAmB,EAAE,CAAC;IACzC,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,4BAAQ,CAAC,4BAA4B,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5E,IAAI,CAAC;QACH,OAAO,CAAC,aAAa,EAAE,CAAC;IAC1B,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,MAAM,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAC/B,yDAAyD,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK;YAC1E,mBAAmB,GAAG,CAAC,OAAO,EAAE,CACnC,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -1,44 +1,32 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
+
* Navigate back in the browser history or native app navigation.
|
|
3
4
|
*/
|
|
4
|
-
export function back(this:
|
|
5
|
+
export declare function back(this: XCUITestDriver): Promise<void>;
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
+
* Navigate forward in the browser history.
|
|
7
8
|
*/
|
|
8
|
-
export function forward(this:
|
|
9
|
+
export declare function forward(this: XCUITestDriver): Promise<void>;
|
|
9
10
|
/**
|
|
10
|
-
*
|
|
11
|
+
* Closes the current window in a web context.
|
|
12
|
+
*
|
|
13
|
+
* @returns Promise that resolves when the window is closed
|
|
11
14
|
*/
|
|
12
|
-
export function closeWindow(this:
|
|
15
|
+
export declare function closeWindow(this: XCUITestDriver): Promise<any>;
|
|
13
16
|
/**
|
|
14
17
|
* Opens the given URL with the default application assigned to handle it based on the URL
|
|
15
18
|
* scheme, or the application provided as an optional parameter
|
|
16
19
|
*
|
|
17
20
|
* (Note: the version of Xcode must be 14.3+ and iOS must be 16.4+)
|
|
18
21
|
*
|
|
19
|
-
* @param
|
|
20
|
-
* @param
|
|
22
|
+
* @param url - the URL to be opened, e.g. `myscheme://yolo`
|
|
23
|
+
* @param bundleId - the application to open the given URL with. If not provided, then
|
|
21
24
|
* the application assigned by the operating system to handle URLs of the appropriate type
|
|
22
|
-
* @returns {Promise<void>}
|
|
23
25
|
* @since 4.17
|
|
24
|
-
* @this {XCUITestDriver}
|
|
25
26
|
*/
|
|
26
|
-
export function mobileDeepLink(this:
|
|
27
|
+
export declare function mobileDeepLink(this: XCUITestDriver, url: string, bundleId?: string): Promise<void>;
|
|
27
28
|
/**
|
|
28
|
-
*
|
|
29
|
+
* Navigate back in native app navigation by finding and clicking the back button.
|
|
29
30
|
*/
|
|
30
|
-
export function nativeBack(this:
|
|
31
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
32
|
-
export type DeepLinkOptions = {
|
|
33
|
-
/**
|
|
34
|
-
* The URL to be opened. This parameter is manadatory
|
|
35
|
-
*/
|
|
36
|
-
url: string;
|
|
37
|
-
/**
|
|
38
|
-
* The bundle identifier of an application to open the
|
|
39
|
-
* given url with. If not provided then the default application for the given url scheme
|
|
40
|
-
* is going to be used.
|
|
41
|
-
*/
|
|
42
|
-
bundleId: string | null;
|
|
43
|
-
};
|
|
31
|
+
export declare function nativeBack(this: XCUITestDriver): Promise<void>;
|
|
44
32
|
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../lib/commands/navigation.
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../lib/commands/navigation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAO9C;;GAEG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAM9D;AAED;;GAEG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAMjE;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,CAsBpE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAKf;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAwCpE"}
|
|
@@ -12,7 +12,7 @@ const utils_1 = require("../utils");
|
|
|
12
12
|
const CLOSE_WINDOW_TIMEOUT = 5000;
|
|
13
13
|
const CLOSE_WINDOW_INTERVAL = 100;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Navigate back in the browser history or native app navigation.
|
|
16
16
|
*/
|
|
17
17
|
async function back() {
|
|
18
18
|
if (!this.isWebContext()) {
|
|
@@ -23,15 +23,19 @@ async function back() {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Navigate forward in the browser history.
|
|
27
27
|
*/
|
|
28
28
|
async function forward() {
|
|
29
29
|
if (!this.isWebContext()) {
|
|
30
|
+
// No-op for native context
|
|
31
|
+
return;
|
|
30
32
|
}
|
|
31
33
|
await this.mobileWebNav('forward');
|
|
32
34
|
}
|
|
33
35
|
/**
|
|
34
|
-
*
|
|
36
|
+
* Closes the current window in a web context.
|
|
37
|
+
*
|
|
38
|
+
* @returns Promise that resolves when the window is closed
|
|
35
39
|
*/
|
|
36
40
|
async function closeWindow() {
|
|
37
41
|
if (!this.isWebContext()) {
|
|
@@ -63,12 +67,10 @@ async function closeWindow() {
|
|
|
63
67
|
*
|
|
64
68
|
* (Note: the version of Xcode must be 14.3+ and iOS must be 16.4+)
|
|
65
69
|
*
|
|
66
|
-
* @param
|
|
67
|
-
* @param
|
|
70
|
+
* @param url - the URL to be opened, e.g. `myscheme://yolo`
|
|
71
|
+
* @param bundleId - the application to open the given URL with. If not provided, then
|
|
68
72
|
* the application assigned by the operating system to handle URLs of the appropriate type
|
|
69
|
-
* @returns {Promise<void>}
|
|
70
73
|
* @since 4.17
|
|
71
|
-
* @this {XCUITestDriver}
|
|
72
74
|
*/
|
|
73
75
|
async function mobileDeepLink(url, bundleId) {
|
|
74
76
|
return await this.proxyCommand('/url', 'POST', {
|
|
@@ -77,7 +79,7 @@ async function mobileDeepLink(url, bundleId) {
|
|
|
77
79
|
});
|
|
78
80
|
}
|
|
79
81
|
/**
|
|
80
|
-
*
|
|
82
|
+
* Navigate back in native app navigation by finding and clicking the back button.
|
|
81
83
|
*/
|
|
82
84
|
async function nativeBack() {
|
|
83
85
|
if ((0, utils_1.isTvOs)(this.opts.platformName)) {
|
|
@@ -106,14 +108,4 @@ async function nativeBack() {
|
|
|
106
108
|
this.log.error(`Unable to find navigation bar and back button: ${err.message}`);
|
|
107
109
|
}
|
|
108
110
|
}
|
|
109
|
-
/**
|
|
110
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
111
|
-
*/
|
|
112
|
-
/**
|
|
113
|
-
* @typedef {Object} DeepLinkOptions
|
|
114
|
-
* @property {string} url The URL to be opened. This parameter is manadatory
|
|
115
|
-
* @property {string?} bundleId The bundle identifier of an application to open the
|
|
116
|
-
* given url with. If not provided then the default application for the given url scheme
|
|
117
|
-
* is going to be used.
|
|
118
|
-
*/
|
|
119
111
|
//# sourceMappingURL=navigation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../../lib/commands/navigation.
|
|
1
|
+
{"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../../lib/commands/navigation.ts"],"names":[],"mappings":";;AAaA,oBAMC;AAKD,0BAMC;AAOD,kCAsBC;AAaD,wCASC;AAKD,gCAwCC;AA9HD,0CAAqC;AACrC,uCAA0C;AAC1C,oCAAkC;AAIlC,uDAAuD;AACvD,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAClC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC;;GAEG;AACI,KAAK,UAAU,IAAI;IACxB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;QACzB,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;IAC1B,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;AACH,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,OAAO;IAC3B,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;QACzB,2BAA2B;QAC3B,OAAO;IACT,CAAC;IACD,MAAM,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;AACrC,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,WAAW;IAC/B,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;QACzB,MAAM,IAAI,eAAM,CAAC,mBAAmB,EAAE,CAAC;IACzC,CAAC;IAED,yEAAyE;IACzE,2EAA2E;IAC3E,MAAM,MAAM,GAAG,6EAA6E,CAAC;IAC7F,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC;IAChC,IAAI,CAAC;QACH,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;IACtE,CAAC;YAAS,CAAC;QACT,gDAAgD;QAChD,IAAI,CAAC;YACH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oCAAoC,CAAC,CAAC;YACxD,CAAC;YACD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;YAChE,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACzB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,wEAAwE,CAAC,CAAC;YACzF,SAAS,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QAC7B,CAAC;QAED,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,kDAAkD,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;AACH,CAAC"}
|
|
@@ -1,26 +1,24 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
2
|
+
export declare class TrafficCapture {
|
|
3
|
+
private mainProcess;
|
|
4
|
+
private readonly udid;
|
|
5
|
+
private readonly log;
|
|
6
|
+
private readonly resultPath;
|
|
7
|
+
constructor(udid: string, log: any, resultPath: string);
|
|
8
|
+
start(timeoutSeconds: number): Promise<void>;
|
|
9
|
+
isCapturing(): boolean;
|
|
10
|
+
interrupt(force?: boolean): Promise<boolean>;
|
|
11
|
+
finish(): Promise<string>;
|
|
12
|
+
cleanup(): Promise<void>;
|
|
13
|
+
}
|
|
1
14
|
/**
|
|
2
15
|
* Records the given network traffic capture into a .pcap file.
|
|
3
16
|
*
|
|
4
|
-
* @param
|
|
5
|
-
* @param
|
|
17
|
+
* @param timeLimitSec - The maximum recording time, in seconds. The maximum value is `43200` (12 hours).
|
|
18
|
+
* @param forceRestart - Whether to restart traffic capture process forcefully when startPcap is called (`true`) or ignore the call until the current traffic capture is completed (`false`, the default value).
|
|
6
19
|
* @throws {Error} If network traffic capture has failed to start.
|
|
7
|
-
* @returns {Promise<void>}
|
|
8
|
-
* @this {XCUITestDriver}
|
|
9
20
|
*/
|
|
10
|
-
export function mobileStartPcap(this:
|
|
11
|
-
export class mobileStartPcap {
|
|
12
|
-
/**
|
|
13
|
-
* Records the given network traffic capture into a .pcap file.
|
|
14
|
-
*
|
|
15
|
-
* @param {number} timeLimitSec - The maximum recording time, in seconds. The maximum value is `43200` (12 hours).
|
|
16
|
-
* @param {boolean} forceRestart - Whether to restart traffic capture process forcefully when startPcap is called (`true`) or ignore the call until the current traffic capture is completed (`false`, the default value).
|
|
17
|
-
* @throws {Error} If network traffic capture has failed to start.
|
|
18
|
-
* @returns {Promise<void>}
|
|
19
|
-
* @this {XCUITestDriver}
|
|
20
|
-
*/
|
|
21
|
-
constructor(this: import("../driver").XCUITestDriver, timeLimitSec?: number, forceRestart?: boolean);
|
|
22
|
-
_trafficCapture: TrafficCapture;
|
|
23
|
-
}
|
|
21
|
+
export declare function mobileStartPcap(this: XCUITestDriver, timeLimitSec?: number, forceRestart?: boolean): Promise<void>;
|
|
24
22
|
/**
|
|
25
23
|
* Stops network traffic capture.
|
|
26
24
|
*
|
|
@@ -29,26 +27,8 @@ export class mobileStartPcap {
|
|
|
29
27
|
* If no previously recorded file is found and no active traffic capture processes are running, then the method returns an empty string.
|
|
30
28
|
*
|
|
31
29
|
* @remarks Network capture files can be viewed in [Wireshark](https://www.wireshark.org/) and other similar applications.
|
|
32
|
-
* @returns
|
|
30
|
+
* @returns Base64-encoded content of the recorded pcap file or an empty string if no traffic capture has been started before.
|
|
33
31
|
* @throws {Error} If there was an error while getting the capture file.
|
|
34
|
-
* @this {XCUITestDriver}
|
|
35
32
|
*/
|
|
36
|
-
export function mobileStopPcap(this:
|
|
37
|
-
export class mobileStopPcap {
|
|
38
|
-
_trafficCapture: any;
|
|
39
|
-
}
|
|
40
|
-
export class TrafficCapture {
|
|
41
|
-
constructor(udid: any, log: any, resultPath: any);
|
|
42
|
-
/** @type {import('teen_process').SubProcess|null} */
|
|
43
|
-
mainProcess: import("teen_process").SubProcess | null;
|
|
44
|
-
udid: any;
|
|
45
|
-
log: any;
|
|
46
|
-
resultPath: any;
|
|
47
|
-
start(timeoutSeconds: any): Promise<void>;
|
|
48
|
-
isCapturing(): boolean;
|
|
49
|
-
interrupt(force?: boolean): Promise<boolean>;
|
|
50
|
-
finish(): Promise<any>;
|
|
51
|
-
cleanup(): Promise<void>;
|
|
52
|
-
}
|
|
53
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
33
|
+
export declare function mobileStopPcap(this: XCUITestDriver): Promise<string>;
|
|
54
34
|
//# sourceMappingURL=pcap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pcap.d.ts","sourceRoot":"","sources":["../../../lib/commands/pcap.
|
|
1
|
+
{"version":3,"file":"pcap.d.ts","sourceRoot":"","sources":["../../../lib/commands/pcap.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAM9C,qBAAa,cAAc;IACzB,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;IAC1B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;gBAExB,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM;IAMhD,KAAK,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBlD,WAAW,IAAI,OAAO;IAIhB,SAAS,CAAC,KAAK,UAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAkB1C,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAKzB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAK/B;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,cAAc,EACpB,YAAY,SAAM,EAClB,YAAY,UAAQ,GACnB,OAAO,CAAC,IAAI,CAAC,CA6Cf;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAsB1E"}
|
|
@@ -10,19 +10,20 @@ const driver_1 = require("appium/driver");
|
|
|
10
10
|
const MAX_CAPTURE_TIME_SEC = 60 * 60 * 12;
|
|
11
11
|
const DEFAULT_EXT = '.pcap';
|
|
12
12
|
class TrafficCapture {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
mainProcess = null;
|
|
14
|
+
udid;
|
|
15
|
+
log;
|
|
16
|
+
resultPath;
|
|
15
17
|
constructor(udid, log, resultPath) {
|
|
16
18
|
this.udid = udid;
|
|
17
19
|
this.log = log;
|
|
18
20
|
this.resultPath = resultPath;
|
|
19
|
-
this.mainProcess = null;
|
|
20
21
|
}
|
|
21
22
|
async start(timeoutSeconds) {
|
|
22
|
-
this.mainProcess =
|
|
23
|
+
this.mainProcess = await new py_ios_device_client_1.Pyidevice({
|
|
23
24
|
udid: this.udid,
|
|
24
25
|
log: this.log,
|
|
25
|
-
}).collectPcap(this.resultPath)
|
|
26
|
+
}).collectPcap(this.resultPath);
|
|
26
27
|
this.mainProcess.on('line-stderr', (line) => this.log.info(`[Pcap] ${line}`));
|
|
27
28
|
this.log.info(`Starting network traffic capture session on the device '${this.udid}'. ` +
|
|
28
29
|
`Will timeout in ${timeoutSeconds}s`);
|
|
@@ -64,11 +65,9 @@ exports.TrafficCapture = TrafficCapture;
|
|
|
64
65
|
/**
|
|
65
66
|
* Records the given network traffic capture into a .pcap file.
|
|
66
67
|
*
|
|
67
|
-
* @param
|
|
68
|
-
* @param
|
|
68
|
+
* @param timeLimitSec - The maximum recording time, in seconds. The maximum value is `43200` (12 hours).
|
|
69
|
+
* @param forceRestart - Whether to restart traffic capture process forcefully when startPcap is called (`true`) or ignore the call until the current traffic capture is completed (`false`, the default value).
|
|
69
70
|
* @throws {Error} If network traffic capture has failed to start.
|
|
70
|
-
* @returns {Promise<void>}
|
|
71
|
-
* @this {XCUITestDriver}
|
|
72
71
|
*/
|
|
73
72
|
async function mobileStartPcap(timeLimitSec = 180, forceRestart = false) {
|
|
74
73
|
if (this.isSimulator()) {
|
|
@@ -118,9 +117,8 @@ async function mobileStartPcap(timeLimitSec = 180, forceRestart = false) {
|
|
|
118
117
|
* If no previously recorded file is found and no active traffic capture processes are running, then the method returns an empty string.
|
|
119
118
|
*
|
|
120
119
|
* @remarks Network capture files can be viewed in [Wireshark](https://www.wireshark.org/) and other similar applications.
|
|
121
|
-
* @returns
|
|
120
|
+
* @returns Base64-encoded content of the recorded pcap file or an empty string if no traffic capture has been started before.
|
|
122
121
|
* @throws {Error} If there was an error while getting the capture file.
|
|
123
|
-
* @this {XCUITestDriver}
|
|
124
122
|
*/
|
|
125
123
|
async function mobileStopPcap() {
|
|
126
124
|
if (!this._trafficCapture) {
|
|
@@ -143,7 +141,4 @@ async function mobileStopPcap() {
|
|
|
143
141
|
}
|
|
144
142
|
return await (0, utils_1.encodeBase64OrUpload)(resultPath);
|
|
145
143
|
}
|
|
146
|
-
/**
|
|
147
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
148
|
-
*/
|
|
149
144
|
//# sourceMappingURL=pcap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pcap.js","sourceRoot":"","sources":["../../../lib/commands/pcap.
|
|
1
|
+
{"version":3,"file":"pcap.js","sourceRoot":"","sources":["../../../lib/commands/pcap.ts"],"names":[],"mappings":";;;AAkFA,0CAiDC;AAaD,wCAsBC;AAtKD,iFAAmE;AACnE,4CAAiD;AACjD,oCAA8C;AAC9C,0CAAqC;AAIrC,MAAM,oBAAoB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAC1C,MAAM,WAAW,GAAG,OAAO,CAAC;AAE5B,MAAa,cAAc;IACjB,WAAW,GAAsB,IAAI,CAAC;IAC7B,IAAI,CAAS;IACb,GAAG,CAAM;IACT,UAAU,CAAS;IAEpC,YAAY,IAA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,eAAe,GAAG,gBAAgB,CAAC;AAC1C,CAAC;AAED;;;;;;;;;;GAUG;AACI,KAAK,UAAU,cAAc;IAClC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;QAC1B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,0EAA0E,CAAC,CAAC;QAC1F,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,UAAkB,CAAC;IACvB,IAAI,CAAC;QACH,UAAU,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC;QACjD,IAAI,CAAC,CAAC,MAAM,YAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;YACnC,MAAM,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAC/B,iDAAiD;gBAC/C,2CAA2C,UAAU,GAAG,CAC3D,CAAC;QACJ,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;QACrC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,MAAM,CAAC,CAAC;IACV,CAAC;IACD,OAAO,MAAM,IAAA,4BAAoB,EAAC,UAAU,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -1,36 +1,34 @@
|
|
|
1
|
+
import { PermissionService } from './enum';
|
|
2
|
+
import type { XCUITestDriver } from '../driver';
|
|
3
|
+
import type { PermissionState } from './types';
|
|
1
4
|
/**
|
|
2
5
|
* Resets the given permission for the active application under test.
|
|
3
6
|
* Works for both Simulator and real devices using Xcode SDK 11.4+
|
|
4
7
|
*
|
|
5
|
-
* @param
|
|
6
|
-
* @throws
|
|
7
|
-
* @this {XCUITestDriver}
|
|
8
|
+
* @param service - One of the available service names. This could also be an integer protected resource identifier; see [this list](https://developer.apple.com/documentation/xctest/xcuiprotectedresource?language=objc)
|
|
9
|
+
* @throws If permission reset fails on the device.
|
|
8
10
|
*/
|
|
9
|
-
export function mobileResetPermission(this:
|
|
11
|
+
export declare function mobileResetPermission(this: XCUITestDriver, service: PermissionService | number): Promise<void>;
|
|
10
12
|
/**
|
|
11
13
|
* Gets application permission state on a simulated device.
|
|
12
14
|
*
|
|
13
15
|
* **This method requires [WIX applesimutils](https://github.com/wix/AppleSimulatorUtils) to be installed on the Appium server host.**
|
|
14
16
|
*
|
|
15
|
-
* @param
|
|
16
|
-
* @param
|
|
17
|
-
* @returns
|
|
18
|
-
* @throws
|
|
19
|
-
* @this {XCUITestDriver}
|
|
17
|
+
* @param bundleId - Bundle identifier of the target application
|
|
18
|
+
* @param service - Service name
|
|
19
|
+
* @returns Either 'yes', 'no', 'unset' or 'limited'
|
|
20
|
+
* @throws If permission getting fails or the device is not a Simulator.
|
|
20
21
|
* @group Simulator Only
|
|
21
22
|
*/
|
|
22
|
-
export function mobileGetPermission(this:
|
|
23
|
+
export declare function mobileGetPermission(this: XCUITestDriver, bundleId: string, service: PermissionService): Promise<PermissionState>;
|
|
23
24
|
/**
|
|
24
25
|
* Set application permission state on Simulator.
|
|
25
26
|
*
|
|
26
|
-
* @param
|
|
27
|
-
* @param
|
|
27
|
+
* @param access - One or more access rules to set.
|
|
28
|
+
* @param bundleId - Bundle identifier of the target application
|
|
28
29
|
* @since Xcode SDK 11.4
|
|
29
|
-
* @throws
|
|
30
|
+
* @throws If permission setting fails or the device is not a Simulator.
|
|
30
31
|
* @group Simulator Only
|
|
31
|
-
* @this {XCUITestDriver}
|
|
32
32
|
*/
|
|
33
|
-
export function mobileSetPermissions(this:
|
|
34
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
35
|
-
import { PermissionService } from './enum';
|
|
33
|
+
export declare function mobileSetPermissions(this: XCUITestDriver, access: Record<string, PermissionState>, bundleId: string): Promise<void>;
|
|
36
34
|
//# sourceMappingURL=permissions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../lib/commands/permissions.
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../lib/commands/permissions.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,iBAAiB,EAAC,MAAM,QAAQ,CAAC;AAEzC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;AAG7C;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,iBAAiB,GAAG,MAAM,GAClC,OAAO,CAAC,IAAI,CAAC,CAsBf;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,eAAe,CAAC,CAS1B;AAED;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,EACvC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAOf"}
|
|
@@ -9,14 +9,12 @@ exports.mobileSetPermissions = mobileSetPermissions;
|
|
|
9
9
|
const lodash_1 = __importDefault(require("lodash"));
|
|
10
10
|
const enum_1 = require("./enum");
|
|
11
11
|
const utils_1 = require("../utils");
|
|
12
|
-
const assertSimulator = (driver) => utils_1.assertSimulator.call(driver, 'Permission-related operations');
|
|
13
12
|
/**
|
|
14
13
|
* Resets the given permission for the active application under test.
|
|
15
14
|
* Works for both Simulator and real devices using Xcode SDK 11.4+
|
|
16
15
|
*
|
|
17
|
-
* @param
|
|
18
|
-
* @throws
|
|
19
|
-
* @this {XCUITestDriver}
|
|
16
|
+
* @param service - One of the available service names. This could also be an integer protected resource identifier; see [this list](https://developer.apple.com/documentation/xctest/xcuiprotectedresource?language=objc)
|
|
17
|
+
* @throws If permission reset fails on the device.
|
|
20
18
|
*/
|
|
21
19
|
async function mobileResetPermission(service) {
|
|
22
20
|
if (!service) {
|
|
@@ -43,11 +41,10 @@ async function mobileResetPermission(service) {
|
|
|
43
41
|
*
|
|
44
42
|
* **This method requires [WIX applesimutils](https://github.com/wix/AppleSimulatorUtils) to be installed on the Appium server host.**
|
|
45
43
|
*
|
|
46
|
-
* @param
|
|
47
|
-
* @param
|
|
48
|
-
* @returns
|
|
49
|
-
* @throws
|
|
50
|
-
* @this {XCUITestDriver}
|
|
44
|
+
* @param bundleId - Bundle identifier of the target application
|
|
45
|
+
* @param service - Service name
|
|
46
|
+
* @returns Either 'yes', 'no', 'unset' or 'limited'
|
|
47
|
+
* @throws If permission getting fails or the device is not a Simulator.
|
|
51
48
|
* @group Simulator Only
|
|
52
49
|
*/
|
|
53
50
|
async function mobileGetPermission(bundleId, service) {
|
|
@@ -55,26 +52,23 @@ async function mobileGetPermission(bundleId, service) {
|
|
|
55
52
|
throw new Error(`The 'service' option is expected to be present`);
|
|
56
53
|
}
|
|
57
54
|
assertSimulator(this);
|
|
58
|
-
return
|
|
55
|
+
return await this.device.getPermission(bundleId, String(service));
|
|
59
56
|
}
|
|
60
57
|
/**
|
|
61
58
|
* Set application permission state on Simulator.
|
|
62
59
|
*
|
|
63
|
-
* @param
|
|
64
|
-
* @param
|
|
60
|
+
* @param access - One or more access rules to set.
|
|
61
|
+
* @param bundleId - Bundle identifier of the target application
|
|
65
62
|
* @since Xcode SDK 11.4
|
|
66
|
-
* @throws
|
|
63
|
+
* @throws If permission setting fails or the device is not a Simulator.
|
|
67
64
|
* @group Simulator Only
|
|
68
|
-
* @this {XCUITestDriver}
|
|
69
65
|
*/
|
|
70
66
|
async function mobileSetPermissions(access, bundleId) {
|
|
71
67
|
if (!lodash_1.default.isPlainObject(access)) {
|
|
72
68
|
throw new Error(`The 'access' option is expected to be a map`);
|
|
73
69
|
}
|
|
74
70
|
assertSimulator(this);
|
|
75
|
-
await
|
|
71
|
+
await this.device.setPermissions(bundleId, access);
|
|
76
72
|
}
|
|
77
|
-
|
|
78
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
79
|
-
*/
|
|
73
|
+
const assertSimulator = (driver) => utils_1.assertSimulator.call(driver, 'Permission-related operations');
|
|
80
74
|
//# sourceMappingURL=permissions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../../lib/commands/permissions.
|
|
1
|
+
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../../lib/commands/permissions.ts"],"names":[],"mappings":";;;;;AAcA,sDAyBC;AAaD,kDAaC;AAWD,oDAWC;AAvFD,oDAAuB;AACvB,iCAAyC;AACzC,oCAA6D;AAK7D;;;;;;GAMG;AACI,KAAK,UAAU,qBAAqB,CAEzC,OAAmC;IAEnC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IACD,IAAI,QAAgB,CAAC;IACrB,IAAI,gBAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACxB,QAAQ,GAAG,wBAAiB,CAAC,gBAAC,CAAC,OAAO,CAAC,OAAO,CAAmC,CAAC,CAAC;QACnF,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CACb,qCAAqC,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,gBAAC,CAAC,IAAI,CAAC,wBAAiB,CAAC,CAAC,EAAE,CACvF,CAAC;QACJ,CAAC;IACH,CAAC;SAAM,IAAI,gBAAC,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;QAChC,QAAQ,GAAG,OAAO,CAAC;IACrB,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CACb,6DAA6D;YAC3D,IAAI,OAAO,qBAAqB,CACnC,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,CAAC,YAAY,CAAC,mBAAmB,EAAE,MAAM,EAAE,EAAC,QAAQ,EAAC,CAAC,CAAC;AACnE,CAAC;AAED;;;;;;;;;;GAUG;AACI,KAAK,UAAU,mBAAmB,CAEvC,QAAgB,EAChB,OAA0B;IAE1B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IACD,eAAe,CAAC,IAAI,CAAC,CAAC;IAEtB,OAAO,MAAO,IAAI,CAAC,MAAoB,CAAC,aAAa,CACnD,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,CACP,CAAC;AACvB,CAAC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,oBAAoB,CAExC,MAAuC,EACvC,QAAgB;IAEhB,IAAI,CAAC,gBAAC,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACjE,CAAC;IACD,eAAe,CAAC,IAAI,CAAC,CAAC;IAEtB,MAAO,IAAI,CAAC,MAAoB,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,eAAe,GAAG,CAAC,MAAsB,EAAE,EAAE,CAAC,uBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,+BAA+B,CAAC,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
2
|
+
export type AllowedHttpMethod = 'GET' | 'POST' | 'DELETE';
|
|
1
3
|
/**
|
|
2
4
|
* Proxies a command to WebDriverAgent
|
|
3
|
-
*
|
|
4
|
-
* @template
|
|
5
|
-
* @
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
9
|
-
* @this
|
|
10
|
-
* @returns
|
|
5
|
+
*
|
|
6
|
+
* @template TReq - Request body type
|
|
7
|
+
* @template TRes - Response type
|
|
8
|
+
* @param url - The endpoint URL
|
|
9
|
+
* @param method - HTTP method to use
|
|
10
|
+
* @param body - Optional request body
|
|
11
|
+
* @param isSessionCommand - Whether this is a session command (default: true)
|
|
12
|
+
* @returns Promise resolving to the response
|
|
11
13
|
*/
|
|
12
|
-
export function proxyCommand<TReq = any, TRes = unknown>(this:
|
|
13
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
14
|
-
export type AllowedHttpMethod = "GET" | "POST" | "DELETE";
|
|
14
|
+
export declare function proxyCommand<TReq = any, TRes = unknown>(this: XCUITestDriver, url: string, method: AllowedHttpMethod, body?: TReq, isSessionCommand?: boolean): Promise<TRes>;
|
|
15
15
|
//# sourceMappingURL=proxy-helper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-helper.d.ts","sourceRoot":"","sources":["../../../lib/commands/proxy-helper.
|
|
1
|
+
{"version":3,"file":"proxy-helper.d.ts","sourceRoot":"","sources":["../../../lib/commands/proxy-helper.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AA8C9C,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE1D;;;;;;;;;;GAUG;AACH,wBAAsB,YAAY,CAAC,IAAI,GAAG,GAAG,EAAE,IAAI,GAAG,OAAO,EAC3D,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,iBAAiB,EACzB,IAAI,CAAC,EAAE,IAAI,EACX,gBAAgB,GAAE,OAAc,GAC/B,OAAO,CAAC,IAAI,CAAC,CA4Cf"}
|
|
@@ -9,8 +9,8 @@ const bluebird_1 = __importDefault(require("bluebird"));
|
|
|
9
9
|
const GET = 'GET';
|
|
10
10
|
const POST = 'POST';
|
|
11
11
|
const DELETE = 'DELETE';
|
|
12
|
-
const SUPPORTED_METHODS = Object.freeze(new Set(
|
|
13
|
-
const WDA_ROUTES =
|
|
12
|
+
const SUPPORTED_METHODS = Object.freeze(new Set([GET, POST, DELETE]));
|
|
13
|
+
const WDA_ROUTES = {
|
|
14
14
|
'/wda/screen': {
|
|
15
15
|
GET: 'getScreenInfo',
|
|
16
16
|
},
|
|
@@ -47,21 +47,21 @@ const WDA_ROUTES = /** @type {const} */ ({
|
|
|
47
47
|
'/wda/locked': {
|
|
48
48
|
GET: 'isLocked',
|
|
49
49
|
},
|
|
50
|
-
}
|
|
50
|
+
};
|
|
51
51
|
/**
|
|
52
52
|
* Proxies a command to WebDriverAgent
|
|
53
|
-
*
|
|
54
|
-
* @template
|
|
55
|
-
* @
|
|
56
|
-
* @param
|
|
57
|
-
* @param
|
|
58
|
-
* @param
|
|
59
|
-
* @this
|
|
60
|
-
* @returns
|
|
53
|
+
*
|
|
54
|
+
* @template TReq - Request body type
|
|
55
|
+
* @template TRes - Response type
|
|
56
|
+
* @param url - The endpoint URL
|
|
57
|
+
* @param method - HTTP method to use
|
|
58
|
+
* @param body - Optional request body
|
|
59
|
+
* @param isSessionCommand - Whether this is a session command (default: true)
|
|
60
|
+
* @returns Promise resolving to the response
|
|
61
61
|
*/
|
|
62
62
|
async function proxyCommand(url, method, body, isSessionCommand = true) {
|
|
63
63
|
if (this.shutdownUnexpectedly) {
|
|
64
|
-
return
|
|
64
|
+
return undefined;
|
|
65
65
|
}
|
|
66
66
|
if (!url) {
|
|
67
67
|
throw this.log.errorWithException('Proxying requires an endpoint');
|
|
@@ -81,11 +81,11 @@ async function proxyCommand(url, method, body, isSessionCommand = true) {
|
|
|
81
81
|
this.log.info(`Proxying to WDA with an unknown route: ${method} ${url}`);
|
|
82
82
|
}
|
|
83
83
|
if (!timeout) {
|
|
84
|
-
return
|
|
84
|
+
return await proxy.command(url, method, body);
|
|
85
85
|
}
|
|
86
86
|
this.log.debug(`Setting custom timeout to ${timeout} ms for '${cmdName}' command`);
|
|
87
87
|
try {
|
|
88
|
-
return
|
|
88
|
+
return await bluebird_1.default.resolve(proxy.command(url, method, body)).timeout(timeout);
|
|
89
89
|
}
|
|
90
90
|
catch (e) {
|
|
91
91
|
if (!(e instanceof bluebird_1.default.Promise.TimeoutError)) {
|
|
@@ -97,18 +97,9 @@ async function proxyCommand(url, method, body, isSessionCommand = true) {
|
|
|
97
97
|
throw error;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
/**
|
|
101
|
-
* @param {string} endpoint
|
|
102
|
-
* @param {AllowedHttpMethod} method
|
|
103
|
-
* @returns {string|undefined}
|
|
104
|
-
*/
|
|
105
100
|
function wdaRouteToCommandName(endpoint, method) {
|
|
106
101
|
if (endpoint in WDA_ROUTES) {
|
|
107
|
-
return WDA_ROUTES[endpoint][method];
|
|
102
|
+
return WDA_ROUTES[endpoint]?.[method];
|
|
108
103
|
}
|
|
109
104
|
}
|
|
110
|
-
/**
|
|
111
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
112
|
-
* @typedef {'GET'|'POST'|'DELETE'} AllowedHttpMethod
|
|
113
|
-
*/
|
|
114
105
|
//# sourceMappingURL=proxy-helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-helper.js","sourceRoot":"","sources":["../../../lib/commands/proxy-helper.
|
|
1
|
+
{"version":3,"file":"proxy-helper.js","sourceRoot":"","sources":["../../../lib/commands/proxy-helper.ts"],"names":[],"mappings":";;;;;AA6DA,oCAkDC;AA/GD,0CAAyD;AACzD,wDAAyB;AAGzB,MAAM,GAAG,GAAG,KAAK,CAAC;AAClB,MAAM,IAAI,GAAG,MAAM,CAAC;AACpB,MAAM,MAAM,GAAG,QAAQ,CAAC;AACxB,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAU,CAAC,CAAC,CAAC;AAE/E,MAAM,UAAU,GAAG;IACjB,aAAa,EAAE;QACb,GAAG,EAAE,eA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