appium-mac2-driver 3.2.3 → 3.2.4
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 +7 -0
- package/build/lib/commands/app-management.d.ts +18 -21
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js +14 -25
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/applescript.d.ts +8 -9
- package/build/lib/commands/applescript.d.ts.map +1 -1
- package/build/lib/commands/applescript.js +14 -13
- package/build/lib/commands/applescript.js.map +1 -1
- package/build/lib/commands/execute.d.ts +5 -8
- package/build/lib/commands/execute.d.ts.map +1 -1
- package/build/lib/commands/execute.js +5 -13
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/find.d.ts +6 -8
- package/build/lib/commands/find.d.ts.map +1 -1
- package/build/lib/commands/find.js +8 -13
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/gestures.d.ts +105 -118
- package/build/lib/commands/gestures.d.ts.map +1 -1
- package/build/lib/commands/gestures.js +141 -154
- package/build/lib/commands/gestures.js.map +1 -1
- package/build/lib/commands/navigation.d.ts +4 -6
- package/build/lib/commands/navigation.d.ts.map +1 -1
- package/build/lib/commands/navigation.js +2 -8
- package/build/lib/commands/navigation.js.map +1 -1
- package/build/lib/commands/record-screen.d.ts +57 -98
- package/build/lib/commands/record-screen.d.ts.map +1 -1
- package/build/lib/commands/record-screen.js +81 -84
- package/build/lib/commands/record-screen.js.map +1 -1
- package/build/lib/commands/screenshots.d.ts +5 -5
- package/build/lib/commands/screenshots.d.ts.map +1 -1
- package/build/lib/commands/screenshots.js +3 -8
- package/build/lib/commands/screenshots.js.map +1 -1
- package/build/lib/commands/source.d.ts +4 -5
- package/build/lib/commands/source.d.ts.map +1 -1
- package/build/lib/commands/source.js +3 -8
- package/build/lib/commands/source.js.map +1 -1
- package/lib/commands/app-management.ts +88 -0
- package/lib/commands/{applescript.js → applescript.ts} +28 -24
- package/lib/commands/execute.ts +32 -0
- package/lib/commands/find.ts +34 -0
- package/lib/commands/{gestures.js → gestures.ts} +333 -238
- package/lib/commands/navigation.ts +19 -0
- package/lib/commands/{record-screen.js → record-screen.ts} +165 -138
- package/lib/commands/screenshots.ts +18 -0
- package/lib/commands/{source.js → source.ts} +10 -11
- package/npm-shrinkwrap.json +5 -5
- package/package.json +1 -1
- package/lib/commands/app-management.js +0 -83
- package/lib/commands/execute.js +0 -33
- package/lib/commands/find.js +0 -31
- package/lib/commands/navigation.js +0 -18
- package/lib/commands/screenshots.js +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [3.2.4](https://github.com/appium/appium-mac2-driver/compare/v3.2.3...v3.2.4) (2025-11-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Miscellaneous Chores
|
|
5
|
+
|
|
6
|
+
* Migrate the rest of driver commands to typescript ([#353](https://github.com/appium/appium-mac2-driver/issues/353)) ([760ae72](https://github.com/appium/appium-mac2-driver/commit/760ae72b7c76d62c52c1a190f44854c70b2190a5))
|
|
7
|
+
|
|
1
8
|
## [3.2.3](https://github.com/appium/appium-mac2-driver/compare/v3.2.2...v3.2.3) (2025-11-15)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -1,56 +1,53 @@
|
|
|
1
|
+
import type { Mac2Driver } from '../driver';
|
|
2
|
+
import type { StringRecord } from '@appium/types';
|
|
1
3
|
/**
|
|
2
4
|
* Start an app with given bundle identifier or activates it
|
|
3
5
|
* if the app is already running. An exception is thrown if the
|
|
4
6
|
* app with the given identifier cannot be found.
|
|
5
7
|
*
|
|
6
|
-
* @
|
|
7
|
-
* @param {string} [bundleId] Bundle identifier of the app to be launched or activated.
|
|
8
|
+
* @param bundleId - Bundle identifier of the app to be launched or activated.
|
|
8
9
|
* Either this property or `path` must be provided
|
|
9
|
-
* @param
|
|
10
|
+
* @param path - Full path to the app bundle. Either this property or
|
|
10
11
|
* `bundleId` must be provided
|
|
11
|
-
* @param
|
|
12
|
+
* @param args - The list of command line arguments for the app to be launched with.
|
|
12
13
|
* This parameter is ignored if the app is already running.
|
|
13
|
-
* @param
|
|
14
|
+
* @param environment - Environment variables mapping.
|
|
14
15
|
* Custom variables are added to the default process environment.
|
|
15
16
|
*/
|
|
16
|
-
export function macosLaunchApp(this:
|
|
17
|
+
export declare function macosLaunchApp(this: Mac2Driver, bundleId?: string, path?: string, args?: string[], environment?: StringRecord): Promise<unknown>;
|
|
17
18
|
/**
|
|
18
19
|
* Activate an app with given bundle identifier. An exception is thrown if the
|
|
19
20
|
* app cannot be found or is not running.
|
|
20
21
|
*
|
|
21
|
-
* @
|
|
22
|
-
* @param {string} [bundleId] Bundle identifier of the app to be activated.
|
|
22
|
+
* @param bundleId - Bundle identifier of the app to be activated.
|
|
23
23
|
* Either this property or `path` must be provided
|
|
24
|
-
* @param
|
|
24
|
+
* @param path - Full path to the app bundle. Either this property
|
|
25
25
|
* or `bundleId` must be provided
|
|
26
26
|
*/
|
|
27
|
-
export function macosActivateApp(this:
|
|
27
|
+
export declare function macosActivateApp(this: Mac2Driver, bundleId?: string, path?: string): Promise<unknown>;
|
|
28
28
|
/**
|
|
29
29
|
* Terminate an app with given bundle identifier. An exception is thrown if the
|
|
30
30
|
* app cannot be found.
|
|
31
31
|
*
|
|
32
|
-
* @
|
|
33
|
-
* @param {string} [bundleId] Bundle identifier of the app to be terminated.
|
|
32
|
+
* @param bundleId - Bundle identifier of the app to be terminated.
|
|
34
33
|
* Either this property or `path` must be provided
|
|
35
|
-
* @param
|
|
34
|
+
* @param path - Full path to the app bundle. Either this property
|
|
36
35
|
* or `bundleId` must be provided
|
|
37
|
-
* @returns
|
|
36
|
+
* @returns `true` if the app was running and has been successfully terminated.
|
|
38
37
|
* `false` if the app was not running before.
|
|
39
38
|
*/
|
|
40
|
-
export function macosTerminateApp(this:
|
|
39
|
+
export declare function macosTerminateApp(this: Mac2Driver, bundleId?: string, path?: string): Promise<boolean>;
|
|
41
40
|
/**
|
|
42
41
|
* Query an app state with given bundle identifier. An exception is thrown if the
|
|
43
42
|
* app cannot be found.
|
|
44
43
|
*
|
|
45
|
-
* @
|
|
46
|
-
* @param {string} [bundleId] Bundle identifier of the app whose state should be queried.
|
|
44
|
+
* @param bundleId - Bundle identifier of the app whose state should be queried.
|
|
47
45
|
* Either this property or `path` must be provided
|
|
48
|
-
* @param
|
|
46
|
+
* @param path - Full path to the app bundle. Either this property
|
|
49
47
|
* or `bundleId` must be provided
|
|
50
|
-
* @returns
|
|
48
|
+
* @returns The application state code. See
|
|
51
49
|
* https://developer.apple.com/documentation/xctest/xcuiapplicationstate?language=objc
|
|
52
50
|
* for more details
|
|
53
51
|
*/
|
|
54
|
-
export function macosQueryAppState(this:
|
|
55
|
-
export type Mac2Driver = import("../driver").Mac2Driver;
|
|
52
|
+
export declare function macosQueryAppState(this: Mac2Driver, bundleId?: string, path?: string): Promise<number>;
|
|
56
53
|
//# sourceMappingURL=app-management.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-management.d.ts","sourceRoot":"","sources":["../../../lib/commands/app-management.
|
|
1
|
+
{"version":3,"file":"app-management.d.ts","sourceRoot":"","sources":["../../../lib/commands/app-management.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,UAAU,EAChB,QAAQ,CAAC,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,MAAM,EAAE,EACf,WAAW,CAAC,EAAE,YAAY,GACzB,OAAO,CAAC,OAAO,CAAC,CAOlB;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,UAAU,EAChB,QAAQ,CAAC,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,OAAO,CAAC,CAElB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,UAAU,EAChB,QAAQ,CAAC,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,OAAO,CAAC,CAElB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,UAAU,EAChB,QAAQ,CAAC,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,CAAC,CAEjB"}
|
|
@@ -9,14 +9,13 @@ exports.macosQueryAppState = macosQueryAppState;
|
|
|
9
9
|
* if the app is already running. An exception is thrown if the
|
|
10
10
|
* app with the given identifier cannot be found.
|
|
11
11
|
*
|
|
12
|
-
* @
|
|
13
|
-
* @param {string} [bundleId] Bundle identifier of the app to be launched or activated.
|
|
12
|
+
* @param bundleId - Bundle identifier of the app to be launched or activated.
|
|
14
13
|
* Either this property or `path` must be provided
|
|
15
|
-
* @param
|
|
14
|
+
* @param path - Full path to the app bundle. Either this property or
|
|
16
15
|
* `bundleId` must be provided
|
|
17
|
-
* @param
|
|
16
|
+
* @param args - The list of command line arguments for the app to be launched with.
|
|
18
17
|
* This parameter is ignored if the app is already running.
|
|
19
|
-
* @param
|
|
18
|
+
* @param environment - Environment variables mapping.
|
|
20
19
|
* Custom variables are added to the default process environment.
|
|
21
20
|
*/
|
|
22
21
|
async function macosLaunchApp(bundleId, path, args, environment) {
|
|
@@ -27,55 +26,45 @@ async function macosLaunchApp(bundleId, path, args, environment) {
|
|
|
27
26
|
path,
|
|
28
27
|
});
|
|
29
28
|
}
|
|
30
|
-
;
|
|
31
29
|
/**
|
|
32
30
|
* Activate an app with given bundle identifier. An exception is thrown if the
|
|
33
31
|
* app cannot be found or is not running.
|
|
34
32
|
*
|
|
35
|
-
* @
|
|
36
|
-
* @param {string} [bundleId] Bundle identifier of the app to be activated.
|
|
33
|
+
* @param bundleId - Bundle identifier of the app to be activated.
|
|
37
34
|
* Either this property or `path` must be provided
|
|
38
|
-
* @param
|
|
35
|
+
* @param path - Full path to the app bundle. Either this property
|
|
39
36
|
* or `bundleId` must be provided
|
|
40
37
|
*/
|
|
41
38
|
async function macosActivateApp(bundleId, path) {
|
|
42
39
|
return await this.wda.proxy.command('/wda/apps/activate', 'POST', { bundleId, path });
|
|
43
40
|
}
|
|
44
|
-
;
|
|
45
41
|
/**
|
|
46
42
|
* Terminate an app with given bundle identifier. An exception is thrown if the
|
|
47
43
|
* app cannot be found.
|
|
48
44
|
*
|
|
49
|
-
* @
|
|
50
|
-
* @param {string} [bundleId] Bundle identifier of the app to be terminated.
|
|
45
|
+
* @param bundleId - Bundle identifier of the app to be terminated.
|
|
51
46
|
* Either this property or `path` must be provided
|
|
52
|
-
* @param
|
|
47
|
+
* @param path - Full path to the app bundle. Either this property
|
|
53
48
|
* or `bundleId` must be provided
|
|
54
|
-
* @returns
|
|
49
|
+
* @returns `true` if the app was running and has been successfully terminated.
|
|
55
50
|
* `false` if the app was not running before.
|
|
56
51
|
*/
|
|
57
52
|
async function macosTerminateApp(bundleId, path) {
|
|
58
|
-
return
|
|
53
|
+
return (await this.wda.proxy.command('/wda/apps/terminate', 'POST', { bundleId, path }));
|
|
59
54
|
}
|
|
60
|
-
;
|
|
61
55
|
/**
|
|
62
56
|
* Query an app state with given bundle identifier. An exception is thrown if the
|
|
63
57
|
* app cannot be found.
|
|
64
58
|
*
|
|
65
|
-
* @
|
|
66
|
-
* @param {string} [bundleId] Bundle identifier of the app whose state should be queried.
|
|
59
|
+
* @param bundleId - Bundle identifier of the app whose state should be queried.
|
|
67
60
|
* Either this property or `path` must be provided
|
|
68
|
-
* @param
|
|
61
|
+
* @param path - Full path to the app bundle. Either this property
|
|
69
62
|
* or `bundleId` must be provided
|
|
70
|
-
* @returns
|
|
63
|
+
* @returns The application state code. See
|
|
71
64
|
* https://developer.apple.com/documentation/xctest/xcuiapplicationstate?language=objc
|
|
72
65
|
* for more details
|
|
73
66
|
*/
|
|
74
67
|
async function macosQueryAppState(bundleId, path) {
|
|
75
|
-
return
|
|
68
|
+
return (await this.wda.proxy.command('/wda/apps/state', 'POST', { bundleId, path }));
|
|
76
69
|
}
|
|
77
|
-
;
|
|
78
|
-
/**
|
|
79
|
-
* @typedef {import('../driver').Mac2Driver} Mac2Driver
|
|
80
|
-
*/
|
|
81
70
|
//# sourceMappingURL=app-management.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-management.js","sourceRoot":"","sources":["../../../lib/commands/app-management.
|
|
1
|
+
{"version":3,"file":"app-management.js","sourceRoot":"","sources":["../../../lib/commands/app-management.ts"],"names":[],"mappings":";;AAiBA,wCAaC;AAWD,4CAMC;AAaD,8CAMC;AAcD,gDAMC;AAnFD;;;;;;;;;;;;;GAaG;AACI,KAAK,UAAU,cAAc,CAElC,QAAiB,EACjB,IAAa,EACb,IAAe,EACf,WAA0B;IAE1B,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB,EAAE,MAAM,EAAE;QAC9D,SAAS,EAAE,IAAI;QACf,WAAW;QACX,QAAQ;QACR,IAAI;KACL,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,gBAAgB,CAEpC,QAAiB,EACjB,IAAa;IAEb,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,oBAAoB,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AACxF,CAAC;AAED;;;;;;;;;;GAUG;AACI,KAAK,UAAU,iBAAiB,CAErC,QAAiB,EACjB,IAAa;IAEb,OAAO,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAY,CAAC;AACtG,CAAC;AAED;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,kBAAkB,CAEtC,QAAiB,EACjB,IAAa;IAEb,OAAO,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAW,CAAC;AACjG,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Mac2Driver } from '../driver';
|
|
1
2
|
/**
|
|
2
3
|
* Executes the given AppleScript command or a whole script based on the
|
|
3
4
|
* given options. Either of these options must be provided. If both are provided
|
|
@@ -9,20 +10,18 @@
|
|
|
9
10
|
* and no permissions to do it are given to the parent (for example, Appium or Terminal)
|
|
10
11
|
* process in System Preferences -> Privacy list.
|
|
11
12
|
*
|
|
12
|
-
* @
|
|
13
|
-
* @param
|
|
14
|
-
* @param {string} [language] Overrides the scripting language. Basically, sets
|
|
13
|
+
* @param script - A valid AppleScript to execute
|
|
14
|
+
* @param language - Overrides the scripting language. Basically, sets
|
|
15
15
|
* the value of `-l` command line argument of `osascript` tool.
|
|
16
16
|
* If unset the AppleScript language is assumed.
|
|
17
|
-
* @param
|
|
18
|
-
* @param
|
|
17
|
+
* @param command - A valid AppleScript as a single command (no line breaks) to execute
|
|
18
|
+
* @param cwd - The path to an existing folder, which is going to be set as
|
|
19
19
|
* the working directory for the command/script being executed.
|
|
20
|
-
* @param
|
|
20
|
+
* @param timeout - The number of seconds to wait until a long-running command is finished.
|
|
21
21
|
* An error is thrown if the command is still running after this timeout expires.
|
|
22
|
-
* @returns
|
|
22
|
+
* @returns The actual stdout of the given command/script
|
|
23
23
|
* @throws {Error} If the exit code of the given command/script is not zero.
|
|
24
24
|
* The actual stderr output is set to the error message value.
|
|
25
25
|
*/
|
|
26
|
-
export function macosExecAppleScript(this:
|
|
27
|
-
export type Mac2Driver = import("../driver").Mac2Driver;
|
|
26
|
+
export declare function macosExecAppleScript(this: Mac2Driver, script?: string, language?: string, command?: string, cwd?: string, timeout?: number): Promise<string>;
|
|
28
27
|
//# sourceMappingURL=applescript.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applescript.d.ts","sourceRoot":"","sources":["../../../lib/commands/applescript.
|
|
1
|
+
{"version":3,"file":"applescript.d.ts","sourceRoot":"","sources":["../../../lib/commands/applescript.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAK5C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,UAAU,EAChB,MAAM,CAAC,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CA4CjB"}
|
|
@@ -20,17 +20,16 @@ const APPLE_SCRIPT_FEATURE = 'apple_script';
|
|
|
20
20
|
* and no permissions to do it are given to the parent (for example, Appium or Terminal)
|
|
21
21
|
* process in System Preferences -> Privacy list.
|
|
22
22
|
*
|
|
23
|
-
* @
|
|
24
|
-
* @param
|
|
25
|
-
* @param {string} [language] Overrides the scripting language. Basically, sets
|
|
23
|
+
* @param script - A valid AppleScript to execute
|
|
24
|
+
* @param language - Overrides the scripting language. Basically, sets
|
|
26
25
|
* the value of `-l` command line argument of `osascript` tool.
|
|
27
26
|
* If unset the AppleScript language is assumed.
|
|
28
|
-
* @param
|
|
29
|
-
* @param
|
|
27
|
+
* @param command - A valid AppleScript as a single command (no line breaks) to execute
|
|
28
|
+
* @param cwd - The path to an existing folder, which is going to be set as
|
|
30
29
|
* the working directory for the command/script being executed.
|
|
31
|
-
* @param
|
|
30
|
+
* @param timeout - The number of seconds to wait until a long-running command is finished.
|
|
32
31
|
* An error is thrown if the command is still running after this timeout expires.
|
|
33
|
-
* @returns
|
|
32
|
+
* @returns The actual stdout of the given command/script
|
|
34
33
|
* @throws {Error} If the exit code of the given command/script is not zero.
|
|
35
34
|
* The actual stderr output is set to the error message value.
|
|
36
35
|
*/
|
|
@@ -39,7 +38,7 @@ async function macosExecAppleScript(script, language, command, cwd, timeout) {
|
|
|
39
38
|
if (!script && !command) {
|
|
40
39
|
throw this.log.errorWithException('AppleScript script/command must not be empty');
|
|
41
40
|
}
|
|
42
|
-
if (/\n/.test(
|
|
41
|
+
if (command && /\n/.test(command)) {
|
|
43
42
|
throw this.log.errorWithException('AppleScript commands cannot contain line breaks');
|
|
44
43
|
}
|
|
45
44
|
// 'command' has priority over 'script'
|
|
@@ -51,12 +50,18 @@ async function macosExecAppleScript(script, language, command, cwd, timeout) {
|
|
|
51
50
|
let tmpRoot;
|
|
52
51
|
try {
|
|
53
52
|
if (shouldRunScript) {
|
|
53
|
+
if (!script) {
|
|
54
|
+
throw this.log.errorWithException('AppleScript script must be provided');
|
|
55
|
+
}
|
|
54
56
|
tmpRoot = await support_1.tempDir.openDir();
|
|
55
57
|
const tmpScriptPath = path_1.default.resolve(tmpRoot, 'appium_script.scpt');
|
|
56
|
-
await support_1.fs.writeFile(tmpScriptPath,
|
|
58
|
+
await support_1.fs.writeFile(tmpScriptPath, script, 'utf8');
|
|
57
59
|
args.push(tmpScriptPath);
|
|
58
60
|
}
|
|
59
61
|
else {
|
|
62
|
+
if (!command) {
|
|
63
|
+
throw this.log.errorWithException('AppleScript command must be provided');
|
|
64
|
+
}
|
|
60
65
|
args.push('-e', command);
|
|
61
66
|
}
|
|
62
67
|
this.log.info(`Running ${OSASCRIPT} with arguments: ${support_1.util.quote(args)}`);
|
|
@@ -74,8 +79,4 @@ async function macosExecAppleScript(script, language, command, cwd, timeout) {
|
|
|
74
79
|
}
|
|
75
80
|
}
|
|
76
81
|
}
|
|
77
|
-
;
|
|
78
|
-
/**
|
|
79
|
-
* @typedef {import('../driver').Mac2Driver} Mac2Driver
|
|
80
|
-
*/
|
|
81
82
|
//# sourceMappingURL=applescript.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applescript.js","sourceRoot":"","sources":["../../../lib/commands/applescript.
|
|
1
|
+
{"version":3,"file":"applescript.js","sourceRoot":"","sources":["../../../lib/commands/applescript.ts"],"names":[],"mappings":";;;;;AAgCA,oDAmDC;AAnFD,4CAAmD;AACnD,+CAAoC;AACpC,gDAAwB;AAGxB,MAAM,SAAS,GAAG,WAAW,CAAC;AAC9B,MAAM,oBAAoB,GAAG,cAAc,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACI,KAAK,UAAU,oBAAoB,CAExC,MAAe,EACf,QAAiB,EACjB,OAAgB,EAChB,GAAY,EACZ,OAAgB;IAEhB,IAAI,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,CAAC;IAEhD,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACxB,MAAM,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,8CAA8C,CAAC,CAAC;IACpF,CAAC;IACD,IAAI,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,iDAAiD,CAAC,CAAC;IACvF,CAAC;IACD,uCAAuC;IACvC,MAAM,eAAe,GAAG,CAAC,OAAO,CAAC;IAEjC,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,QAAQ,EAAE,CAAC;QACb,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC5B,CAAC;IACD,IAAI,OAA2B,CAAC;IAChC,IAAI,CAAC;QACH,IAAI,eAAe,EAAE,CAAC;YACpB,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,MAAM,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,qCAAqC,CAAC,CAAC;YAC3E,CAAC;YACD,OAAO,GAAG,MAAM,iBAAO,CAAC,OAAO,EAAE,CAAC;YAClC,MAAM,aAAa,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;YAClE,MAAM,YAAE,CAAC,SAAS,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;YAClD,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC3B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,sCAAsC,CAAC,CAAC;YAC5E,CAAC;YACD,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC3B,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,SAAS,oBAAoB,cAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1E,IAAI,CAAC;YACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAA,mBAAI,EAAC,SAAS,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;YACjE,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;YAAS,CAAC;QACT,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,YAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
+
import type { Mac2Driver } from '../driver';
|
|
2
|
+
import type { StringRecord } from '@appium/types';
|
|
1
3
|
/**
|
|
2
4
|
*
|
|
3
|
-
* @
|
|
4
|
-
* @param
|
|
5
|
-
* @param {any[]|import('@appium/types').StringRecord} [args]
|
|
6
|
-
* @returns {Promise<any>}
|
|
5
|
+
* @param script - The script to execute
|
|
6
|
+
* @param args - Arguments to pass to the script
|
|
7
7
|
*/
|
|
8
|
-
export function execute(this:
|
|
9
|
-
export type Mac2Driver = import("../driver").Mac2Driver;
|
|
10
|
-
export type StringRecord = import("@appium/types").StringRecord;
|
|
11
|
-
export type ExecuteMethodArgs = readonly any[] | readonly [StringRecord] | Readonly<StringRecord>;
|
|
8
|
+
export declare function execute(this: Mac2Driver, script: string, args?: readonly any[] | StringRecord): Promise<any>;
|
|
12
9
|
//# sourceMappingURL=execute.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../lib/commands/execute.
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../lib/commands/execute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAIlD;;;;GAIG;AACH,wBAAsB,OAAO,CAC3B,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,SAAS,GAAG,EAAE,GAAG,YAAY,GACnC,OAAO,CAAC,GAAG,CAAC,CAKd"}
|
|
@@ -8,10 +8,8 @@ const lodash_1 = __importDefault(require("lodash"));
|
|
|
8
8
|
const EXECUTE_SCRIPT_PREFIX = 'macos:';
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
11
|
-
* @
|
|
12
|
-
* @param
|
|
13
|
-
* @param {any[]|import('@appium/types').StringRecord} [args]
|
|
14
|
-
* @returns {Promise<any>}
|
|
11
|
+
* @param script - The script to execute
|
|
12
|
+
* @param args - Arguments to pass to the script
|
|
15
13
|
*/
|
|
16
14
|
async function execute(script, args) {
|
|
17
15
|
this.log.info(`Executing extension command '${script}'`);
|
|
@@ -19,19 +17,13 @@ async function execute(script, args) {
|
|
|
19
17
|
const preprocessedArgs = preprocessExecuteMethodArgs(args);
|
|
20
18
|
return await this.executeMethod(formattedScript, [preprocessedArgs]);
|
|
21
19
|
}
|
|
22
|
-
;
|
|
23
20
|
/**
|
|
24
21
|
* Massages the arguments going into an execute method.
|
|
25
22
|
*
|
|
26
|
-
* @param
|
|
27
|
-
* @returns
|
|
23
|
+
* @param args - Arguments to preprocess
|
|
24
|
+
* @returns Preprocessed arguments as StringRecord
|
|
28
25
|
*/
|
|
29
26
|
function preprocessExecuteMethodArgs(args) {
|
|
30
|
-
return
|
|
27
|
+
return (lodash_1.default.isArray(args) ? lodash_1.default.first(args) : args) ?? {};
|
|
31
28
|
}
|
|
32
|
-
/**
|
|
33
|
-
* @typedef {import('../driver').Mac2Driver} Mac2Driver
|
|
34
|
-
* @typedef {import('@appium/types').StringRecord} StringRecord
|
|
35
|
-
* @typedef {readonly any[] | readonly [StringRecord] | Readonly<StringRecord>} ExecuteMethodArgs
|
|
36
|
-
*/
|
|
37
29
|
//# sourceMappingURL=execute.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../lib/commands/execute.
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../lib/commands/execute.ts"],"names":[],"mappings":";;;;;AAWA,0BASC;AApBD,oDAAuB;AAIvB,MAAM,qBAAqB,GAAG,QAAQ,CAAC;AAEvC;;;;GAIG;AACI,KAAK,UAAU,OAAO,CAE3B,MAAc,EACd,IAAoC;IAEpC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,gCAAgC,MAAM,GAAG,CAAC,CAAC;IACzD,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,GAAG,qBAAqB,GAAG,CAAC,CAAC;IACjG,MAAM,gBAAgB,GAAG,2BAA2B,CAAC,IAAI,CAAC,CAAC;IAC3D,OAAO,MAAM,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;AACvE,CAAC;AAED;;;;;GAKG;AACH,SAAS,2BAA2B,CAAC,IAAoC;IACvE,OAAO,CAAC,gBAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,gBAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;AACxD,CAAC"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
+
import type { Mac2Driver } from '../driver';
|
|
1
2
|
/**
|
|
2
3
|
* This is needed to make lookup by image working
|
|
3
4
|
*
|
|
4
|
-
* @
|
|
5
|
-
* @param
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
-
* @param {string} [context]
|
|
9
|
-
* @returns {Promise<any>}
|
|
5
|
+
* @param strategy - The locator strategy to use
|
|
6
|
+
* @param selector - The selector value
|
|
7
|
+
* @param mult - Whether to find multiple elements
|
|
8
|
+
* @param context - Optional context element ID
|
|
10
9
|
*/
|
|
11
|
-
export function findElOrEls(this:
|
|
12
|
-
export type Mac2Driver = import("../driver").Mac2Driver;
|
|
10
|
+
export declare function findElOrEls(this: Mac2Driver, strategy: string, selector: string, mult: boolean, context?: string): Promise<any>;
|
|
13
11
|
//# sourceMappingURL=find.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../lib/commands/find.
|
|
1
|
+
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../lib/commands/find.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,OAAO,EACb,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,GAAG,CAAC,CAed"}
|
|
@@ -5,29 +5,24 @@ const support_1 = require("appium/support");
|
|
|
5
5
|
/**
|
|
6
6
|
* This is needed to make lookup by image working
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
12
|
-
* @param {string} [context]
|
|
13
|
-
* @returns {Promise<any>}
|
|
8
|
+
* @param strategy - The locator strategy to use
|
|
9
|
+
* @param selector - The selector value
|
|
10
|
+
* @param mult - Whether to find multiple elements
|
|
11
|
+
* @param context - Optional context element ID
|
|
14
12
|
*/
|
|
15
13
|
async function findElOrEls(strategy, selector, mult, context) {
|
|
16
14
|
const contextId = context ? support_1.util.unwrapElement(context) : context;
|
|
17
15
|
const endpoint = `/element${contextId ? `/${contextId}/element` : ''}${mult ? 's' : ''}`;
|
|
16
|
+
let normalizedStrategy = strategy;
|
|
18
17
|
if (strategy === '-ios predicate string') {
|
|
19
|
-
|
|
18
|
+
normalizedStrategy = 'predicate string';
|
|
20
19
|
}
|
|
21
20
|
else if (strategy === '-ios class chain') {
|
|
22
|
-
|
|
21
|
+
normalizedStrategy = 'class chain';
|
|
23
22
|
}
|
|
24
23
|
return await this.wda.proxy.command(endpoint, 'POST', {
|
|
25
|
-
using:
|
|
24
|
+
using: normalizedStrategy,
|
|
26
25
|
value: selector,
|
|
27
26
|
});
|
|
28
27
|
}
|
|
29
|
-
;
|
|
30
|
-
/**
|
|
31
|
-
* @typedef {import('../driver').Mac2Driver} Mac2Driver
|
|
32
|
-
*/
|
|
33
28
|
//# sourceMappingURL=find.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../lib/commands/find.
|
|
1
|
+
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../lib/commands/find.ts"],"names":[],"mappings":";;AAWA,kCAqBC;AAhCD,4CAAsC;AAGtC;;;;;;;GAOG;AACI,KAAK,UAAU,WAAW,CAE/B,QAAgB,EAChB,QAAgB,EAChB,IAAa,EACb,OAAgB;IAEhB,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,cAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAClE,MAAM,QAAQ,GAAG,WAAW,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAEzF,IAAI,kBAAkB,GAAG,QAAQ,CAAC;IAClC,IAAI,QAAQ,KAAK,uBAAuB,EAAE,CAAC;QACzC,kBAAkB,GAAG,kBAAkB,CAAC;IAC1C,CAAC;SAAM,IAAI,QAAQ,KAAK,kBAAkB,EAAE,CAAC;QAC3C,kBAAkB,GAAG,aAAa,CAAC;IACrC,CAAC;IAED,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE;QACpD,KAAK,EAAE,kBAAkB;QACzB,KAAK,EAAE,QAAQ;KAChB,CAAC,CAAC;AACL,CAAC"}
|