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/lib/commands/execute.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
|
|
3
|
-
const EXECUTE_SCRIPT_PREFIX = 'macos:';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
* @this {Mac2Driver}
|
|
8
|
-
* @param {string} script
|
|
9
|
-
* @param {any[]|import('@appium/types').StringRecord} [args]
|
|
10
|
-
* @returns {Promise<any>}
|
|
11
|
-
*/
|
|
12
|
-
export async function execute (script, args) {
|
|
13
|
-
this.log.info(`Executing extension command '${script}'`);
|
|
14
|
-
const formattedScript = String(script).trim().replace(/^macos:\s*/, `${EXECUTE_SCRIPT_PREFIX} `);
|
|
15
|
-
const preprocessedArgs = preprocessExecuteMethodArgs(args);
|
|
16
|
-
return await this.executeMethod(formattedScript, [preprocessedArgs]);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Massages the arguments going into an execute method.
|
|
21
|
-
*
|
|
22
|
-
* @param {ExecuteMethodArgs} [args]
|
|
23
|
-
* @returns {StringRecord}
|
|
24
|
-
*/
|
|
25
|
-
function preprocessExecuteMethodArgs(args) {
|
|
26
|
-
return /** @type {StringRecord} */ ((_.isArray(args) ? _.first(args) : args) ?? {});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @typedef {import('../driver').Mac2Driver} Mac2Driver
|
|
31
|
-
* @typedef {import('@appium/types').StringRecord} StringRecord
|
|
32
|
-
* @typedef {readonly any[] | readonly [StringRecord] | Readonly<StringRecord>} ExecuteMethodArgs
|
|
33
|
-
*/
|
package/lib/commands/find.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { util } from 'appium/support';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* This is needed to make lookup by image working
|
|
5
|
-
*
|
|
6
|
-
* @this {Mac2Driver}
|
|
7
|
-
* @param {string} strategy
|
|
8
|
-
* @param {string} selector
|
|
9
|
-
* @param {boolean} mult
|
|
10
|
-
* @param {string} [context]
|
|
11
|
-
* @returns {Promise<any>}
|
|
12
|
-
*/
|
|
13
|
-
export async function findElOrEls (strategy, selector, mult, context) {
|
|
14
|
-
const contextId = context ? util.unwrapElement(context) : context;
|
|
15
|
-
const endpoint = `/element${contextId ? `/${contextId}/element` : ''}${mult ? 's' : ''}`;
|
|
16
|
-
|
|
17
|
-
if (strategy === '-ios predicate string') {
|
|
18
|
-
strategy = 'predicate string';
|
|
19
|
-
} else if (strategy === '-ios class chain') {
|
|
20
|
-
strategy = 'class chain';
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return await this.wda.proxy.command(endpoint, 'POST', {
|
|
24
|
-
using: strategy,
|
|
25
|
-
value: selector,
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @typedef {import('../driver').Mac2Driver} Mac2Driver
|
|
31
|
-
*/
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Opens the given URL with the default or the given application.
|
|
3
|
-
* Xcode must be at version 14.3+.
|
|
4
|
-
*
|
|
5
|
-
* @this {Mac2Driver}
|
|
6
|
-
* @param {string} url The URL to be opened.
|
|
7
|
-
* @param {string} [bundleId] The bundle identifier of an application to open
|
|
8
|
-
* the given url with. If not provided then the default application
|
|
9
|
-
* for the given url scheme is going to be used.
|
|
10
|
-
* @returns {Promise<unknown>}
|
|
11
|
-
*/
|
|
12
|
-
export async function macosDeepLink (url, bundleId) {
|
|
13
|
-
return await this.wda.proxy.command('/url', 'POST', {url, bundleId});
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @typedef {import('../driver').Mac2Driver} Mac2Driver
|
|
18
|
-
*/
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Retrieves screenshots of each display available to macOS
|
|
3
|
-
*
|
|
4
|
-
* @this {Mac2Driver}
|
|
5
|
-
* @param {number} [displayId] macOS display identifier to take a screenshot for.
|
|
6
|
-
* If not provided then screenshots of all displays are going to be returned.
|
|
7
|
-
* If no matches were found then an error is thrown.
|
|
8
|
-
* @returns {Promise<import('../types').ScreenshotsInfo>}
|
|
9
|
-
*/
|
|
10
|
-
export async function macosScreenshots (displayId) {
|
|
11
|
-
return /** @type {import('../types').ScreenshotsInfo} */ (
|
|
12
|
-
await this.wda.proxy.command('/wda/screenshots', 'POST', {displayId})
|
|
13
|
-
);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @typedef {import('../driver').Mac2Driver} Mac2Driver
|
|
18
|
-
*/
|