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,16 +1,22 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
2
|
+
import type { Element } from '@appium/types';
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
+
* Takes a screenshot of the current screen.
|
|
5
|
+
*
|
|
6
|
+
* @returns Base64-encoded screenshot data
|
|
4
7
|
*/
|
|
5
|
-
export function getScreenshot(this:
|
|
8
|
+
export declare function getScreenshot(this: XCUITestDriver): Promise<string>;
|
|
6
9
|
/**
|
|
7
|
-
*
|
|
10
|
+
* Takes a screenshot of a specific element.
|
|
11
|
+
*
|
|
12
|
+
* @param el - Element to capture
|
|
13
|
+
* @returns Base64-encoded screenshot data
|
|
8
14
|
*/
|
|
9
|
-
export function getElementScreenshot(this:
|
|
15
|
+
export declare function getElementScreenshot(this: XCUITestDriver, el: Element<string> | string): Promise<string>;
|
|
10
16
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
17
|
+
* Takes a screenshot of the current viewport.
|
|
18
|
+
*
|
|
19
|
+
* @returns Base64-encoded screenshot data
|
|
13
20
|
*/
|
|
14
|
-
export function getViewportScreenshot(this:
|
|
15
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
21
|
+
export declare function getViewportScreenshot(this: XCUITestDriver): Promise<string>;
|
|
16
22
|
//# sourceMappingURL=screenshots.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshots.d.ts","sourceRoot":"","sources":["../../../lib/commands/screenshots.
|
|
1
|
+
{"version":3,"file":"screenshots.d.ts","sourceRoot":"","sources":["../../../lib/commands/screenshots.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAE9C,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAE3C;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA8DzE;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,GAC3B,OAAO,CAAC,MAAM,CAAC,CAmBjB;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA6BjF"}
|
|
@@ -11,8 +11,9 @@ const lodash_1 = __importDefault(require("lodash"));
|
|
|
11
11
|
const driver_1 = require("appium/driver");
|
|
12
12
|
const support_1 = require("appium/support");
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* Takes a screenshot of the current screen.
|
|
15
|
+
*
|
|
16
|
+
* @returns Base64-encoded screenshot data
|
|
16
17
|
*/
|
|
17
18
|
async function getScreenshot() {
|
|
18
19
|
if (this.isWebContext()) {
|
|
@@ -21,7 +22,7 @@ async function getScreenshot() {
|
|
|
21
22
|
case 'page':
|
|
22
23
|
case 'viewport':
|
|
23
24
|
return await this.remote.captureScreenshot({
|
|
24
|
-
coordinateSystem:
|
|
25
|
+
coordinateSystem: lodash_1.default.capitalize(webScreenshotMode),
|
|
25
26
|
});
|
|
26
27
|
case 'native':
|
|
27
28
|
case undefined:
|
|
@@ -60,17 +61,20 @@ async function getScreenshot() {
|
|
|
60
61
|
// simulator attempt
|
|
61
62
|
if (this.isSimulator()) {
|
|
62
63
|
this.log.info(`Falling back to 'simctl io screenshot' API`);
|
|
63
|
-
const payload = await
|
|
64
|
+
const payload = await this.device.simctl.getScreenshot();
|
|
64
65
|
if (!payload) {
|
|
65
66
|
throw new driver_1.errors.UnableToCaptureScreen();
|
|
66
67
|
}
|
|
67
68
|
return payload;
|
|
68
69
|
}
|
|
69
70
|
// Retry for real devices only. Fail fast on Simulator if simctl does not work as expected
|
|
70
|
-
return
|
|
71
|
+
return await (0, asyncbox_1.retryInterval)(2, 1000, getScreenshotFromWDA);
|
|
71
72
|
}
|
|
72
73
|
/**
|
|
73
|
-
*
|
|
74
|
+
* Takes a screenshot of a specific element.
|
|
75
|
+
*
|
|
76
|
+
* @param el - Element to capture
|
|
77
|
+
* @returns Base64-encoded screenshot data
|
|
74
78
|
*/
|
|
75
79
|
async function getElementScreenshot(el) {
|
|
76
80
|
el = support_1.util.unwrapElement(el);
|
|
@@ -90,8 +94,9 @@ async function getElementScreenshot(el) {
|
|
|
90
94
|
return data;
|
|
91
95
|
}
|
|
92
96
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
97
|
+
* Takes a screenshot of the current viewport.
|
|
98
|
+
*
|
|
99
|
+
* @returns Base64-encoded screenshot data
|
|
95
100
|
*/
|
|
96
101
|
async function getViewportScreenshot() {
|
|
97
102
|
if (this.isWebContext()) {
|
|
@@ -121,7 +126,4 @@ async function getViewportScreenshot() {
|
|
|
121
126
|
this.log.debug(`Calculated viewport rect: ${JSON.stringify(region)}`);
|
|
122
127
|
return await support_1.imageUtil.cropBase64Image(screenshot, region);
|
|
123
128
|
}
|
|
124
|
-
/**
|
|
125
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
126
|
-
*/
|
|
127
129
|
//# sourceMappingURL=screenshots.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshots.js","sourceRoot":"","sources":["../../../lib/commands/screenshots.
|
|
1
|
+
{"version":3,"file":"screenshots.js","sourceRoot":"","sources":["../../../lib/commands/screenshots.ts"],"names":[],"mappings":";;;;;AAaA,sCA8DC;AAQD,oDAsBC;AAOD,sDA6BC;AA7ID,uCAAuC;AACvC,oDAAuB;AACvB,0CAAqC;AACrC,4CAA+C;AAK/C;;;;GAIG;AACI,KAAK,UAAU,aAAa;IACjC,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;QACxB,MAAM,iBAAiB,GAAG,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,iBAAiB,CAAC;QAChF,QAAQ,gBAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,CAAC;YACrC,KAAK,MAAM,CAAC;YACZ,KAAK,UAAU;gBACb,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC;oBACzC,gBAAgB,EAAE,gBAAC,CAAC,UAAU,CAAC,iBAAiB,CAAwB;i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,CAAC,CAAC;QACnF,MAAM,CAAC,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC;IACrC,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,GAAG,MAAM,EAAE,CAAC;QACxC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,oEAAoE,CAAC,CAAC;QACpF,MAAM,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC;IACtC,CAAC;IACD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,6BAA6B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACtE,OAAO,MAAM,mBAAS,CAAC,eAAe,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -1,27 +1,21 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
2
|
+
export interface SimctlExecResponse {
|
|
3
|
+
/** The output of standard out. */
|
|
4
|
+
stdout: string;
|
|
5
|
+
/** The output of standard error. */
|
|
6
|
+
stderr: string;
|
|
7
|
+
/** Return code. */
|
|
8
|
+
code: number;
|
|
9
|
+
}
|
|
1
10
|
/**
|
|
2
11
|
* Run the given command with arguments as `xcrun simctl` subcommand.
|
|
3
12
|
* This method works behind the 'simctl' security flag.
|
|
4
|
-
*
|
|
5
|
-
* @param
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
-
* @returns
|
|
9
|
-
* @throws
|
|
13
|
+
*
|
|
14
|
+
* @param command - Subcommand to run with `xcrun simctl`. Must be one of the supported commands.
|
|
15
|
+
* @param args - Arguments for the subcommand. The arguments should be after <device> in the help.
|
|
16
|
+
* @param timeout - The maximum number of milliseconds
|
|
17
|
+
* @returns The execution result with stdout, stderr, and return code
|
|
18
|
+
* @throws If the simctl subcommand command returns non-zero return code, or the given subcommand was invalid.
|
|
10
19
|
*/
|
|
11
|
-
export function mobileSimctl(this:
|
|
12
|
-
export type SimctlExecResponse = {
|
|
13
|
-
/**
|
|
14
|
-
* The output of standard out.
|
|
15
|
-
*/
|
|
16
|
-
stdout: string;
|
|
17
|
-
/**
|
|
18
|
-
* The output of standard error.
|
|
19
|
-
*/
|
|
20
|
-
stderr: string;
|
|
21
|
-
/**
|
|
22
|
-
* Return code.
|
|
23
|
-
*/
|
|
24
|
-
code: number;
|
|
25
|
-
};
|
|
26
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
20
|
+
export declare function mobileSimctl(this: XCUITestDriver, command: string, args?: string[], timeout?: number): Promise<SimctlExecResponse>;
|
|
27
21
|
//# sourceMappingURL=simctl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simctl.d.ts","sourceRoot":"","sources":["../../../lib/commands/simctl.
|
|
1
|
+
{"version":3,"file":"simctl.d.ts","sourceRoot":"","sources":["../../../lib/commands/simctl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAgC9C,MAAM,WAAW,kBAAkB;IACjC,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,kBAAkB,CAAC,CAuB7B"}
|
|
@@ -33,14 +33,14 @@ const SUBCOMMANDS_HAS_DEVICE = [
|
|
|
33
33
|
/**
|
|
34
34
|
* Run the given command with arguments as `xcrun simctl` subcommand.
|
|
35
35
|
* This method works behind the 'simctl' security flag.
|
|
36
|
-
*
|
|
37
|
-
* @param
|
|
38
|
-
* @param
|
|
39
|
-
* @param
|
|
40
|
-
* @returns
|
|
41
|
-
* @throws
|
|
36
|
+
*
|
|
37
|
+
* @param command - Subcommand to run with `xcrun simctl`. Must be one of the supported commands.
|
|
38
|
+
* @param args - Arguments for the subcommand. The arguments should be after <device> in the help.
|
|
39
|
+
* @param timeout - The maximum number of milliseconds
|
|
40
|
+
* @returns The execution result with stdout, stderr, and return code
|
|
41
|
+
* @throws If the simctl subcommand command returns non-zero return code, or the given subcommand was invalid.
|
|
42
42
|
*/
|
|
43
|
-
async function mobileSimctl(command, args = [], timeout
|
|
43
|
+
async function mobileSimctl(command, args = [], timeout) {
|
|
44
44
|
if (!this.isSimulator()) {
|
|
45
45
|
throw new driver_1.errors.UnsupportedOperationError(`Only simulator is supported.`);
|
|
46
46
|
}
|
|
@@ -51,20 +51,11 @@ async function mobileSimctl(command, args = [], timeout = undefined) {
|
|
|
51
51
|
throw new driver_1.errors.InvalidArgumentError(`The given command '${command}' is not supported. ` +
|
|
52
52
|
`Available subcommands are ${SUBCOMMANDS_HAS_DEVICE.join(',')}`);
|
|
53
53
|
}
|
|
54
|
-
const result = await
|
|
54
|
+
const result = await this.device.simctl.exec(command, { args: [this.opts.udid, ...args], timeout });
|
|
55
55
|
return {
|
|
56
56
|
stdout: result?.stdout ?? '',
|
|
57
57
|
stderr: result?.stderr ?? '',
|
|
58
58
|
code: result?.code ?? 0
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
/**
|
|
62
|
-
* @typedef {Object} SimctlExecResponse
|
|
63
|
-
* @property {string} stdout The output of standard out.
|
|
64
|
-
* @property {string} stderr The output of standard error.
|
|
65
|
-
* @property {number} code Return code.
|
|
66
|
-
*/
|
|
67
|
-
/**
|
|
68
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
69
|
-
*/
|
|
70
61
|
//# sourceMappingURL=simctl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simctl.js","sourceRoot":"","sources":["../../../lib/commands/simctl.
|
|
1
|
+
{"version":3,"file":"simctl.js","source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,EAAE,MAAM,IAAI,EAAE;QAC5B,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,EAAE;QAC5B,IAAI,EAAE,MAAM,EAAE,IAAI,IAAI,CAAC;KACxB,CAAC;AACJ,CAAC"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
2
|
+
import type { SourceFormat } from './types';
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
4
|
+
* Retrieves the page source of the current application.
|
|
5
|
+
*
|
|
6
|
+
* @returns The page source as XML or HTML string
|
|
3
7
|
*/
|
|
4
|
-
export function getPageSource(this:
|
|
8
|
+
export declare function getPageSource(this: XCUITestDriver): Promise<string>;
|
|
5
9
|
/**
|
|
6
10
|
* Retrieve the source tree of the current page in XML or JSON format.
|
|
7
11
|
*
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
12
|
+
* @param format - Page tree source representation format.
|
|
13
|
+
* @param excludedAttributes - A comma-separated string of attribute names to exclude from the output. Only works if `format` is `xml`.
|
|
10
14
|
* @privateRemarks Why isn't `excludedAttributes` an array?
|
|
11
|
-
* @returns
|
|
12
|
-
* @this {XCUITestDriver}
|
|
15
|
+
* @returns The source tree of the current page in the given format.
|
|
13
16
|
*/
|
|
14
|
-
export function mobileGetSource(this:
|
|
15
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
17
|
+
export declare function mobileGetSource(this: XCUITestDriver, format?: SourceFormat, excludedAttributes?: string): Promise<string>;
|
|
16
18
|
//# sourceMappingURL=source.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../lib/commands/source.
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../lib/commands/source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAI1C;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBzE;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,cAAc,EACpB,MAAM,GAAE,YAAoB,EAC5B,kBAAkB,CAAC,EAAE,MAAM,GAC1B,OAAO,CAAC,MAAM,CAAC,CAYjB"}
|
|
@@ -9,7 +9,9 @@ const lodash_1 = __importDefault(require("lodash"));
|
|
|
9
9
|
const js2xmlparser2_1 = __importDefault(require("js2xmlparser2"));
|
|
10
10
|
const APPIUM_AUT_TAG = 'AppiumAUT';
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Retrieves the page source of the current application.
|
|
13
|
+
*
|
|
14
|
+
* @returns The page source as XML or HTML string
|
|
13
15
|
*/
|
|
14
16
|
async function getPageSource() {
|
|
15
17
|
if (this.isWebContext()) {
|
|
@@ -27,11 +29,10 @@ async function getPageSource() {
|
|
|
27
29
|
/**
|
|
28
30
|
* Retrieve the source tree of the current page in XML or JSON format.
|
|
29
31
|
*
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
32
|
+
* @param format - Page tree source representation format.
|
|
33
|
+
* @param excludedAttributes - A comma-separated string of attribute names to exclude from the output. Only works if `format` is `xml`.
|
|
32
34
|
* @privateRemarks Why isn't `excludedAttributes` an array?
|
|
33
|
-
* @returns
|
|
34
|
-
* @this {XCUITestDriver}
|
|
35
|
+
* @returns The source tree of the current page in the given format.
|
|
35
36
|
*/
|
|
36
37
|
async function mobileGetSource(format = 'xml', excludedAttributes) {
|
|
37
38
|
const paramsMap = {
|
|
@@ -44,7 +45,7 @@ async function mobileGetSource(format = 'xml', excludedAttributes) {
|
|
|
44
45
|
const query = Object.entries(paramsMap)
|
|
45
46
|
.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)
|
|
46
47
|
.join('&');
|
|
47
|
-
return
|
|
48
|
+
return await this.proxyCommand(`/source?${query}`, 'GET');
|
|
48
49
|
}
|
|
49
50
|
/**
|
|
50
51
|
* Will get JSON of the form:
|
|
@@ -76,13 +77,12 @@ async function mobileGetSource(format = 'xml', excludedAttributes) {
|
|
|
76
77
|
*/
|
|
77
78
|
function getTreeForXML(srcTree) {
|
|
78
79
|
function getTree(element, elementIndex, parentPath) {
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
const curPath = `${parentPath}/${elementIndex}`;
|
|
81
|
+
const rect = element.rect || {};
|
|
81
82
|
/**
|
|
82
83
|
* @privateRemarks I don't even want to try to type this right now
|
|
83
|
-
* @type {any}
|
|
84
84
|
*/
|
|
85
|
-
|
|
85
|
+
const subtree = {
|
|
86
86
|
'@': {
|
|
87
87
|
type: `XCUIElementType${element.type}`,
|
|
88
88
|
enabled: parseInt(element.isEnabled, 10) === 1,
|
|
@@ -112,7 +112,7 @@ function getTreeForXML(srcTree) {
|
|
|
112
112
|
[`XCUIElementType${element.type}`]: subtree,
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
|
-
|
|
115
|
+
const tree = getTree(srcTree, 0, '');
|
|
116
116
|
return tree;
|
|
117
117
|
}
|
|
118
118
|
function getSourceXml(jsonSource) {
|
|
@@ -122,7 +122,4 @@ function getSourceXml(jsonSource) {
|
|
|
122
122
|
prettyPrinting: { indentString: ' ' },
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
|
-
/**
|
|
126
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
127
|
-
*/
|
|
128
125
|
//# sourceMappingURL=source.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../../lib/commands/source.
|
|
1
|
+
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../../lib/commands/source.ts"],"names":[],"mappings":";;;;;AAYA,sCAiBC;AAUD,0CAgBC;AAvDD,oDAAuB;AACvB,kEAAmC;AAInC,MAAM,cAAc,GAAG,WAAW,CAAC;AAE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
-
export function pageLoadTimeoutW3C(this:
|
|
7
|
+
export declare function pageLoadTimeoutW3C(this: XCUITestDriver, ms: number): Promise<void>;
|
|
5
8
|
/**
|
|
6
|
-
*
|
|
9
|
+
* Sets the page load timeout using MJSONWP protocol.
|
|
10
|
+
*
|
|
11
|
+
* @param ms - Timeout in milliseconds
|
|
7
12
|
*/
|
|
8
|
-
export function pageLoadTimeoutMJSONWP(this:
|
|
13
|
+
export declare function pageLoadTimeoutMJSONWP(this: XCUITestDriver, ms: number): Promise<void>;
|
|
9
14
|
/**
|
|
10
|
-
*
|
|
15
|
+
* Sets the async script timeout using W3C protocol.
|
|
16
|
+
*
|
|
17
|
+
* @param ms - Timeout in milliseconds
|
|
11
18
|
*/
|
|
12
|
-
export function scriptTimeoutW3C(this:
|
|
19
|
+
export declare function scriptTimeoutW3C(this: XCUITestDriver, ms: number): Promise<void>;
|
|
13
20
|
/**
|
|
14
21
|
* Alias for {@linkcode XCUITestDriver.scriptTimeoutW3C}.
|
|
15
22
|
*
|
|
16
|
-
* @param
|
|
17
|
-
* @this {XCUITestDriver}
|
|
23
|
+
* @param ms - The timeout in milliseconds
|
|
18
24
|
* @deprecated Use {@linkcode XCUITestDriver.scriptTimeoutW3C} instead
|
|
19
25
|
*/
|
|
20
|
-
export function scriptTimeoutMJSONWP(this:
|
|
26
|
+
export declare function scriptTimeoutMJSONWP(this: XCUITestDriver, ms: number): Promise<void>;
|
|
21
27
|
/**
|
|
22
28
|
* Alias for {@linkcode XCUITestDriver.scriptTimeoutW3C}.
|
|
23
29
|
*
|
|
24
|
-
* @param
|
|
25
|
-
*
|
|
30
|
+
* @param ms - The timeout in milliseconds
|
|
26
31
|
* @deprecated Use {@linkcode XCUITestDriver.scriptTimeoutW3C} instead
|
|
27
|
-
* @this {XCUITestDriver}
|
|
28
32
|
*/
|
|
29
|
-
export function asyncScriptTimeout(this:
|
|
33
|
+
export declare function asyncScriptTimeout(this: XCUITestDriver, ms: number): Promise<void>;
|
|
30
34
|
/**
|
|
31
|
-
*
|
|
35
|
+
* Sets the page load timeout.
|
|
36
|
+
*
|
|
37
|
+
* @param ms - Timeout in milliseconds
|
|
32
38
|
*/
|
|
33
|
-
export function setPageLoadTimeout(this:
|
|
34
|
-
export class setPageLoadTimeout {
|
|
35
|
-
/**
|
|
36
|
-
* @this {XCUITestDriver}
|
|
37
|
-
*/
|
|
38
|
-
constructor(this: import("../driver").XCUITestDriver, ms: any);
|
|
39
|
-
pageLoadMs: any;
|
|
40
|
-
}
|
|
39
|
+
export declare function setPageLoadTimeout(this: XCUITestDriver, ms: number): void;
|
|
41
40
|
/**
|
|
42
|
-
*
|
|
41
|
+
* Sets the async script timeout.
|
|
42
|
+
*
|
|
43
|
+
* @param ms - Timeout in milliseconds
|
|
43
44
|
*/
|
|
44
|
-
export function setAsyncScriptTimeout(this:
|
|
45
|
-
export class setAsyncScriptTimeout {
|
|
46
|
-
/**
|
|
47
|
-
* @this {XCUITestDriver}
|
|
48
|
-
*/
|
|
49
|
-
constructor(this: import("../driver").XCUITestDriver, ms: any);
|
|
50
|
-
asyncWaitMs: any;
|
|
51
|
-
}
|
|
52
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
45
|
+
export declare function setAsyncScriptTimeout(this: XCUITestDriver, ms: number): void;
|
|
53
46
|
//# sourceMappingURL=timeouts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeouts.d.ts","sourceRoot":"","sources":["../../../lib/commands/timeouts.
|
|
1
|
+
{"version":3,"file":"timeouts.d.ts","sourceRoot":"","sources":["../../../lib/commands/timeouts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAE9C;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CAGf;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,GACT,IAAI,CAON;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,GACT,IAAI,CAGN"}
|
|
@@ -8,19 +8,25 @@ exports.asyncScriptTimeout = asyncScriptTimeout;
|
|
|
8
8
|
exports.setPageLoadTimeout = setPageLoadTimeout;
|
|
9
9
|
exports.setAsyncScriptTimeout = setAsyncScriptTimeout;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Sets the page load timeout using W3C protocol.
|
|
12
|
+
*
|
|
13
|
+
* @param ms - Timeout in milliseconds
|
|
12
14
|
*/
|
|
13
15
|
async function pageLoadTimeoutW3C(ms) {
|
|
14
16
|
await this.setPageLoadTimeout(this.parseTimeoutArgument(ms));
|
|
15
17
|
}
|
|
16
18
|
/**
|
|
17
|
-
*
|
|
19
|
+
* Sets the page load timeout using MJSONWP protocol.
|
|
20
|
+
*
|
|
21
|
+
* @param ms - Timeout in milliseconds
|
|
18
22
|
*/
|
|
19
23
|
async function pageLoadTimeoutMJSONWP(ms) {
|
|
20
24
|
await this.setPageLoadTimeout(this.parseTimeoutArgument(ms));
|
|
21
25
|
}
|
|
22
26
|
/**
|
|
23
|
-
*
|
|
27
|
+
* Sets the async script timeout using W3C protocol.
|
|
28
|
+
*
|
|
29
|
+
* @param ms - Timeout in milliseconds
|
|
24
30
|
*/
|
|
25
31
|
async function scriptTimeoutW3C(ms) {
|
|
26
32
|
// XXX: this is synchronous
|
|
@@ -29,8 +35,7 @@ async function scriptTimeoutW3C(ms) {
|
|
|
29
35
|
/**
|
|
30
36
|
* Alias for {@linkcode XCUITestDriver.scriptTimeoutW3C}.
|
|
31
37
|
*
|
|
32
|
-
* @param
|
|
33
|
-
* @this {XCUITestDriver}
|
|
38
|
+
* @param ms - The timeout in milliseconds
|
|
34
39
|
* @deprecated Use {@linkcode XCUITestDriver.scriptTimeoutW3C} instead
|
|
35
40
|
*/
|
|
36
41
|
async function scriptTimeoutMJSONWP(ms) {
|
|
@@ -39,19 +44,19 @@ async function scriptTimeoutMJSONWP(ms) {
|
|
|
39
44
|
/**
|
|
40
45
|
* Alias for {@linkcode XCUITestDriver.scriptTimeoutW3C}.
|
|
41
46
|
*
|
|
42
|
-
* @param
|
|
43
|
-
*
|
|
47
|
+
* @param ms - The timeout in milliseconds
|
|
44
48
|
* @deprecated Use {@linkcode XCUITestDriver.scriptTimeoutW3C} instead
|
|
45
|
-
* @this {XCUITestDriver}
|
|
46
49
|
*/
|
|
47
50
|
async function asyncScriptTimeout(ms) {
|
|
48
51
|
await this.scriptTimeoutW3C(ms);
|
|
49
52
|
}
|
|
50
53
|
/**
|
|
51
|
-
*
|
|
54
|
+
* Sets the page load timeout.
|
|
55
|
+
*
|
|
56
|
+
* @param ms - Timeout in milliseconds
|
|
52
57
|
*/
|
|
53
58
|
function setPageLoadTimeout(ms) {
|
|
54
|
-
ms = parseInt(ms, 10);
|
|
59
|
+
ms = parseInt(String(ms), 10);
|
|
55
60
|
this.pageLoadMs = ms;
|
|
56
61
|
if (this._remote) {
|
|
57
62
|
this.remote.pageLoadMs = ms;
|
|
@@ -59,13 +64,12 @@ function setPageLoadTimeout(ms) {
|
|
|
59
64
|
this.log.debug(`Set page load timeout to ${ms}ms`);
|
|
60
65
|
}
|
|
61
66
|
/**
|
|
62
|
-
*
|
|
67
|
+
* Sets the async script timeout.
|
|
68
|
+
*
|
|
69
|
+
* @param ms - Timeout in milliseconds
|
|
63
70
|
*/
|
|
64
71
|
function setAsyncScriptTimeout(ms) {
|
|
65
72
|
this.asyncWaitMs = ms;
|
|
66
73
|
this.log.debug(`Set async script timeout to ${ms}ms`);
|
|
67
74
|
}
|
|
68
|
-
/**
|
|
69
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
70
|
-
*/
|
|
71
75
|
//# sourceMappingURL=timeouts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeouts.js","sourceRoot":"","sources":["../../../lib/commands/timeouts.
|
|
1
|
+
{"version":3,"file":"timeouts.js","sourceRoot":"","sources":["../../../lib/commands/timeouts.ts"],"names":[],"mappings":";;AAOA,gDAKC;AAOD,wDAKC;AAOD,4CAMC;AAQD,oDAKC;AAQD,gDAKC;AAOD,gDAUC;AAOD,sDAMC;AA3FD;;;;GAIG;AACI,KAAK,UAAU,kBAAkB,CAEtC,EAAU;IAEV,MAAM,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,sBAAsB,CAE1C,EAAU;IAEV,MAAM,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,gBAAgB,CAEpC,EAAU;IAEV,2BAA2B;IAC3B,MAAM,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC;AAClE,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,oBAAoB,CAExC,EAAU;IAEV,MAAM,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;AACpC,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,kBAAkB,CAEtC,EAAU;IAEV,MAAM,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;AAClC,CAAC;AAED;;;;GAIG;AACH,SAAgB,kBAAkB,CAEhC,EAAU;IAEV,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAC9B,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;IACrB,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,IAAI,CAAC,MAAM,CAAC,UAAU,GAAG,EAAE,CAAC;IAC9B,CAAC;IACD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,4BAA4B,EAAE,IAAI,CAAC,CAAC;AACrD,CAAC;AAED;;;;GAIG;AACH,SAAgB,qBAAqB,CAEnC,EAAU;IAEV,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACtB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,+BAA+B,EAAE,IAAI,CAAC,CAAC;AACxD,CAAC"}
|
package/build/lib/driver.js
CHANGED
|
@@ -434,7 +434,7 @@ class XCUITestDriver extends driver_1.BaseDriver {
|
|
|
434
434
|
async executeCommand(cmd, ...args) {
|
|
435
435
|
this.log.debug(`Executing command '${cmd}'`);
|
|
436
436
|
if (cmd === 'receiveAsyncResponse') {
|
|
437
|
-
return await this.receiveAsyncResponse(
|
|
437
|
+
return await this.receiveAsyncResponse(args[0], args[1]);
|
|
438
438
|
}
|
|
439
439
|
// TODO: once this fix gets into base driver remove from here
|
|
440
440
|
if (cmd === 'getStatus') {
|