appium-espresso-driver 2.33.1 → 2.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/build/lib/commands/app-management.d.ts +65 -0
- package/build/lib/commands/app-management.d.ts.map +1 -0
- package/build/lib/commands/app-management.js +100 -0
- package/build/lib/commands/app-management.js.map +1 -0
- package/build/lib/commands/context.d.ts +30 -0
- package/build/lib/commands/context.d.ts.map +1 -0
- package/build/lib/commands/context.js +38 -0
- package/build/lib/commands/context.js.map +1 -0
- package/build/lib/commands/element.d.ts +58 -0
- package/build/lib/commands/element.d.ts.map +1 -0
- package/build/lib/commands/element.js +159 -0
- package/build/lib/commands/element.js.map +1 -0
- package/build/lib/commands/execute.d.ts +7 -10
- package/build/lib/commands/execute.d.ts.map +1 -1
- package/build/lib/commands/execute.js +4 -4
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/idling-resources.d.ts +42 -45
- package/build/lib/commands/idling-resources.d.ts.map +1 -1
- package/build/lib/commands/idling-resources.js +13 -12
- package/build/lib/commands/idling-resources.js.map +1 -1
- package/build/lib/commands/misc.d.ts +144 -0
- package/build/lib/commands/misc.d.ts.map +1 -0
- package/build/lib/commands/misc.js +181 -0
- package/build/lib/commands/misc.js.map +1 -0
- package/build/lib/commands/screenshot.d.ts +25 -28
- package/build/lib/commands/screenshot.d.ts.map +1 -1
- package/build/lib/commands/screenshot.js +4 -4
- package/build/lib/commands/screenshot.js.map +1 -1
- package/build/lib/commands/services.d.ts +34 -37
- package/build/lib/commands/services.d.ts.map +1 -1
- package/build/lib/commands/services.js +7 -8
- package/build/lib/commands/services.js.map +1 -1
- package/build/lib/driver.d.ts +65 -641
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +103 -97
- package/build/lib/driver.js.map +1 -1
- package/build/lib/method-map.d.ts +0 -23
- package/build/lib/method-map.d.ts.map +1 -1
- package/build/lib/utils.d.ts +7 -1
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +20 -9
- package/build/lib/utils.js.map +1 -1
- package/espresso-server/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk +0 -0
- package/lib/commands/app-management.js +109 -0
- package/lib/commands/context.js +34 -0
- package/lib/commands/element.js +203 -0
- package/lib/commands/execute.js +2 -6
- package/lib/commands/idling-resources.js +8 -13
- package/lib/commands/misc.js +181 -0
- package/lib/commands/screenshot.js +2 -6
- package/lib/commands/services.js +4 -11
- package/lib/{driver.js → driver.ts} +128 -125
- package/lib/utils.js +23 -17
- package/npm-shrinkwrap.json +38 -37
- package/package.json +3 -3
- package/build/lib/commands/general.d.ts +0 -282
- package/build/lib/commands/general.d.ts.map +0 -1
- package/build/lib/commands/general.js +0 -433
- package/build/lib/commands/general.js.map +0 -1
- package/lib/commands/general.js +0 -522
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [2.34.0](https://github.com/appium/appium-espresso-driver/compare/v2.33.2...v2.34.0) (2024-01-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Bump appium-android-driver ([#973](https://github.com/appium/appium-espresso-driver/issues/973)) ([21a88cb](https://github.com/appium/appium-espresso-driver/commit/21a88cb2916beb72d023cbcfd227698982718f56))
|
|
7
|
+
|
|
8
|
+
## [2.33.2](https://github.com/appium/appium-espresso-driver/compare/v2.33.1...v2.33.2) (2024-01-16)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Miscellaneous Chores
|
|
12
|
+
|
|
13
|
+
* **deps-dev:** bump semantic-release from 22.0.12 to 23.0.0 ([#968](https://github.com/appium/appium-espresso-driver/issues/968)) ([40d0590](https://github.com/appium/appium-espresso-driver/commit/40d0590e4029b813152997d84ee98d4cb373573d))
|
|
14
|
+
|
|
1
15
|
## [2.33.1](https://github.com/appium/appium-espresso-driver/compare/v2.33.0...v2.33.1) (2024-01-14)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @this {import('../driver').EspressoDriver}
|
|
3
|
+
*/
|
|
4
|
+
export function launchApp(this: import("../driver").EspressoDriver): Promise<void>;
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {Object} BackgroundAppOptions
|
|
7
|
+
* @property {number} [seconds] The amount of seconds to wait between putting the app to background and restoring it.
|
|
8
|
+
* Any negative value means to not restore the app after putting it to the background (the default behavior).
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Puts the app under test to the background
|
|
12
|
+
* and then restores it (if needed). The call is blocking is the
|
|
13
|
+
* app needs to be restored afterwards.
|
|
14
|
+
*
|
|
15
|
+
* @this {import('../driver').EspressoDriver}
|
|
16
|
+
* @param {BackgroundAppOptions} [opts={}]
|
|
17
|
+
*/
|
|
18
|
+
export function mobileBackgroundApp(this: import("../driver").EspressoDriver, opts?: BackgroundAppOptions | undefined): Promise<string | true>;
|
|
19
|
+
/**
|
|
20
|
+
* @this {import('../driver').EspressoDriver}
|
|
21
|
+
*/
|
|
22
|
+
export function closeApp(this: import("../driver").EspressoDriver): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* @this {import('../driver').EspressoDriver}
|
|
25
|
+
*/
|
|
26
|
+
export function reset(this: import("../driver").EspressoDriver): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* @typedef {Object} StartActivityOptions
|
|
29
|
+
* @property {string} appActivity
|
|
30
|
+
* @property {string} [locale]
|
|
31
|
+
* @property {string} [optionalIntentArguments]
|
|
32
|
+
* @property {string} [optionalActivityArguments]
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* Starts the given activity with intent options, activity options and locale.
|
|
36
|
+
* Activity could only be executed in scope of the current app package.
|
|
37
|
+
*
|
|
38
|
+
* @this {import('../driver').EspressoDriver}
|
|
39
|
+
* @param {StartActivityOptions} opts
|
|
40
|
+
* @returns {Promise<string>}
|
|
41
|
+
*/
|
|
42
|
+
export function mobileStartActivity(this: import("../driver").EspressoDriver, opts: StartActivityOptions): Promise<string>;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @this {import('../driver').EspressoDriver}
|
|
46
|
+
* @param {string} appPackage
|
|
47
|
+
* @param {string} appActivity
|
|
48
|
+
* @param {string} appWaitPackage
|
|
49
|
+
* @param {string} appWaitActivity
|
|
50
|
+
*/
|
|
51
|
+
export function startActivity(this: import("../driver").EspressoDriver, appPackage: string, appActivity: string, appWaitPackage: string, appWaitActivity: string): Promise<void>;
|
|
52
|
+
export type BackgroundAppOptions = {
|
|
53
|
+
/**
|
|
54
|
+
* The amount of seconds to wait between putting the app to background and restoring it.
|
|
55
|
+
* Any negative value means to not restore the app after putting it to the background (the default behavior).
|
|
56
|
+
*/
|
|
57
|
+
seconds?: number | undefined;
|
|
58
|
+
};
|
|
59
|
+
export type StartActivityOptions = {
|
|
60
|
+
appActivity: string;
|
|
61
|
+
locale?: string | undefined;
|
|
62
|
+
optionalIntentArguments?: string | undefined;
|
|
63
|
+
optionalActivityArguments?: string | undefined;
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=app-management.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-management.d.ts","sourceRoot":"","sources":["../../../lib/commands/app-management.js"],"names":[],"mappings":"AAGA;;GAEG;AAEH,mFAIC;AAED;;;;GAIG;AAEH;;;;;;;GAOG;AACH,+IAGC;AAED;;GAEG;AAEH,kFAIC;AAED;;GAEG;AAEH,+EAIC;AAED;;;;;;GAMG;AAEH;;;;;;;GAOG;AACH,oFAHW,oBAAoB,GAClB,QAAQ,MAAM,CAAC,CAiB3B;AAED;;;;;;;GAOG;AACH,oFALW,MAAM,eACN,MAAM,kBACN,MAAM,mBACN,MAAM,iBAiBhB;;;;;;;;;iBAtDa,MAAM"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.startActivity = exports.mobileStartActivity = exports.reset = exports.closeApp = exports.mobileBackgroundApp = exports.launchApp = void 0;
|
|
4
|
+
const driver_1 = require("appium/driver");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
/**
|
|
7
|
+
* @this {import('../driver').EspressoDriver}
|
|
8
|
+
*/
|
|
9
|
+
// eslint-disable-next-line require-await
|
|
10
|
+
async function launchApp() {
|
|
11
|
+
throw new driver_1.errors.UnsupportedOperationError('Please create a new session in order to launch the application under test');
|
|
12
|
+
}
|
|
13
|
+
exports.launchApp = launchApp;
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {Object} BackgroundAppOptions
|
|
16
|
+
* @property {number} [seconds] The amount of seconds to wait between putting the app to background and restoring it.
|
|
17
|
+
* Any negative value means to not restore the app after putting it to the background (the default behavior).
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Puts the app under test to the background
|
|
21
|
+
* and then restores it (if needed). The call is blocking is the
|
|
22
|
+
* app needs to be restored afterwards.
|
|
23
|
+
*
|
|
24
|
+
* @this {import('../driver').EspressoDriver}
|
|
25
|
+
* @param {BackgroundAppOptions} [opts={}]
|
|
26
|
+
*/
|
|
27
|
+
async function mobileBackgroundApp(opts = {}) {
|
|
28
|
+
const { seconds = -1 } = opts;
|
|
29
|
+
return await this.background(seconds);
|
|
30
|
+
}
|
|
31
|
+
exports.mobileBackgroundApp = mobileBackgroundApp;
|
|
32
|
+
/**
|
|
33
|
+
* @this {import('../driver').EspressoDriver}
|
|
34
|
+
*/
|
|
35
|
+
// eslint-disable-next-line require-await
|
|
36
|
+
async function closeApp() {
|
|
37
|
+
throw new driver_1.errors.UnsupportedOperationError('Please quit the session in order to close the application under test');
|
|
38
|
+
}
|
|
39
|
+
exports.closeApp = closeApp;
|
|
40
|
+
/**
|
|
41
|
+
* @this {import('../driver').EspressoDriver}
|
|
42
|
+
*/
|
|
43
|
+
// eslint-disable-next-line require-await
|
|
44
|
+
async function reset() {
|
|
45
|
+
throw new driver_1.errors.UnsupportedOperationError('Please quit the session and create a new one ' +
|
|
46
|
+
'in order to close and launch the application under test');
|
|
47
|
+
}
|
|
48
|
+
exports.reset = reset;
|
|
49
|
+
/**
|
|
50
|
+
* @typedef {Object} StartActivityOptions
|
|
51
|
+
* @property {string} appActivity
|
|
52
|
+
* @property {string} [locale]
|
|
53
|
+
* @property {string} [optionalIntentArguments]
|
|
54
|
+
* @property {string} [optionalActivityArguments]
|
|
55
|
+
*/
|
|
56
|
+
/**
|
|
57
|
+
* Starts the given activity with intent options, activity options and locale.
|
|
58
|
+
* Activity could only be executed in scope of the current app package.
|
|
59
|
+
*
|
|
60
|
+
* @this {import('../driver').EspressoDriver}
|
|
61
|
+
* @param {StartActivityOptions} opts
|
|
62
|
+
* @returns {Promise<string>}
|
|
63
|
+
*/
|
|
64
|
+
async function mobileStartActivity(opts) {
|
|
65
|
+
const appPackage = this.caps.appPackage;
|
|
66
|
+
const { appActivity, locale, optionalIntentArguments, optionalActivityArguments } = (0, utils_1.requireOptions)(opts, ['appActivity']);
|
|
67
|
+
return /** @type {string} */ (await this.espresso.jwproxy.command(`/appium/device/start_activity`, 'POST', {
|
|
68
|
+
appPackage,
|
|
69
|
+
appActivity,
|
|
70
|
+
locale,
|
|
71
|
+
optionalIntentArguments,
|
|
72
|
+
optionalActivityArguments
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
exports.mobileStartActivity = mobileStartActivity;
|
|
76
|
+
/**
|
|
77
|
+
*
|
|
78
|
+
* @this {import('../driver').EspressoDriver}
|
|
79
|
+
* @param {string} appPackage
|
|
80
|
+
* @param {string} appActivity
|
|
81
|
+
* @param {string} appWaitPackage
|
|
82
|
+
* @param {string} appWaitActivity
|
|
83
|
+
*/
|
|
84
|
+
async function startActivity(appPackage, appActivity, appWaitPackage, appWaitActivity) {
|
|
85
|
+
// intentAction, intentCategory, intentFlags, optionalIntentArguments, dontStopAppOnReset
|
|
86
|
+
// parameters are not supported by Espresso
|
|
87
|
+
const pkg = /** @type {string} */ (appPackage || this.caps.appPackage);
|
|
88
|
+
const appWaitPkg = /** @type {string} */ (appWaitPackage || pkg);
|
|
89
|
+
const appAct = (0, utils_1.qualifyActivityName)(appActivity, pkg);
|
|
90
|
+
const appWaitAct = (0, utils_1.qualifyActivityName)(appWaitActivity || appAct, appWaitPkg);
|
|
91
|
+
this.log.debug(`Starting activity '${appActivity}' for package '${appPackage}'`);
|
|
92
|
+
await this.espresso.jwproxy.command(`/appium/device/start_activity`, 'POST', {
|
|
93
|
+
appPackage: pkg,
|
|
94
|
+
appActivity: appAct,
|
|
95
|
+
});
|
|
96
|
+
await this.adb.waitForActivity(appWaitPkg, appWaitAct);
|
|
97
|
+
}
|
|
98
|
+
exports.startActivity = startActivity;
|
|
99
|
+
;
|
|
100
|
+
//# sourceMappingURL=app-management.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-management.js","sourceRoot":"","sources":["../../../lib/commands/app-management.js"],"names":[],"mappings":";;;AAAA,0CAAuC;AACvC,oCAA+D;AAE/D;;GAEG;AACH,yCAAyC;AAClC,KAAK,UAAU,SAAS;IAC7B,MAAM,IAAI,eAAM,CAAC,yBAAyB,CACxC,2EAA2E,CAC5E,CAAC;AACJ,CAAC;AAJD,8BAIC;AAED;;;;GAIG;AAEH;;;;;;;GAOG;AACI,KAAK,UAAU,mBAAmB,CAAE,IAAI,GAAG,EAAE;IAClD,MAAM,EAAC,OAAO,GAAG,CAAC,CAAC,EAAC,GAAG,IAAI,CAAC;IAC5B,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC;AAHD,kDAGC;AAED;;GAEG;AACH,yCAAyC;AAClC,KAAK,UAAU,QAAQ;IAC5B,MAAM,IAAI,eAAM,CAAC,yBAAyB,CACxC,sEAAsE,CACvE,CAAC;AACJ,CAAC;AAJD,4BAIC;AAED;;GAEG;AACH,yC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O,CAAC,+BAA+B,EAAE,MAAM,EAAE;QAC3E,UAAU,EAAE,GAAG;QACf,WAAW,EAAE,MAAM;KACpB,CAAC,CAAC;IACH,MAAM,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AACzD,CAAC;AAfD,sCAeC;AAAA,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stop proxying to any Chromedriver and redirect to Espresso
|
|
3
|
+
*
|
|
4
|
+
* @this {import('../driver').EspressoDriver}
|
|
5
|
+
* @returns {void}
|
|
6
|
+
*/
|
|
7
|
+
export function suspendChromedriverProxy(this: import("../driver").EspressoDriver): void;
|
|
8
|
+
export class suspendChromedriverProxy {
|
|
9
|
+
chromedriver: any;
|
|
10
|
+
proxyReqRes: any;
|
|
11
|
+
proxyCommand: any;
|
|
12
|
+
jwpProxyActive: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Runs a chain of Espresso web atoms (see https://developer.android.com/training/testing/espresso/web for reference)
|
|
16
|
+
*
|
|
17
|
+
* Takes JSON of the form
|
|
18
|
+
*
|
|
19
|
+
* {
|
|
20
|
+
* "webviewEl": "<ELEMENT_ID>", // optional webview element to operate on
|
|
21
|
+
* "forceJavascriptEnabled": true|false, // if webview disables javascript, webatoms won't work, this forces it
|
|
22
|
+
* "methodChain": [
|
|
23
|
+
* {"name": "methodName", "atom": {"name": "atomName", "args": ["arg1", "arg2", ...]}},
|
|
24
|
+
* ...
|
|
25
|
+
* ]
|
|
26
|
+
* }
|
|
27
|
+
* @this {import('../driver').EspressoDriver}
|
|
28
|
+
*/
|
|
29
|
+
export function mobileWebAtoms(this: import("../driver").EspressoDriver, opts?: {}): Promise<unknown>;
|
|
30
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../lib/commands/context.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,oFAFa,IAAI,CAOhB;;IAJC,kBAA6B;IAC7B,iBAAgE;IAChE,kBAAkE;IAClE,wBAA0B;;AAG5B;;;;;;;;;;;;;;GAcG;AACH,sGAGC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mobileWebAtoms = exports.suspendChromedriverProxy = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
/**
|
|
6
|
+
* Stop proxying to any Chromedriver and redirect to Espresso
|
|
7
|
+
*
|
|
8
|
+
* @this {import('../driver').EspressoDriver}
|
|
9
|
+
* @returns {void}
|
|
10
|
+
*/
|
|
11
|
+
function suspendChromedriverProxy() {
|
|
12
|
+
this.chromedriver = undefined;
|
|
13
|
+
this.proxyReqRes = this.espresso.proxyReqRes.bind(this.espresso);
|
|
14
|
+
this.proxyCommand = this.espresso.proxyCommand.bind(this.espresso);
|
|
15
|
+
this.jwpProxyActive = true;
|
|
16
|
+
}
|
|
17
|
+
exports.suspendChromedriverProxy = suspendChromedriverProxy;
|
|
18
|
+
/**
|
|
19
|
+
* Runs a chain of Espresso web atoms (see https://developer.android.com/training/testing/espresso/web for reference)
|
|
20
|
+
*
|
|
21
|
+
* Takes JSON of the form
|
|
22
|
+
*
|
|
23
|
+
* {
|
|
24
|
+
* "webviewEl": "<ELEMENT_ID>", // optional webview element to operate on
|
|
25
|
+
* "forceJavascriptEnabled": true|false, // if webview disables javascript, webatoms won't work, this forces it
|
|
26
|
+
* "methodChain": [
|
|
27
|
+
* {"name": "methodName", "atom": {"name": "atomName", "args": ["arg1", "arg2", ...]}},
|
|
28
|
+
* ...
|
|
29
|
+
* ]
|
|
30
|
+
* }
|
|
31
|
+
* @this {import('../driver').EspressoDriver}
|
|
32
|
+
*/
|
|
33
|
+
async function mobileWebAtoms(opts = {}) {
|
|
34
|
+
opts = (0, utils_1.requireOptions)(opts, ['methodChain']);
|
|
35
|
+
return await this.espresso.jwproxy.command(`/appium/execute_mobile/web_atoms`, 'POST', opts);
|
|
36
|
+
}
|
|
37
|
+
exports.mobileWebAtoms = mobileWebAtoms;
|
|
38
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../lib/commands/context.js"],"names":[],"mappings":";;;AAAA,oCAA0C;AAE1C;;;;;GAKG;AACH,SAAgB,wBAAwB;IACtC,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;IAC9B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;AAC7B,CAAC;AALD,4DAKC;AAED;;;;;;;;;;;;;;GAcG;AACI,KAAK,UAAU,cAAc,CAAE,IAAI,GAAG,EAAE;IAC7C,IAAI,GAAG,IAAA,sBAAc,EAAC,IAAI,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAC7C,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,kCAAkC,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AAC/F,CAAC;AAHD,wCAGC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flash the element with given id.
|
|
3
|
+
* durationMillis and repeatCount are optional
|
|
4
|
+
* @this {import('../driver').EspressoDriver}
|
|
5
|
+
*/
|
|
6
|
+
export function mobileFlashElement(this: import("../driver").EspressoDriver, opts?: {}): Promise<unknown>;
|
|
7
|
+
/**
|
|
8
|
+
* @this {import('../driver').EspressoDriver}
|
|
9
|
+
*/
|
|
10
|
+
export function mobileDismissAutofill(this: import("../driver").EspressoDriver, opts?: {}): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* @this {import('../driver').EspressoDriver}
|
|
13
|
+
*/
|
|
14
|
+
export function mobileSwipe(this: import("../driver").EspressoDriver, opts?: {}): Promise<unknown>;
|
|
15
|
+
/**
|
|
16
|
+
* @this {import('../driver').EspressoDriver}
|
|
17
|
+
*/
|
|
18
|
+
export function mobileOpenDrawer(this: import("../driver").EspressoDriver, opts?: {}): Promise<unknown>;
|
|
19
|
+
/**
|
|
20
|
+
* @this {import('../driver').EspressoDriver}
|
|
21
|
+
*/
|
|
22
|
+
export function mobileCloseDrawer(this: import("../driver").EspressoDriver, opts?: {}): Promise<unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* @this {import('../driver').EspressoDriver}
|
|
25
|
+
*/
|
|
26
|
+
export function mobileSetDate(this: import("../driver").EspressoDriver, opts?: {}): Promise<unknown>;
|
|
27
|
+
/**
|
|
28
|
+
* @this {import('../driver').EspressoDriver}
|
|
29
|
+
*/
|
|
30
|
+
export function mobileSetTime(this: import("../driver").EspressoDriver, opts?: {}): Promise<unknown>;
|
|
31
|
+
/**
|
|
32
|
+
* @this {import('../driver').EspressoDriver}
|
|
33
|
+
*/
|
|
34
|
+
export function mobileNavigateTo(this: import("../driver").EspressoDriver, opts?: {}): Promise<unknown>;
|
|
35
|
+
/**
|
|
36
|
+
* Perform a 'GeneralClickAction' (https://developer.android.com/reference/androidx/test/espresso/action/GeneralClickAction)
|
|
37
|
+
* @this {import('../driver').EspressoDriver}
|
|
38
|
+
*/
|
|
39
|
+
export function mobileClickAction(this: import("../driver").EspressoDriver, opts?: {}): Promise<unknown>;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @this {import('../driver').EspressoDriver}
|
|
43
|
+
*/
|
|
44
|
+
export function mobileScrollToPage(this: import("../driver").EspressoDriver, opts?: {}): Promise<unknown>;
|
|
45
|
+
/**
|
|
46
|
+
* @typedef {Object} PerformEditorActionOpts
|
|
47
|
+
* @property {string|number} action
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
* @this {import('../driver').EspressoDriver}
|
|
51
|
+
* @param {PerformEditorActionOpts} opts
|
|
52
|
+
* @returns {Promise<void>}
|
|
53
|
+
*/
|
|
54
|
+
export function mobilePerformEditorAction(this: import("../driver").EspressoDriver, opts: PerformEditorActionOpts): Promise<void>;
|
|
55
|
+
export type PerformEditorActionOpts = {
|
|
56
|
+
action: string | number;
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../../lib/commands/element.js"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,0GASC;AAED;;GAEG;AACH,0GAMC;AAED;;GAEG;AACH,mGAeC;AAGD;;GAEG;AACH,wGAOC;AAED;;GAEG;AACH,yGAOC;AAED;;GAEG;AACH,qGAYC;AAED;;GAEG;AACH,qGASC;AAED;;GAEG;AACH,wGAaC;AAED;;;GAGG;AACH,yGAUC;AAED;;;GAGG;AACH,0GAyBC;AAED;;;GAGG;AAEH;;;;GAIG;AACH,0FAHW,uBAAuB,GACrB,QAAQ,IAAI,CAAC,CAKzB;;YAXa,MAAM,GAAC,MAAM"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.mobilePerformEditorAction = exports.mobileScrollToPage = exports.mobileClickAction = exports.mobileNavigateTo = exports.mobileSetTime = exports.mobileSetDate = exports.mobileCloseDrawer = exports.mobileOpenDrawer = exports.mobileSwipe = exports.mobileDismissAutofill = exports.mobileFlashElement = void 0;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const driver_1 = require("appium/driver");
|
|
9
|
+
const support_1 = require("appium/support");
|
|
10
|
+
const utils_1 = require("../utils");
|
|
11
|
+
/**
|
|
12
|
+
* Flash the element with given id.
|
|
13
|
+
* durationMillis and repeatCount are optional
|
|
14
|
+
* @this {import('../driver').EspressoDriver}
|
|
15
|
+
*/
|
|
16
|
+
async function mobileFlashElement(opts = {}) {
|
|
17
|
+
const { durationMillis, repeatCount } = opts;
|
|
18
|
+
return await this.espresso.jwproxy.command(`/appium/execute_mobile/${requireElementId(opts)}/flash`, 'POST', {
|
|
19
|
+
durationMillis,
|
|
20
|
+
repeatCount
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
exports.mobileFlashElement = mobileFlashElement;
|
|
24
|
+
/**
|
|
25
|
+
* @this {import('../driver').EspressoDriver}
|
|
26
|
+
*/
|
|
27
|
+
async function mobileDismissAutofill(opts = {}) {
|
|
28
|
+
await this.espresso.jwproxy.command(`/session/:sessionId/appium/execute_mobile/${requireElementId(opts)}/dismiss_autofill`, 'POST', {});
|
|
29
|
+
}
|
|
30
|
+
exports.mobileDismissAutofill = mobileDismissAutofill;
|
|
31
|
+
/**
|
|
32
|
+
* @this {import('../driver').EspressoDriver}
|
|
33
|
+
*/
|
|
34
|
+
async function mobileSwipe(opts = {}) {
|
|
35
|
+
const { direction, swiper, startCoordinates, endCoordinates, precisionDescriber } = opts;
|
|
36
|
+
const element = requireElementId(opts);
|
|
37
|
+
return await this.espresso.jwproxy.command(`/appium/execute_mobile/${element}/swipe`, 'POST', {
|
|
38
|
+
direction,
|
|
39
|
+
element,
|
|
40
|
+
swiper,
|
|
41
|
+
startCoordinates,
|
|
42
|
+
endCoordinates,
|
|
43
|
+
precisionDescriber,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
exports.mobileSwipe = mobileSwipe;
|
|
47
|
+
/**
|
|
48
|
+
* @this {import('../driver').EspressoDriver}
|
|
49
|
+
*/
|
|
50
|
+
async function mobileOpenDrawer(opts = {}) {
|
|
51
|
+
const { gravity } = opts;
|
|
52
|
+
return await this.espresso.jwproxy.command(`/appium/execute_mobile/${requireElementId(opts)}/open_drawer`, 'POST', { gravity });
|
|
53
|
+
}
|
|
54
|
+
exports.mobileOpenDrawer = mobileOpenDrawer;
|
|
55
|
+
/**
|
|
56
|
+
* @this {import('../driver').EspressoDriver}
|
|
57
|
+
*/
|
|
58
|
+
async function mobileCloseDrawer(opts = {}) {
|
|
59
|
+
const { gravity } = opts;
|
|
60
|
+
return await this.espresso.jwproxy.command(`/appium/execute_mobile/${requireElementId(opts)}/close_drawer`, 'POST', { gravity });
|
|
61
|
+
}
|
|
62
|
+
exports.mobileCloseDrawer = mobileCloseDrawer;
|
|
63
|
+
/**
|
|
64
|
+
* @this {import('../driver').EspressoDriver}
|
|
65
|
+
*/
|
|
66
|
+
async function mobileSetDate(opts = {}) {
|
|
67
|
+
const { year, monthOfYear, dayOfMonth } = (0, utils_1.requireOptions)(opts, ['year', 'monthOfYear', 'dayOfMonth']);
|
|
68
|
+
return await this.espresso.jwproxy.command(`/appium/execute_mobile/${requireElementId(opts)}/set_date`, 'POST', {
|
|
69
|
+
year,
|
|
70
|
+
monthOfYear,
|
|
71
|
+
dayOfMonth,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
exports.mobileSetDate = mobileSetDate;
|
|
75
|
+
/**
|
|
76
|
+
* @this {import('../driver').EspressoDriver}
|
|
77
|
+
*/
|
|
78
|
+
async function mobileSetTime(opts = {}) {
|
|
79
|
+
const { hours, minutes } = (0, utils_1.requireOptions)(opts, ['hours', 'minutes']);
|
|
80
|
+
return await this.espresso.jwproxy.command(`/appium/execute_mobile/${requireElementId(opts)}/set_time`, 'POST', {
|
|
81
|
+
hours,
|
|
82
|
+
minutes,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
exports.mobileSetTime = mobileSetTime;
|
|
86
|
+
/**
|
|
87
|
+
* @this {import('../driver').EspressoDriver}
|
|
88
|
+
*/
|
|
89
|
+
async function mobileNavigateTo(opts = {}) {
|
|
90
|
+
const { menuItemId } = (0, utils_1.requireOptions)(opts, ['menuItemId']);
|
|
91
|
+
const menuItemIdAsNumber = parseInt(menuItemId, 10);
|
|
92
|
+
if (lodash_1.default.isNaN(menuItemIdAsNumber) || menuItemIdAsNumber < 0) {
|
|
93
|
+
throw new driver_1.errors.InvalidArgumentError(`'menuItemId' must be a non-negative number. Found ${menuItemId}`);
|
|
94
|
+
}
|
|
95
|
+
return await this.espresso.jwproxy.command(`/appium/execute_mobile/${requireElementId(opts)}/navigate_to`, 'POST', { menuItemId });
|
|
96
|
+
}
|
|
97
|
+
exports.mobileNavigateTo = mobileNavigateTo;
|
|
98
|
+
/**
|
|
99
|
+
* Perform a 'GeneralClickAction' (https://developer.android.com/reference/androidx/test/espresso/action/GeneralClickAction)
|
|
100
|
+
* @this {import('../driver').EspressoDriver}
|
|
101
|
+
*/
|
|
102
|
+
async function mobileClickAction(opts = {}) {
|
|
103
|
+
const { tapper, coordinatesProvider, precisionDescriber, inputDevice, buttonState } = opts;
|
|
104
|
+
return await this.espresso.jwproxy.command(`/appium/execute_mobile/${requireElementId(opts)}/click_action`, 'POST', {
|
|
105
|
+
tapper, coordinatesProvider, precisionDescriber, inputDevice, buttonState
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
exports.mobileClickAction = mobileClickAction;
|
|
109
|
+
/**
|
|
110
|
+
*
|
|
111
|
+
* @this {import('../driver').EspressoDriver}
|
|
112
|
+
*/
|
|
113
|
+
async function mobileScrollToPage(opts = {}) {
|
|
114
|
+
const { scrollTo, scrollToPage, smoothScroll } = opts;
|
|
115
|
+
const scrollToTypes = ['first', 'last', 'left', 'right'];
|
|
116
|
+
if (!scrollToTypes.includes(scrollTo)) {
|
|
117
|
+
throw new driver_1.errors.InvalidArgumentError(`"scrollTo" must be one of "${scrollToTypes.join(', ')}" found '${scrollTo}'`);
|
|
118
|
+
}
|
|
119
|
+
if (!lodash_1.default.isInteger(scrollToPage) || scrollToPage < 0) {
|
|
120
|
+
throw new driver_1.errors.InvalidArgumentError(`"scrollToPage" must be a non-negative integer. Found '${scrollToPage}'`);
|
|
121
|
+
}
|
|
122
|
+
if (support_1.util.hasValue(scrollTo) && support_1.util.hasValue(scrollToPage)) {
|
|
123
|
+
this.log.warn(`'scrollTo' and 'scrollToPage' where both provided. Defaulting to 'scrollTo'`);
|
|
124
|
+
}
|
|
125
|
+
return await this.espresso.jwproxy.command(`/appium/execute_mobile/${requireElementId(opts)}/scroll_to_page`, 'POST', {
|
|
126
|
+
scrollTo,
|
|
127
|
+
scrollToPage,
|
|
128
|
+
smoothScroll,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
exports.mobileScrollToPage = mobileScrollToPage;
|
|
132
|
+
/**
|
|
133
|
+
* @typedef {Object} PerformEditorActionOpts
|
|
134
|
+
* @property {string|number} action
|
|
135
|
+
*/
|
|
136
|
+
/**
|
|
137
|
+
* @this {import('../driver').EspressoDriver}
|
|
138
|
+
* @param {PerformEditorActionOpts} opts
|
|
139
|
+
* @returns {Promise<void>}
|
|
140
|
+
*/
|
|
141
|
+
async function mobilePerformEditorAction(opts) {
|
|
142
|
+
const { action } = (0, utils_1.requireOptions)(opts, ['action']);
|
|
143
|
+
await this.espresso.jwproxy.command('/appium/device/perform_editor_action', 'POST', { action });
|
|
144
|
+
}
|
|
145
|
+
exports.mobilePerformEditorAction = mobilePerformEditorAction;
|
|
146
|
+
// #region Internal Helpers
|
|
147
|
+
/**
|
|
148
|
+
* @param {Record<string, any>} opts
|
|
149
|
+
* @returns {string}
|
|
150
|
+
*/
|
|
151
|
+
function requireElementId(opts) {
|
|
152
|
+
const { element, elementId } = opts;
|
|
153
|
+
if (!element && !elementId) {
|
|
154
|
+
throw new driver_1.errors.InvalidArgumentError('Element Id must be provided');
|
|
155
|
+
}
|
|
156
|
+
return support_1.util.unwrapElement(elementId || element);
|
|
157
|
+
}
|
|
158
|
+
// #endregion
|
|
159
|
+
//# sourceMappingURL=element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element.js","sourceRoot":"","sources":["../../../lib/commands/element.js"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,0CAAuC;AACvC,4CAAsC;AACtC,oCAA0C;AAE1C;;;;GAIG;AACI,KAAK,UAAU,kBAAkB,CAAE,IAAI,GAAG,EAAE;IACjD,MAAM,EAAC,cAAc,EAAE,WAAW,EAAC,GAAG,IAAI,CAAC;IAC3C,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CACxC,0BAA0B,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EACxD,MAAM,EAAE;QACN,cAAc;QACd,WAAW;KACZ,CACF,CAAC;AACJ,CAAC;AATD,gDASC;AAED;;GAEG;AACI,KAAK,UAAU,qBAAqB,CAAE,IAAI,GAAG,EAAE;IACpD,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CACjC,6CAA6C,gBAAgB,CAAC,IAAI,CAAC,mBAAmB,EACtF,MAAM,EACN,EAAE,CACH,CAAC;AACJ,CAAC;AAND,sDAMC;AAED;;GAEG;AACI,KAAK,UAAU,WAAW,CAAE,IAAI,GAAG,EAAE;IAC1C,MAAM,EAAC,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,cAAc,EAAE,kBAAkB,EAAC,GAAG,IAAI,CAAC;IACvF,MAAM,OAAO,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACvC,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CACxC,0BAA0B,OAAO,QAAQ,EACzC,MAAM,EACN;QACE,SAAS;QACT,OAAO;QACP,MAAM;QACN,gBAAgB;QAChB,cAAc;QACd,kBAAkB;KACnB,CACF,CAAC;AACJ,CAAC;AAfD,kCAeC;AAGD;;GAEG;AACI,KAAK,UAAU,gBAAgB,CAAE,IAAI,GAAG,EAAE;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AE;QAC1B,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,6BAA6B,CAAC,CAAC;KACtE;IACD,OAAO,cAAI,CAAC,aAAa,CAAC,SAAS,IAAI,OAAO,CAAC,CAAC;AAClD,CAAC;AAED,aAAa"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*/
|
|
9
|
-
function executeMobile(this: import("../driver").EspressoDriver, mobileCommand: string, opts?: Record<string, any> | undefined): Promise<any>;
|
|
10
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @this {import('../driver').EspressoDriver}
|
|
3
|
+
* @param {string} mobileCommand
|
|
4
|
+
* @param {Record<string, any>} [opts={}]
|
|
5
|
+
* @returns {Promise<any>}
|
|
6
|
+
*/
|
|
7
|
+
export function executeMobile(this: import("../driver").EspressoDriver, mobileCommand: string, opts?: Record<string, any> | undefined): Promise<any>;
|
|
11
8
|
//# sourceMappingURL=execute.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../lib/commands/execute.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../lib/commands/execute.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,uFAJW,MAAM,2CAEJ,QAAQ,GAAG,CAAC,CA2HxB"}
|
|
@@ -3,16 +3,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.executeMobile = void 0;
|
|
6
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
7
8
|
const driver_1 = require("appium/driver");
|
|
8
|
-
const extensions = {};
|
|
9
9
|
/**
|
|
10
10
|
* @this {import('../driver').EspressoDriver}
|
|
11
11
|
* @param {string} mobileCommand
|
|
12
12
|
* @param {Record<string, any>} [opts={}]
|
|
13
13
|
* @returns {Promise<any>}
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
async function executeMobile(mobileCommand, opts = {}) {
|
|
16
16
|
const mobileCommandsMapping = {
|
|
17
17
|
shell: 'mobileShell',
|
|
18
18
|
execEmuConsoleCommand: 'mobileExecEmuConsoleCommand',
|
|
@@ -100,6 +100,6 @@ extensions.executeMobile = async function executeMobile(mobileCommand, opts = {}
|
|
|
100
100
|
`Only ${lodash_1.default.keys(mobileCommandsMapping)} commands are supported.`);
|
|
101
101
|
}
|
|
102
102
|
return await this[mobileCommandsMapping[mobileCommand]](opts);
|
|
103
|
-
}
|
|
104
|
-
exports.
|
|
103
|
+
}
|
|
104
|
+
exports.executeMobile = executeMobile;
|
|
105
105
|
//# sourceMappingURL=execute.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../lib/commands/execute.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../lib/commands/execute.js"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,0CAAuC;AAEvC;;;;;GAKG;AACI,KAAK,UAAU,aAAa,CAAE,aAAa,EAAE,IAAI,GAAG,EAAE;IAC3D,MAAM,qBAAqB,GAAG;QAC5B,KAAK,EAAE,aAAa;QAEpB,qBAAqB,EAAE,6BAA6B;QAEpD,mBAAmB,EAAE,2BAA2B;QAEhD,iBAAiB,EAAE,yBAAyB;QAC5C,cAAc,EAAE,sBAAsB;QAEtC,oBAAoB,EAAE,4BAA4B;QAClD,mBAAmB,EAAE,2BAA2B;QAEhD,KAAK,EAAE,aAAa;QACpB,YAAY,EAAE,oBAAoB;QAClC,UAAU,EAAE,kBAAkB;QAC9B,WAAW,EAAE,mBAAmB;QAEhC,UAAU,EAAE,qBAAqB;QAEjC,cAAc,E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