appium-espresso-driver 6.3.4 → 6.3.5
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 +6 -0
- package/build/lib/commands/actions.d.ts +7 -4
- package/build/lib/commands/actions.d.ts.map +1 -1
- package/build/lib/commands/actions.js +4 -3
- package/build/lib/commands/actions.js.map +1 -1
- package/build/lib/commands/app-management.d.ts +15 -13
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js +22 -15
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/clipboard.d.ts +10 -12
- package/build/lib/commands/clipboard.d.ts.map +1 -1
- package/build/lib/commands/clipboard.js +9 -14
- package/build/lib/commands/clipboard.js.map +1 -1
- package/build/lib/commands/context.d.ts +9 -14
- package/build/lib/commands/context.d.ts.map +1 -1
- package/build/lib/commands/context.js +5 -6
- package/build/lib/commands/context.js.map +1 -1
- package/build/lib/commands/idling-resources.d.ts +11 -15
- package/build/lib/commands/idling-resources.d.ts.map +1 -1
- package/build/lib/commands/idling-resources.js +7 -11
- package/build/lib/commands/idling-resources.js.map +1 -1
- package/build/lib/commands/services.d.ts +11 -12
- package/build/lib/commands/services.d.ts.map +1 -1
- package/build/lib/commands/services.js +10 -12
- package/build/lib/commands/services.js.map +1 -1
- package/espresso-server/library/src/main/java/io/appium/espressoserver/lib/helpers/Version.kt +1 -1
- package/lib/commands/{actions.js → actions.ts} +11 -4
- package/lib/commands/app-management.ts +67 -0
- package/lib/commands/clipboard.ts +32 -0
- package/lib/commands/{context.js → context.ts} +14 -11
- package/lib/commands/{idling-resources.js → idling-resources.ts} +19 -16
- package/lib/commands/services.ts +49 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/lib/commands/app-management.js +0 -53
- package/lib/commands/clipboard.js +0 -31
- package/lib/commands/services.js +0 -40
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [6.3.5](https://github.com/appium/appium-espresso-driver/compare/v6.3.4...v6.3.5) (2026-01-17)
|
|
2
|
+
|
|
3
|
+
### Miscellaneous Chores
|
|
4
|
+
|
|
5
|
+
* Migrate the rest of commands to typescript ([#1125](https://github.com/appium/appium-espresso-driver/issues/1125)) ([83edd51](https://github.com/appium/appium-espresso-driver/commit/83edd51b1639a560a735b17518aa29c217e826bc))
|
|
6
|
+
|
|
1
7
|
## [6.3.4](https://github.com/appium/appium-espresso-driver/compare/v6.3.3...v6.3.4) (2026-01-17)
|
|
2
8
|
|
|
3
9
|
### Miscellaneous Chores
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import type { EspressoDriver } from '../driver';
|
|
2
|
+
import type { StringRecord } from '@appium/types';
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @
|
|
4
|
+
* Performs a sequence of W3C actions (e.g., pointer, key, wheel actions).
|
|
5
|
+
* Automatically converts pointer actions to touch type for mobile compatibility.
|
|
6
|
+
* @param actions - Array of action objects following the W3C Actions protocol
|
|
7
|
+
* @returns Promise that resolves when all actions are performed
|
|
5
8
|
*/
|
|
6
|
-
export function performActions(this:
|
|
9
|
+
export declare function performActions(this: EspressoDriver, actions: StringRecord[]): Promise<void>;
|
|
7
10
|
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../lib/commands/actions.
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../lib/commands/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,YAAY,EAAE,GACtB,OAAO,CAAC,IAAI,CAAC,CASf"}
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.performActions = performActions;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @
|
|
5
|
+
* Performs a sequence of W3C actions (e.g., pointer, key, wheel actions).
|
|
6
|
+
* Automatically converts pointer actions to touch type for mobile compatibility.
|
|
7
|
+
* @param actions - Array of action objects following the W3C Actions protocol
|
|
8
|
+
* @returns Promise that resolves when all actions are performed
|
|
8
9
|
*/
|
|
9
10
|
async function performActions(actions) {
|
|
10
11
|
this.log.debug(`Received the following W3C actions: ${JSON.stringify(actions, null, ' ')}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../lib/commands/actions.
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../lib/commands/actions.ts"],"names":[],"mappings":";;AASA,wCAYC;AAlBD;;;;;GAKG;AACI,KAAK,UAAU,cAAc,CAElC,OAAuB;IAEvB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,uCAAuC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAC7F,6EAA6E;IAC7E,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACnD,GAAG,MAAM;QACT,GAAG,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAC,UAAU,EAAE,EAAC,WAAW,EAAE,OAAO,EAAC,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KAC3E,CAAC,CAAC,CAAC;IACJ,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,yBAAyB,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3F,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,EAAC,OAAO,EAAE,mBAAmB,EAAC,CAAC,CAAC;AAC1F,CAAC"}
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
+
import type { EspressoDriver } from '../driver';
|
|
1
2
|
/**
|
|
2
3
|
* Starts the given activity with intent options, activity options and locale.
|
|
3
4
|
* Activity could only be executed in scope of the current app package.
|
|
4
5
|
*
|
|
5
|
-
* @
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
9
|
-
* @
|
|
10
|
-
* @returns {Promise<string>}
|
|
6
|
+
* @param appActivity - The activity name to start
|
|
7
|
+
* @param locale - Optional locale string (e.g., 'en_US', 'fr_FR')
|
|
8
|
+
* @param optionalIntentArguments - Optional intent arguments as a string
|
|
9
|
+
* @param optionalActivityArguments - Optional activity arguments as a string
|
|
10
|
+
* @returns Promise that resolves to a string when the activity is started
|
|
11
11
|
*/
|
|
12
|
-
export function mobileStartActivity(this:
|
|
12
|
+
export declare function mobileStartActivity(this: EspressoDriver, appActivity: string, locale?: string, optionalIntentArguments?: string, optionalActivityArguments?: string): Promise<string>;
|
|
13
13
|
/**
|
|
14
|
+
* Starts an activity with the given package and activity names.
|
|
15
|
+
* Waits for the activity to be ready before returning.
|
|
14
16
|
*
|
|
15
|
-
* @
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
18
|
-
* @param
|
|
19
|
-
* @
|
|
17
|
+
* @param appPackage - The package name of the app to start
|
|
18
|
+
* @param appActivity - The activity name to start
|
|
19
|
+
* @param appWaitPackage - Optional package name to wait for (defaults to appPackage)
|
|
20
|
+
* @param appWaitActivity - Optional activity name to wait for (defaults to appActivity)
|
|
21
|
+
* @returns Promise that resolves when the activity is started and ready
|
|
20
22
|
*/
|
|
21
|
-
export function startActivity(this:
|
|
23
|
+
export declare function startActivity(this: EspressoDriver, appPackage?: string, appActivity?: string, appWaitPackage?: string, appWaitActivity?: string): Promise<void>;
|
|
22
24
|
//# 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,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,cAAc,EACpB,WAAW,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,MAAM,EACf,uBAAuB,CAAC,EAAE,MAAM,EAChC,yBAAyB,CAAC,EAAE,MAAM,GACjC,OAAO,CAAC,MAAM,CAAC,CASjB;AAED;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,cAAc,EACpB,UAAU,CAAC,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,MAAM,EACpB,cAAc,CAAC,EAAE,MAAM,EACvB,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,IAAI,CAAC,CAmBf"}
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mobileStartActivity = mobileStartActivity;
|
|
4
4
|
exports.startActivity = startActivity;
|
|
5
|
+
const driver_1 = require("appium/driver");
|
|
5
6
|
const utils_1 = require("../utils");
|
|
6
7
|
/**
|
|
7
8
|
* Starts the given activity with intent options, activity options and locale.
|
|
8
9
|
* Activity could only be executed in scope of the current app package.
|
|
9
10
|
*
|
|
10
|
-
* @
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
13
|
-
* @param
|
|
14
|
-
* @
|
|
15
|
-
* @returns {Promise<string>}
|
|
11
|
+
* @param appActivity - The activity name to start
|
|
12
|
+
* @param locale - Optional locale string (e.g., 'en_US', 'fr_FR')
|
|
13
|
+
* @param optionalIntentArguments - Optional intent arguments as a string
|
|
14
|
+
* @param optionalActivityArguments - Optional activity arguments as a string
|
|
15
|
+
* @returns Promise that resolves to a string when the activity is started
|
|
16
16
|
*/
|
|
17
17
|
async function mobileStartActivity(appActivity, locale, optionalIntentArguments, optionalActivityArguments) {
|
|
18
18
|
const appPackage = this.caps.appPackage;
|
|
19
|
-
return
|
|
19
|
+
return (await this.espresso.jwproxy.command(`/appium/device/start_activity`, 'POST', {
|
|
20
20
|
appPackage,
|
|
21
21
|
appActivity,
|
|
22
22
|
locale,
|
|
@@ -25,18 +25,26 @@ async function mobileStartActivity(appActivity, locale, optionalIntentArguments,
|
|
|
25
25
|
}));
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
+
* Starts an activity with the given package and activity names.
|
|
29
|
+
* Waits for the activity to be ready before returning.
|
|
28
30
|
*
|
|
29
|
-
* @
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
33
|
-
* @
|
|
31
|
+
* @param appPackage - The package name of the app to start
|
|
32
|
+
* @param appActivity - The activity name to start
|
|
33
|
+
* @param appWaitPackage - Optional package name to wait for (defaults to appPackage)
|
|
34
|
+
* @param appWaitActivity - Optional activity name to wait for (defaults to appActivity)
|
|
35
|
+
* @returns Promise that resolves when the activity is started and ready
|
|
34
36
|
*/
|
|
35
37
|
async function startActivity(appPackage, appActivity, appWaitPackage, appWaitActivity) {
|
|
36
38
|
// intentAction, intentCategory, intentFlags, optionalIntentArguments, dontStopAppOnReset
|
|
37
39
|
// parameters are not supported by Espresso
|
|
38
|
-
const pkg =
|
|
39
|
-
|
|
40
|
+
const pkg = appPackage || this.caps.appPackage;
|
|
41
|
+
if (!pkg) {
|
|
42
|
+
throw new driver_1.errors.InvalidArgumentError('appPackage is required');
|
|
43
|
+
}
|
|
44
|
+
const appWaitPkg = appWaitPackage || pkg;
|
|
45
|
+
if (!appActivity) {
|
|
46
|
+
throw new driver_1.errors.InvalidArgumentError('appActivity is required');
|
|
47
|
+
}
|
|
40
48
|
const appAct = (0, utils_1.qualifyActivityName)(appActivity, pkg);
|
|
41
49
|
const appWaitAct = (0, utils_1.qualifyActivityName)(appWaitActivity || appAct, appWaitPkg);
|
|
42
50
|
this.log.debug(`Starting activity '${appActivity}' for package '${appPackage}'`);
|
|
@@ -46,5 +54,4 @@ async function startActivity(appPackage, appActivity, appWaitPackage, appWaitAct
|
|
|
46
54
|
});
|
|
47
55
|
await this.adb.waitForActivity(appWaitPkg, appWaitAct);
|
|
48
56
|
}
|
|
49
|
-
;
|
|
50
57
|
//# 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":";;AAcA,kDAeC;AAYD,sCAyBC;AAjED,0CAAuC;AACvC,oCAA+C;AAE/C;;;;;;;;;GASG;AACI,KAAK,UAAU,mBAAmB,CAEvC,WAAmB,EACnB,MAAe,EACf,uBAAgC,EAChC,yBAAkC;IAElC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;IACxC,OAAO,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,+BAA+B,EAAE,MAAM,EAAE;QACnF,UAAU;QACV,WAAW;QACX,MAAM;QACN,uBAAuB;QACvB,yBAAyB;KAC1B,CAAC,CAAW,CAAC;AAChB,CAAC;AAED;;;;;;;;;GASG;AACI,KAAK,UAAU,aAAa,CAEjC,UAAmB,EACnB,WAAoB,EACpB,cAAuB,EACvB,eAAwB;IAExB,yFAAyF;IACzF,2CAA2C;IAC3C,MAAM,GAAG,GAAG,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;IAC/C,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,wBAAwB,CAAC,CAAC;IAClE,CAAC;IACD,MAAM,UAAU,GAAG,cAAc,IAAI,GAAG,CAAC;IACzC,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,yBAAyB,CAAC,CAAC;IACnE,CAAC;IACD,MAAM,MAAM,GAAG,IAAA,2BAAmB,EAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IACrD,MAAM,UAAU,GAAG,IAAA,2BAAmB,EAAC,eAAe,IAAI,MAAM,EAAE,UAAU,CAAC,CAAC;IAC9E,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,sBAAsB,WAAW,kBAAkB,UAAU,GAAG,CAAC,CAAC;IACjF,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,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"}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
+
import type { EspressoDriver } from '../driver';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @returns
|
|
3
|
+
* Gets the clipboard content from the device.
|
|
4
|
+
* @returns Promise that resolves to base64-encoded content of the clipboard
|
|
4
5
|
* or an empty string if the clipboard is empty.
|
|
5
6
|
*/
|
|
6
|
-
export function getClipboard(this:
|
|
7
|
+
export declare function getClipboard(this: EspressoDriver): Promise<string>;
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
11
|
-
*
|
|
12
|
-
* @
|
|
13
|
-
* clipboard payload
|
|
14
|
-
* @returns {Promise<void>}
|
|
9
|
+
* Sets the clipboard content on the device.
|
|
10
|
+
* @param content - Base64-encoded clipboard payload
|
|
11
|
+
* @param contentType - Only a single content type is supported, which is 'plaintext'
|
|
12
|
+
* @param label - Optional label to identify the current clipboard payload
|
|
13
|
+
* @returns Promise that resolves when the clipboard is set
|
|
15
14
|
*/
|
|
16
|
-
export function mobileSetClipboard(this:
|
|
17
|
-
export type EspressoDriver = import("../driver").EspressoDriver;
|
|
15
|
+
export declare function mobileSetClipboard(this: EspressoDriver, content: string, contentType?: 'plaintext', label?: string): Promise<void>;
|
|
18
16
|
//# sourceMappingURL=clipboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../../lib/commands/clipboard.
|
|
1
|
+
{"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../../lib/commands/clipboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD;;;;GAIG;AACH,wBAAsB,YAAY,CAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAIzE;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,WAAW,EACzB,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAMf"}
|
|
@@ -3,28 +3,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getClipboard = getClipboard;
|
|
4
4
|
exports.mobileSetClipboard = mobileSetClipboard;
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* @returns
|
|
6
|
+
* Gets the clipboard content from the device.
|
|
7
|
+
* @returns Promise that resolves to base64-encoded content of the clipboard
|
|
8
8
|
* or an empty string if the clipboard is empty.
|
|
9
9
|
*/
|
|
10
10
|
async function getClipboard() {
|
|
11
|
-
return
|
|
11
|
+
return await this.adb.getApiLevel() < 29
|
|
12
12
|
? (await this.espresso.jwproxy.command('/appium/device/get_clipboard', 'POST', {}))
|
|
13
|
-
:
|
|
13
|
+
: await this.settingsApp.getClipboard();
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
* @param
|
|
18
|
-
* @param
|
|
19
|
-
*
|
|
20
|
-
* @
|
|
21
|
-
* clipboard payload
|
|
22
|
-
* @returns {Promise<void>}
|
|
16
|
+
* Sets the clipboard content on the device.
|
|
17
|
+
* @param content - Base64-encoded clipboard payload
|
|
18
|
+
* @param contentType - Only a single content type is supported, which is 'plaintext'
|
|
19
|
+
* @param label - Optional label to identify the current clipboard payload
|
|
20
|
+
* @returns Promise that resolves when the clipboard is set
|
|
23
21
|
*/
|
|
24
22
|
async function mobileSetClipboard(content, contentType, label) {
|
|
25
23
|
await this.espresso.jwproxy.command('/appium/device/set_clipboard', 'POST', { content, contentType, label });
|
|
26
24
|
}
|
|
27
|
-
/**
|
|
28
|
-
* @typedef {import('../driver').EspressoDriver} EspressoDriver
|
|
29
|
-
*/
|
|
30
25
|
//# sourceMappingURL=clipboard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clipboard.js","sourceRoot":"","sources":["../../../lib/commands/clipboard.
|
|
1
|
+
{"version":3,"file":"clipboard.js","sourceRoot":"","sources":["../../../lib/commands/clipboard.ts"],"names":[],"mappings":";;AAOA,oCAIC;AASD,gDAWC;AA7BD;;;;GAIG;AACI,KAAK,UAAU,YAAY;IAChC,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,EAAE;QACtC,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,8BAA8B,EAAE,MAAM,EAAE,EAAE,CAAC,CAAW;QAC7F,CAAC,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;AAC5C,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,kBAAkB,CAEtC,OAAe,EACf,WAAyB,EACzB,KAAc;IAEd,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CACjC,8BAA8B,EAC9B,MAAM,EACN,EAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAC,CAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
+
import type { EspressoDriver } from '../driver';
|
|
2
|
+
import type { StringRecord } from '@appium/types';
|
|
1
3
|
/**
|
|
2
4
|
* Stop proxying to any Chromedriver and redirect to Espresso
|
|
3
5
|
*
|
|
4
|
-
* @
|
|
5
|
-
* @returns {void}
|
|
6
|
+
* @returns void
|
|
6
7
|
*/
|
|
7
|
-
export function suspendChromedriverProxy(this:
|
|
8
|
-
export class suspendChromedriverProxy {
|
|
9
|
-
chromedriver: any;
|
|
10
|
-
proxyReqRes: any;
|
|
11
|
-
proxyCommand: any;
|
|
12
|
-
jwpProxyActive: boolean;
|
|
13
|
-
}
|
|
8
|
+
export declare function suspendChromedriverProxy(this: EspressoDriver): void;
|
|
14
9
|
/**
|
|
15
10
|
* Runs a chain of Espresso web atoms (see https://developer.android.com/training/testing/espresso/web for reference)
|
|
16
11
|
*
|
|
@@ -24,11 +19,11 @@ export class suspendChromedriverProxy {
|
|
|
24
19
|
* ...
|
|
25
20
|
* ]
|
|
26
21
|
* }
|
|
27
|
-
* @this {import('../driver').EspressoDriver}
|
|
28
22
|
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-webatoms
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
23
|
+
* @param webviewEl - Optional webview element ID to operate on
|
|
24
|
+
* @param forceJavascriptEnabled - If webview disables javascript, webatoms won't work, this forces it
|
|
25
|
+
* @param methodChain - Array of method chain objects, each containing a name and atom with name and args
|
|
26
|
+
* @returns Promise that resolves to the result of executing the web atoms
|
|
32
27
|
*/
|
|
33
|
-
export function mobileWebAtoms(this:
|
|
28
|
+
export declare function mobileWebAtoms(this: EspressoDriver, webviewEl?: string, forceJavascriptEnabled?: boolean, methodChain?: StringRecord[]): Promise<any>;
|
|
34
29
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../lib/commands/context.
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../lib/commands/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAE,IAAI,EAAE,cAAc,GAAG,IAAI,CAKpE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,cAAc,EACpB,SAAS,CAAC,EAAE,MAAM,EAClB,sBAAsB,CAAC,EAAE,OAAO,EAChC,WAAW,CAAC,EAAE,YAAY,EAAE,GAC3B,OAAO,CAAC,GAAG,CAAC,CAMd"}
|
|
@@ -5,8 +5,7 @@ exports.mobileWebAtoms = mobileWebAtoms;
|
|
|
5
5
|
/**
|
|
6
6
|
* Stop proxying to any Chromedriver and redirect to Espresso
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
9
|
-
* @returns {void}
|
|
8
|
+
* @returns void
|
|
10
9
|
*/
|
|
11
10
|
function suspendChromedriverProxy() {
|
|
12
11
|
this.chromedriver = undefined;
|
|
@@ -27,11 +26,11 @@ function suspendChromedriverProxy() {
|
|
|
27
26
|
* ...
|
|
28
27
|
* ]
|
|
29
28
|
* }
|
|
30
|
-
* @this {import('../driver').EspressoDriver}
|
|
31
29
|
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-webatoms
|
|
32
|
-
* @param
|
|
33
|
-
* @param
|
|
34
|
-
* @param
|
|
30
|
+
* @param webviewEl - Optional webview element ID to operate on
|
|
31
|
+
* @param forceJavascriptEnabled - If webview disables javascript, webatoms won't work, this forces it
|
|
32
|
+
* @param methodChain - Array of method chain objects, each containing a name and atom with name and args
|
|
33
|
+
* @returns Promise that resolves to the result of executing the web atoms
|
|
35
34
|
*/
|
|
36
35
|
async function mobileWebAtoms(webviewEl, forceJavascriptEnabled, methodChain) {
|
|
37
36
|
return await this.espresso.jwproxy.command(`/appium/execute_mobile/web_atoms`, 'POST', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../lib/commands/context.
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../lib/commands/context.ts"],"names":[],"mappings":";;AAQA,4DAKC;AAqBD,wCAWC;AA1CD;;;;GAIG;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;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACI,KAAK,UAAU,cAAc,CAElC,SAAkB,EAClB,sBAAgC,EAChC,WAA4B;IAE5B,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,kCAAkC,EAAE,MAAM,EAAE;QACrF,SAAS;QACT,sBAAsB;QACtB,WAAW;KACZ,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
* @typedef {Object} IdlingResourcesOptions
|
|
3
|
-
*/
|
|
1
|
+
import type { EspressoDriver } from '../driver';
|
|
4
2
|
/**
|
|
5
3
|
* Registers one or more idling resources
|
|
6
4
|
*
|
|
7
|
-
* @this {import('../driver').EspressoDriver}
|
|
8
5
|
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-registeridlingresources
|
|
9
|
-
* @param
|
|
6
|
+
* @param classNames - The comma-separated list of idling resources class names.
|
|
10
7
|
* Each name must be a full-qualified java class name, like `io.appium.espressoserver.lib.MyIdlingResource`.
|
|
11
8
|
* Each class in the app source must implement a singleton pattern and have a static `getInstance()`
|
|
12
9
|
* method returning the class instance, which implements `androidx.test.espresso.IdlingResource`
|
|
@@ -14,15 +11,15 @@
|
|
|
14
11
|
* - https://developer.android.com/training/testing/espresso/idling-resource
|
|
15
12
|
* - https://android.jlelse.eu/integrate-espresso-idling-resources-in-your-app-to-build-flexible-ui-tests-c779e24f5057
|
|
16
13
|
* for more details on how to design and use idling resources concept in Espresso.
|
|
14
|
+
* @returns Promise that resolves when idling resources are registered
|
|
17
15
|
* @throws {Error} If there was a failure while parsing options or registering
|
|
18
16
|
* the actual instances
|
|
19
17
|
*/
|
|
20
|
-
export function mobileRegisterIdlingResources(this:
|
|
18
|
+
export declare function mobileRegisterIdlingResources(this: EspressoDriver, classNames: string): Promise<any>;
|
|
21
19
|
/**
|
|
22
20
|
* Unregisters one or more idling resources
|
|
23
21
|
*
|
|
24
|
-
* @
|
|
25
|
-
* @param {string} classNames - The comma-separated list of idling resources class names.
|
|
22
|
+
* @param classNames - The comma-separated list of idling resources class names.
|
|
26
23
|
* Each name must be a full-qualified java class name, like `io.appium.espressoserver.lib.MyIdlingResource`.
|
|
27
24
|
* Each class in the app source must implement a singleton pattern and have a static `getInstance()`
|
|
28
25
|
* method returning the class instance, which implements `androidx.test.espresso.IdlingResource`
|
|
@@ -30,22 +27,21 @@ export function mobileRegisterIdlingResources(this: import("../driver").Espresso
|
|
|
30
27
|
* - https://developer.android.com/training/testing/espresso/idling-resource
|
|
31
28
|
* - https://android.jlelse.eu/integrate-espresso-idling-resources-in-your-app-to-build-flexible-ui-tests-c779e24f5057
|
|
32
29
|
* for more details on how to design and use idling resources concept in Espresso.
|
|
30
|
+
* @returns Promise that resolves when idling resources are unregistered
|
|
33
31
|
* @throws {Error} If there was a failure while parsing options or unregistering
|
|
34
32
|
* the actual instances
|
|
35
33
|
*/
|
|
36
|
-
export function mobileUnregisterIdlingResources(this:
|
|
34
|
+
export declare function mobileUnregisterIdlingResources(this: EspressoDriver, classNames: string): Promise<any>;
|
|
37
35
|
/**
|
|
38
36
|
* Returns a list of currently registered idling resources
|
|
39
37
|
* or an empty list if no resources have been registered yet.
|
|
40
38
|
*
|
|
41
|
-
* @
|
|
42
|
-
* @returns {Promise<string[]>} The list of fully qualified class names
|
|
39
|
+
* @returns Promise that resolves to the list of fully qualified class names
|
|
43
40
|
*/
|
|
44
|
-
export function mobileListIdlingResources(this:
|
|
41
|
+
export declare function mobileListIdlingResources(this: EspressoDriver): Promise<string[]>;
|
|
45
42
|
/**
|
|
46
43
|
* Wait for UI thread to be idle.
|
|
47
|
-
* @
|
|
44
|
+
* @returns Promise that resolves when the UI thread is idle
|
|
48
45
|
*/
|
|
49
|
-
export function mobileWaitForUIThread(this:
|
|
50
|
-
export type IdlingResourcesOptions = any;
|
|
46
|
+
export declare function mobileWaitForUIThread(this: EspressoDriver): Promise<any>;
|
|
51
47
|
//# sourceMappingURL=idling-resources.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idling-resources.d.ts","sourceRoot":"","sources":["../../../lib/commands/idling-resources.
|
|
1
|
+
{"version":3,"file":"idling-resources.d.ts","sourceRoot":"","sources":["../../../lib/commands/idling-resources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,6BAA6B,CACjD,IAAI,EAAE,cAAc,EACpB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,GAAG,CAAC,CAId;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,+BAA+B,CACnD,IAAI,EAAE,cAAc,EACpB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,GAAG,CAAC,CAId;AAED;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAIxF;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,CAE/E"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @typedef {Object} IdlingResourcesOptions
|
|
4
|
-
*/
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.mobileRegisterIdlingResources = mobileRegisterIdlingResources;
|
|
7
4
|
exports.mobileUnregisterIdlingResources = mobileUnregisterIdlingResources;
|
|
@@ -10,9 +7,8 @@ exports.mobileWaitForUIThread = mobileWaitForUIThread;
|
|
|
10
7
|
/**
|
|
11
8
|
* Registers one or more idling resources
|
|
12
9
|
*
|
|
13
|
-
* @this {import('../driver').EspressoDriver}
|
|
14
10
|
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-registeridlingresources
|
|
15
|
-
* @param
|
|
11
|
+
* @param classNames - The comma-separated list of idling resources class names.
|
|
16
12
|
* Each name must be a full-qualified java class name, like `io.appium.espressoserver.lib.MyIdlingResource`.
|
|
17
13
|
* Each class in the app source must implement a singleton pattern and have a static `getInstance()`
|
|
18
14
|
* method returning the class instance, which implements `androidx.test.espresso.IdlingResource`
|
|
@@ -20,6 +16,7 @@ exports.mobileWaitForUIThread = mobileWaitForUIThread;
|
|
|
20
16
|
* - https://developer.android.com/training/testing/espresso/idling-resource
|
|
21
17
|
* - https://android.jlelse.eu/integrate-espresso-idling-resources-in-your-app-to-build-flexible-ui-tests-c779e24f5057
|
|
22
18
|
* for more details on how to design and use idling resources concept in Espresso.
|
|
19
|
+
* @returns Promise that resolves when idling resources are registered
|
|
23
20
|
* @throws {Error} If there was a failure while parsing options or registering
|
|
24
21
|
* the actual instances
|
|
25
22
|
*/
|
|
@@ -31,8 +28,7 @@ async function mobileRegisterIdlingResources(classNames) {
|
|
|
31
28
|
/**
|
|
32
29
|
* Unregisters one or more idling resources
|
|
33
30
|
*
|
|
34
|
-
* @
|
|
35
|
-
* @param {string} classNames - The comma-separated list of idling resources class names.
|
|
31
|
+
* @param classNames - The comma-separated list of idling resources class names.
|
|
36
32
|
* Each name must be a full-qualified java class name, like `io.appium.espressoserver.lib.MyIdlingResource`.
|
|
37
33
|
* Each class in the app source must implement a singleton pattern and have a static `getInstance()`
|
|
38
34
|
* method returning the class instance, which implements `androidx.test.espresso.IdlingResource`
|
|
@@ -40,6 +36,7 @@ async function mobileRegisterIdlingResources(classNames) {
|
|
|
40
36
|
* - https://developer.android.com/training/testing/espresso/idling-resource
|
|
41
37
|
* - https://android.jlelse.eu/integrate-espresso-idling-resources-in-your-app-to-build-flexible-ui-tests-c779e24f5057
|
|
42
38
|
* for more details on how to design and use idling resources concept in Espresso.
|
|
39
|
+
* @returns Promise that resolves when idling resources are unregistered
|
|
43
40
|
* @throws {Error} If there was a failure while parsing options or unregistering
|
|
44
41
|
* the actual instances
|
|
45
42
|
*/
|
|
@@ -52,15 +49,14 @@ async function mobileUnregisterIdlingResources(classNames) {
|
|
|
52
49
|
* Returns a list of currently registered idling resources
|
|
53
50
|
* or an empty list if no resources have been registered yet.
|
|
54
51
|
*
|
|
55
|
-
* @
|
|
56
|
-
* @returns {Promise<string[]>} The list of fully qualified class names
|
|
52
|
+
* @returns Promise that resolves to the list of fully qualified class names
|
|
57
53
|
*/
|
|
58
54
|
async function mobileListIdlingResources() {
|
|
59
|
-
return
|
|
55
|
+
return (await this.espresso.jwproxy.command('/appium/execute_mobile/list_idling_resources', 'GET'));
|
|
60
56
|
}
|
|
61
57
|
/**
|
|
62
58
|
* Wait for UI thread to be idle.
|
|
63
|
-
* @
|
|
59
|
+
* @returns Promise that resolves when the UI thread is idle
|
|
64
60
|
*/
|
|
65
61
|
async function mobileWaitForUIThread() {
|
|
66
62
|
return await this.espresso.jwproxy.command('/appium/execute_mobile/ui_thread_sync', 'POST');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idling-resources.js","sourceRoot":"","sources":["../../../lib/commands/idling-resources.
|
|
1
|
+
{"version":3,"file":"idling-resources.js","sourceRoot":"","sources":["../../../lib/commands/idling-resources.ts"],"names":[],"mappings":";;AAkBA,sEAOC;AAiBD,0EAOC;AAQD,8DAIC;AAMD,sDAEC;AAnED;;;;;;;;;;;;;;;GAeG;AACI,KAAK,UAAU,6BAA6B,CAEjD,UAAkB;IAElB,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,kDAAkD,EAAE,MAAM,EAAE;QACrG,UAAU;KACX,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACI,KAAK,UAAU,+BAA+B,CAEnD,UAAkB;IAElB,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,oDAAoD,EAAE,MAAM,EAAE;QACvG,UAAU;KACX,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,yBAAyB;IAC7C,OAAO,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CACzC,8CAA8C,EAAE,KAAK,CACtD,CAAa,CAAC;AACjB,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,qBAAqB;IACzC,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,uCAAuC,EAAE,MAAM,CAAC,CAAC;AAC9F,CAAC"}
|
|
@@ -1,31 +1,30 @@
|
|
|
1
|
+
import type { EspressoDriver } from '../driver';
|
|
1
2
|
/**
|
|
2
3
|
* Starts the given service intent.
|
|
3
4
|
*
|
|
4
|
-
* @this {import('../driver').EspressoDriver}
|
|
5
5
|
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-startservice
|
|
6
|
-
* @param
|
|
6
|
+
* @param intent - The name of the service intent to start, for example
|
|
7
7
|
* `com.some.package.name/.YourServiceSubClassName`. This option is mandatory.
|
|
8
8
|
* !!! Only services in the app's under test scope could be started.
|
|
9
|
-
* @param
|
|
10
|
-
* started as foreground service.
|
|
11
|
-
* @param
|
|
12
|
-
* @returns
|
|
9
|
+
* @param foreground - Set it to `true` if your service must be
|
|
10
|
+
* started as foreground service. Defaults to `false`.
|
|
11
|
+
* @param user - Optional user identifier (string or number)
|
|
12
|
+
* @returns Promise that resolves to the full component name
|
|
13
13
|
* @throws {Error} If there was a failure while starting the service
|
|
14
14
|
* or required options are missing
|
|
15
15
|
*/
|
|
16
|
-
export function mobileStartService(this:
|
|
16
|
+
export declare function mobileStartService(this: EspressoDriver, intent: string, foreground?: boolean, user?: string | number): Promise<string>;
|
|
17
17
|
/**
|
|
18
18
|
* Stops the given service intent.
|
|
19
19
|
*
|
|
20
|
-
* @this {import('../driver').EspressoDriver}
|
|
21
20
|
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-stopservice
|
|
22
|
-
* @param
|
|
21
|
+
* @param intent - The name of the service intent to stop, for example
|
|
23
22
|
* `com.some.package.name/.YourServiceSubClassName`. This option is mandatory.
|
|
24
23
|
* !!! Only services in the app's under test scope could be stopped.
|
|
25
|
-
* @param
|
|
26
|
-
* @returns
|
|
24
|
+
* @param user - Optional user identifier (string or number)
|
|
25
|
+
* @returns Promise that resolves to `true` if the service has been successfully stopped
|
|
27
26
|
* @throws {Error} If there was a failure while stopping the service
|
|
28
27
|
* or required options are missing
|
|
29
28
|
*/
|
|
30
|
-
export function mobileStopService(this:
|
|
29
|
+
export declare function mobileStopService(this: EspressoDriver, intent: string, user?: string | number): Promise<string>;
|
|
31
30
|
//# sourceMappingURL=services.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../lib/commands/services.
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../lib/commands/services.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,OAAO,EACpB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GACrB,OAAO,CAAC,MAAM,CAAC,CAKjB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GACrB,OAAO,CAAC,MAAM,CAAC,CAIjB"}
|
|
@@ -5,35 +5,33 @@ exports.mobileStopService = mobileStopService;
|
|
|
5
5
|
/**
|
|
6
6
|
* Starts the given service intent.
|
|
7
7
|
*
|
|
8
|
-
* @this {import('../driver').EspressoDriver}
|
|
9
8
|
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-startservice
|
|
10
|
-
* @param
|
|
9
|
+
* @param intent - The name of the service intent to start, for example
|
|
11
10
|
* `com.some.package.name/.YourServiceSubClassName`. This option is mandatory.
|
|
12
11
|
* !!! Only services in the app's under test scope could be started.
|
|
13
|
-
* @param
|
|
14
|
-
* started as foreground service.
|
|
15
|
-
* @param
|
|
16
|
-
* @returns
|
|
12
|
+
* @param foreground - Set it to `true` if your service must be
|
|
13
|
+
* started as foreground service. Defaults to `false`.
|
|
14
|
+
* @param user - Optional user identifier (string or number)
|
|
15
|
+
* @returns Promise that resolves to the full component name
|
|
17
16
|
* @throws {Error} If there was a failure while starting the service
|
|
18
17
|
* or required options are missing
|
|
19
18
|
*/
|
|
20
19
|
async function mobileStartService(intent, foreground, user) {
|
|
21
|
-
return
|
|
20
|
+
return (await this.espresso.jwproxy.command('/appium/execute_mobile/start_service', 'POST', { intent, foreground, user }));
|
|
22
21
|
}
|
|
23
22
|
/**
|
|
24
23
|
* Stops the given service intent.
|
|
25
24
|
*
|
|
26
|
-
* @this {import('../driver').EspressoDriver}
|
|
27
25
|
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-stopservice
|
|
28
|
-
* @param
|
|
26
|
+
* @param intent - The name of the service intent to stop, for example
|
|
29
27
|
* `com.some.package.name/.YourServiceSubClassName`. This option is mandatory.
|
|
30
28
|
* !!! Only services in the app's under test scope could be stopped.
|
|
31
|
-
* @param
|
|
32
|
-
* @returns
|
|
29
|
+
* @param user - Optional user identifier (string or number)
|
|
30
|
+
* @returns Promise that resolves to `true` if the service has been successfully stopped
|
|
33
31
|
* @throws {Error} If there was a failure while stopping the service
|
|
34
32
|
* or required options are missing
|
|
35
33
|
*/
|
|
36
34
|
async function mobileStopService(intent, user) {
|
|
37
|
-
return
|
|
35
|
+
return (await this.espresso.jwproxy.command('/appium/execute_mobile/stop_service', 'POST', { intent, user }));
|
|
38
36
|
}
|
|
39
37
|
//# sourceMappingURL=services.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../../lib/commands/services.
|
|
1
|
+
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../../lib/commands/services.ts"],"names":[],"mappings":";;AAgBA,gDAUC;AAcD,8CAQC;AA9CD;;;;;;;;;;;;;GAaG;AACI,KAAK,UAAU,kBAAkB,CAEtC,MAAc,EACd,UAAoB,EACpB,IAAsB;IAEtB,OAAO,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CACzC,sCAAsC,EAAE,MAAM,EAC9C,EAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAC,CAC3B,CAAW,CAAC;AACf,CAAC;AAED;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,iBAAiB,CAErC,MAAc,EACd,IAAsB;IAEtB,OAAO,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CACzC,qCAAqC,EAAE,MAAM,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,CAC9D,CAAW,CAAC;AACf,CAAC"}
|
package/espresso-server/library/src/main/java/io/appium/espressoserver/lib/helpers/Version.kt
CHANGED
|
@@ -2,6 +2,6 @@ package io.appium.espressoserver.lib.helpers
|
|
|
2
2
|
|
|
3
3
|
// This value is updated automatically by the NPM versioning script
|
|
4
4
|
// It should be in sync with the NPM module version from package.json
|
|
5
|
-
private const val VERSION = "6.3.
|
|
5
|
+
private const val VERSION = "6.3.5"
|
|
6
6
|
|
|
7
7
|
fun getEspressoServerVersion() = VERSION
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
import type { EspressoDriver } from '../driver';
|
|
2
|
+
import type { StringRecord } from '@appium/types';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @
|
|
5
|
+
* Performs a sequence of W3C actions (e.g., pointer, key, wheel actions).
|
|
6
|
+
* Automatically converts pointer actions to touch type for mobile compatibility.
|
|
7
|
+
* @param actions - Array of action objects following the W3C Actions protocol
|
|
8
|
+
* @returns Promise that resolves when all actions are performed
|
|
5
9
|
*/
|
|
6
|
-
export async function performActions(
|
|
10
|
+
export async function performActions(
|
|
11
|
+
this: EspressoDriver,
|
|
12
|
+
actions: StringRecord[]
|
|
13
|
+
): Promise<void> {
|
|
7
14
|
this.log.debug(`Received the following W3C actions: ${JSON.stringify(actions, null, ' ')}`);
|
|
8
15
|
// This is needed because Selenium API uses MOUSE as the default pointer type
|
|
9
16
|
const preprocessedActions = actions.map((action) => ({
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { EspressoDriver } from '../driver';
|
|
2
|
+
import { errors } from 'appium/driver';
|
|
3
|
+
import { qualifyActivityName } from '../utils';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Starts the given activity with intent options, activity options and locale.
|
|
7
|
+
* Activity could only be executed in scope of the current app package.
|
|
8
|
+
*
|
|
9
|
+
* @param appActivity - The activity name to start
|
|
10
|
+
* @param locale - Optional locale string (e.g., 'en_US', 'fr_FR')
|
|
11
|
+
* @param optionalIntentArguments - Optional intent arguments as a string
|
|
12
|
+
* @param optionalActivityArguments - Optional activity arguments as a string
|
|
13
|
+
* @returns Promise that resolves to a string when the activity is started
|
|
14
|
+
*/
|
|
15
|
+
export async function mobileStartActivity (
|
|
16
|
+
this: EspressoDriver,
|
|
17
|
+
appActivity: string,
|
|
18
|
+
locale?: string,
|
|
19
|
+
optionalIntentArguments?: string,
|
|
20
|
+
optionalActivityArguments?: string
|
|
21
|
+
): Promise<string> {
|
|
22
|
+
const appPackage = this.caps.appPackage;
|
|
23
|
+
return (await this.espresso.jwproxy.command(`/appium/device/start_activity`, 'POST', {
|
|
24
|
+
appPackage,
|
|
25
|
+
appActivity,
|
|
26
|
+
locale,
|
|
27
|
+
optionalIntentArguments,
|
|
28
|
+
optionalActivityArguments
|
|
29
|
+
})) as string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Starts an activity with the given package and activity names.
|
|
34
|
+
* Waits for the activity to be ready before returning.
|
|
35
|
+
*
|
|
36
|
+
* @param appPackage - The package name of the app to start
|
|
37
|
+
* @param appActivity - The activity name to start
|
|
38
|
+
* @param appWaitPackage - Optional package name to wait for (defaults to appPackage)
|
|
39
|
+
* @param appWaitActivity - Optional activity name to wait for (defaults to appActivity)
|
|
40
|
+
* @returns Promise that resolves when the activity is started and ready
|
|
41
|
+
*/
|
|
42
|
+
export async function startActivity (
|
|
43
|
+
this: EspressoDriver,
|
|
44
|
+
appPackage?: string,
|
|
45
|
+
appActivity?: string,
|
|
46
|
+
appWaitPackage?: string,
|
|
47
|
+
appWaitActivity?: string
|
|
48
|
+
): Promise<void> {
|
|
49
|
+
// intentAction, intentCategory, intentFlags, optionalIntentArguments, dontStopAppOnReset
|
|
50
|
+
// parameters are not supported by Espresso
|
|
51
|
+
const pkg = appPackage || this.caps.appPackage;
|
|
52
|
+
if (!pkg) {
|
|
53
|
+
throw new errors.InvalidArgumentError('appPackage is required');
|
|
54
|
+
}
|
|
55
|
+
const appWaitPkg = appWaitPackage || pkg;
|
|
56
|
+
if (!appActivity) {
|
|
57
|
+
throw new errors.InvalidArgumentError('appActivity is required');
|
|
58
|
+
}
|
|
59
|
+
const appAct = qualifyActivityName(appActivity, pkg);
|
|
60
|
+
const appWaitAct = qualifyActivityName(appWaitActivity || appAct, appWaitPkg);
|
|
61
|
+
this.log.debug(`Starting activity '${appActivity}' for package '${appPackage}'`);
|
|
62
|
+
await this.espresso.jwproxy.command(`/appium/device/start_activity`, 'POST', {
|
|
63
|
+
appPackage: pkg,
|
|
64
|
+
appActivity: appAct,
|
|
65
|
+
});
|
|
66
|
+
await this.adb.waitForActivity(appWaitPkg, appWaitAct);
|
|
67
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { EspressoDriver } from '../driver';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Gets the clipboard content from the device.
|
|
5
|
+
* @returns Promise that resolves to base64-encoded content of the clipboard
|
|
6
|
+
* or an empty string if the clipboard is empty.
|
|
7
|
+
*/
|
|
8
|
+
export async function getClipboard (this: EspressoDriver): Promise<string> {
|
|
9
|
+
return await this.adb.getApiLevel() < 29
|
|
10
|
+
? (await this.espresso.jwproxy.command('/appium/device/get_clipboard', 'POST', {})) as string
|
|
11
|
+
: await this.settingsApp.getClipboard();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Sets the clipboard content on the device.
|
|
16
|
+
* @param content - Base64-encoded clipboard payload
|
|
17
|
+
* @param contentType - Only a single content type is supported, which is 'plaintext'
|
|
18
|
+
* @param label - Optional label to identify the current clipboard payload
|
|
19
|
+
* @returns Promise that resolves when the clipboard is set
|
|
20
|
+
*/
|
|
21
|
+
export async function mobileSetClipboard(
|
|
22
|
+
this: EspressoDriver,
|
|
23
|
+
content: string,
|
|
24
|
+
contentType?: 'plaintext',
|
|
25
|
+
label?: string
|
|
26
|
+
): Promise<void> {
|
|
27
|
+
await this.espresso.jwproxy.command(
|
|
28
|
+
'/appium/device/set_clipboard',
|
|
29
|
+
'POST',
|
|
30
|
+
{content, contentType, label}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import type { EspressoDriver } from '../driver';
|
|
2
|
+
import type { StringRecord } from '@appium/types';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Stop proxying to any Chromedriver and redirect to Espresso
|
|
3
6
|
*
|
|
4
|
-
* @
|
|
5
|
-
* @returns {void}
|
|
7
|
+
* @returns void
|
|
6
8
|
*/
|
|
7
|
-
export function suspendChromedriverProxy () {
|
|
9
|
+
export function suspendChromedriverProxy (this: EspressoDriver): void {
|
|
8
10
|
this.chromedriver = undefined;
|
|
9
11
|
this.proxyReqRes = this.espresso.proxyReqRes.bind(this.espresso);
|
|
10
12
|
this.proxyCommand = this.espresso.proxyCommand.bind(this.espresso);
|
|
@@ -24,17 +26,18 @@ export function suspendChromedriverProxy () {
|
|
|
24
26
|
* ...
|
|
25
27
|
* ]
|
|
26
28
|
* }
|
|
27
|
-
* @this {import('../driver').EspressoDriver}
|
|
28
29
|
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-webatoms
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
30
|
+
* @param webviewEl - Optional webview element ID to operate on
|
|
31
|
+
* @param forceJavascriptEnabled - If webview disables javascript, webatoms won't work, this forces it
|
|
32
|
+
* @param methodChain - Array of method chain objects, each containing a name and atom with name and args
|
|
33
|
+
* @returns Promise that resolves to the result of executing the web atoms
|
|
32
34
|
*/
|
|
33
35
|
export async function mobileWebAtoms (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
this: EspressoDriver,
|
|
37
|
+
webviewEl?: string,
|
|
38
|
+
forceJavascriptEnabled?: boolean,
|
|
39
|
+
methodChain?: StringRecord[]
|
|
40
|
+
): Promise<any> {
|
|
38
41
|
return await this.espresso.jwproxy.command(`/appium/execute_mobile/web_atoms`, 'POST', {
|
|
39
42
|
webviewEl,
|
|
40
43
|
forceJavascriptEnabled,
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
* @typedef {Object} IdlingResourcesOptions
|
|
3
|
-
*/
|
|
1
|
+
import type { EspressoDriver } from '../driver';
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
4
|
* Registers one or more idling resources
|
|
7
5
|
*
|
|
8
|
-
* @this {import('../driver').EspressoDriver}
|
|
9
6
|
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-registeridlingresources
|
|
10
|
-
* @param
|
|
7
|
+
* @param classNames - The comma-separated list of idling resources class names.
|
|
11
8
|
* Each name must be a full-qualified java class name, like `io.appium.espressoserver.lib.MyIdlingResource`.
|
|
12
9
|
* Each class in the app source must implement a singleton pattern and have a static `getInstance()`
|
|
13
10
|
* method returning the class instance, which implements `androidx.test.espresso.IdlingResource`
|
|
@@ -15,10 +12,14 @@
|
|
|
15
12
|
* - https://developer.android.com/training/testing/espresso/idling-resource
|
|
16
13
|
* - https://android.jlelse.eu/integrate-espresso-idling-resources-in-your-app-to-build-flexible-ui-tests-c779e24f5057
|
|
17
14
|
* for more details on how to design and use idling resources concept in Espresso.
|
|
15
|
+
* @returns Promise that resolves when idling resources are registered
|
|
18
16
|
* @throws {Error} If there was a failure while parsing options or registering
|
|
19
17
|
* the actual instances
|
|
20
18
|
*/
|
|
21
|
-
export async function mobileRegisterIdlingResources (
|
|
19
|
+
export async function mobileRegisterIdlingResources (
|
|
20
|
+
this: EspressoDriver,
|
|
21
|
+
classNames: string
|
|
22
|
+
): Promise<any> {
|
|
22
23
|
return await this.espresso.jwproxy.command('/appium/execute_mobile/register_idling_resources', 'POST', {
|
|
23
24
|
classNames,
|
|
24
25
|
});
|
|
@@ -27,8 +28,7 @@ export async function mobileRegisterIdlingResources (classNames) {
|
|
|
27
28
|
/**
|
|
28
29
|
* Unregisters one or more idling resources
|
|
29
30
|
*
|
|
30
|
-
* @
|
|
31
|
-
* @param {string} classNames - The comma-separated list of idling resources class names.
|
|
31
|
+
* @param classNames - The comma-separated list of idling resources class names.
|
|
32
32
|
* Each name must be a full-qualified java class name, like `io.appium.espressoserver.lib.MyIdlingResource`.
|
|
33
33
|
* Each class in the app source must implement a singleton pattern and have a static `getInstance()`
|
|
34
34
|
* method returning the class instance, which implements `androidx.test.espresso.IdlingResource`
|
|
@@ -36,10 +36,14 @@ export async function mobileRegisterIdlingResources (classNames) {
|
|
|
36
36
|
* - https://developer.android.com/training/testing/espresso/idling-resource
|
|
37
37
|
* - https://android.jlelse.eu/integrate-espresso-idling-resources-in-your-app-to-build-flexible-ui-tests-c779e24f5057
|
|
38
38
|
* for more details on how to design and use idling resources concept in Espresso.
|
|
39
|
+
* @returns Promise that resolves when idling resources are unregistered
|
|
39
40
|
* @throws {Error} If there was a failure while parsing options or unregistering
|
|
40
41
|
* the actual instances
|
|
41
42
|
*/
|
|
42
|
-
export async function mobileUnregisterIdlingResources (
|
|
43
|
+
export async function mobileUnregisterIdlingResources (
|
|
44
|
+
this: EspressoDriver,
|
|
45
|
+
classNames: string
|
|
46
|
+
): Promise<any> {
|
|
43
47
|
return await this.espresso.jwproxy.command('/appium/execute_mobile/unregister_idling_resources', 'POST', {
|
|
44
48
|
classNames
|
|
45
49
|
});
|
|
@@ -49,19 +53,18 @@ export async function mobileUnregisterIdlingResources (classNames) {
|
|
|
49
53
|
* Returns a list of currently registered idling resources
|
|
50
54
|
* or an empty list if no resources have been registered yet.
|
|
51
55
|
*
|
|
52
|
-
* @
|
|
53
|
-
* @returns {Promise<string[]>} The list of fully qualified class names
|
|
56
|
+
* @returns Promise that resolves to the list of fully qualified class names
|
|
54
57
|
*/
|
|
55
|
-
export async function mobileListIdlingResources () {
|
|
56
|
-
return
|
|
58
|
+
export async function mobileListIdlingResources (this: EspressoDriver): Promise<string[]> {
|
|
59
|
+
return (await this.espresso.jwproxy.command(
|
|
57
60
|
'/appium/execute_mobile/list_idling_resources', 'GET'
|
|
58
|
-
));
|
|
61
|
+
)) as string[];
|
|
59
62
|
}
|
|
60
63
|
|
|
61
64
|
/**
|
|
62
65
|
* Wait for UI thread to be idle.
|
|
63
|
-
* @
|
|
66
|
+
* @returns Promise that resolves when the UI thread is idle
|
|
64
67
|
*/
|
|
65
|
-
export async function mobileWaitForUIThread () {
|
|
68
|
+
export async function mobileWaitForUIThread (this: EspressoDriver): Promise<any> {
|
|
66
69
|
return await this.espresso.jwproxy.command('/appium/execute_mobile/ui_thread_sync', 'POST');
|
|
67
70
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { EspressoDriver } from '../driver';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Starts the given service intent.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-startservice
|
|
7
|
+
* @param intent - The name of the service intent to start, for example
|
|
8
|
+
* `com.some.package.name/.YourServiceSubClassName`. This option is mandatory.
|
|
9
|
+
* !!! Only services in the app's under test scope could be started.
|
|
10
|
+
* @param foreground - Set it to `true` if your service must be
|
|
11
|
+
* started as foreground service. Defaults to `false`.
|
|
12
|
+
* @param user - Optional user identifier (string or number)
|
|
13
|
+
* @returns Promise that resolves to the full component name
|
|
14
|
+
* @throws {Error} If there was a failure while starting the service
|
|
15
|
+
* or required options are missing
|
|
16
|
+
*/
|
|
17
|
+
export async function mobileStartService (
|
|
18
|
+
this: EspressoDriver,
|
|
19
|
+
intent: string,
|
|
20
|
+
foreground?: boolean,
|
|
21
|
+
user?: string | number
|
|
22
|
+
): Promise<string> {
|
|
23
|
+
return (await this.espresso.jwproxy.command(
|
|
24
|
+
'/appium/execute_mobile/start_service', 'POST',
|
|
25
|
+
{intent, foreground, user}
|
|
26
|
+
)) as string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Stops the given service intent.
|
|
31
|
+
*
|
|
32
|
+
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-stopservice
|
|
33
|
+
* @param intent - The name of the service intent to stop, for example
|
|
34
|
+
* `com.some.package.name/.YourServiceSubClassName`. This option is mandatory.
|
|
35
|
+
* !!! Only services in the app's under test scope could be stopped.
|
|
36
|
+
* @param user - Optional user identifier (string or number)
|
|
37
|
+
* @returns Promise that resolves to `true` if the service has been successfully stopped
|
|
38
|
+
* @throws {Error} If there was a failure while stopping the service
|
|
39
|
+
* or required options are missing
|
|
40
|
+
*/
|
|
41
|
+
export async function mobileStopService (
|
|
42
|
+
this: EspressoDriver,
|
|
43
|
+
intent: string,
|
|
44
|
+
user?: string | number
|
|
45
|
+
): Promise<string> {
|
|
46
|
+
return (await this.espresso.jwproxy.command(
|
|
47
|
+
'/appium/execute_mobile/stop_service', 'POST', {intent, user}
|
|
48
|
+
)) as string;
|
|
49
|
+
}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appium-espresso-driver",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.5",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "appium-espresso-driver",
|
|
9
|
-
"version": "6.3.
|
|
9
|
+
"version": "6.3.5",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"appium-adb": "^14.0.0",
|
package/package.json
CHANGED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { qualifyActivityName } from '../utils';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Starts the given activity with intent options, activity options and locale.
|
|
5
|
-
* Activity could only be executed in scope of the current app package.
|
|
6
|
-
*
|
|
7
|
-
* @this {import('../driver').EspressoDriver}
|
|
8
|
-
* @param {string} appActivity
|
|
9
|
-
* @param {string} [locale]
|
|
10
|
-
* @param {string} [optionalIntentArguments]
|
|
11
|
-
* @param {string} [optionalActivityArguments]
|
|
12
|
-
* @returns {Promise<string>}
|
|
13
|
-
*/
|
|
14
|
-
export async function mobileStartActivity (
|
|
15
|
-
appActivity,
|
|
16
|
-
locale,
|
|
17
|
-
optionalIntentArguments,
|
|
18
|
-
optionalActivityArguments
|
|
19
|
-
) {
|
|
20
|
-
const appPackage = this.caps.appPackage;
|
|
21
|
-
return /** @type {string} */ (await this.espresso.jwproxy.command(`/appium/device/start_activity`, 'POST', {
|
|
22
|
-
appPackage,
|
|
23
|
-
appActivity,
|
|
24
|
-
locale,
|
|
25
|
-
optionalIntentArguments,
|
|
26
|
-
optionalActivityArguments
|
|
27
|
-
}));
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
* @this {import('../driver').EspressoDriver}
|
|
33
|
-
* @param {string} appPackage
|
|
34
|
-
* @param {string} appActivity
|
|
35
|
-
* @param {string} appWaitPackage
|
|
36
|
-
* @param {string} appWaitActivity
|
|
37
|
-
*/
|
|
38
|
-
export async function startActivity (
|
|
39
|
-
appPackage, appActivity, appWaitPackage, appWaitActivity
|
|
40
|
-
) {
|
|
41
|
-
// intentAction, intentCategory, intentFlags, optionalIntentArguments, dontStopAppOnReset
|
|
42
|
-
// parameters are not supported by Espresso
|
|
43
|
-
const pkg = /** @type {string} */ (appPackage || this.caps.appPackage);
|
|
44
|
-
const appWaitPkg = /** @type {string} */ (appWaitPackage || pkg);
|
|
45
|
-
const appAct = qualifyActivityName(appActivity, pkg);
|
|
46
|
-
const appWaitAct = qualifyActivityName(appWaitActivity || appAct, appWaitPkg);
|
|
47
|
-
this.log.debug(`Starting activity '${appActivity}' for package '${appPackage}'`);
|
|
48
|
-
await this.espresso.jwproxy.command(`/appium/device/start_activity`, 'POST', {
|
|
49
|
-
appPackage: pkg,
|
|
50
|
-
appActivity: appAct,
|
|
51
|
-
});
|
|
52
|
-
await this.adb.waitForActivity(appWaitPkg, appWaitAct);
|
|
53
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @this {EspressoDriver}
|
|
3
|
-
* @returns {Promise<string>} Base64-encoded content of the clipboard
|
|
4
|
-
* or an empty string if the clipboard is empty.
|
|
5
|
-
*/
|
|
6
|
-
export async function getClipboard () {
|
|
7
|
-
return /** @type {string} */ ((await this.adb.getApiLevel() < 29)
|
|
8
|
-
? (await this.espresso.jwproxy.command('/appium/device/get_clipboard', 'POST', {}))
|
|
9
|
-
: (await this.settingsApp.getClipboard()));
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @this {EspressoDriver}
|
|
14
|
-
* @param {string} content Base64-encoded clipboard payload
|
|
15
|
-
* @param {'plaintext'} [contentType] Only a single
|
|
16
|
-
* content type is supported, which is 'plaintext'
|
|
17
|
-
* @param {string} [label] Optional label to identify the current
|
|
18
|
-
* clipboard payload
|
|
19
|
-
* @returns {Promise<void>}
|
|
20
|
-
*/
|
|
21
|
-
export async function mobileSetClipboard(content, contentType, label) {
|
|
22
|
-
await this.espresso.jwproxy.command(
|
|
23
|
-
'/appium/device/set_clipboard',
|
|
24
|
-
'POST',
|
|
25
|
-
{content, contentType, label}
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @typedef {import('../driver').EspressoDriver} EspressoDriver
|
|
31
|
-
*/
|
package/lib/commands/services.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Starts the given service intent.
|
|
3
|
-
*
|
|
4
|
-
* @this {import('../driver').EspressoDriver}
|
|
5
|
-
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-startservice
|
|
6
|
-
* @param {!string} intent - The name of the service intent to start, for example
|
|
7
|
-
* `com.some.package.name/.YourServiceSubClassName`. This option is mandatory.
|
|
8
|
-
* !!! Only services in the app's under test scope could be started.
|
|
9
|
-
* @param {boolean} [foreground=false] - Set it to `true` if your service must be
|
|
10
|
-
* started as foreground service.
|
|
11
|
-
* @param {string | number} [user]
|
|
12
|
-
* @returns {Promise<string>} The full component name
|
|
13
|
-
* @throws {Error} If there was a failure while starting the service
|
|
14
|
-
* or required options are missing
|
|
15
|
-
*/
|
|
16
|
-
export async function mobileStartService (intent, foreground, user) {
|
|
17
|
-
return /** @type {string} */ (await this.espresso.jwproxy.command(
|
|
18
|
-
'/appium/execute_mobile/start_service', 'POST',
|
|
19
|
-
{intent, foreground, user}
|
|
20
|
-
));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Stops the given service intent.
|
|
25
|
-
*
|
|
26
|
-
* @this {import('../driver').EspressoDriver}
|
|
27
|
-
* @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-stopservice
|
|
28
|
-
* @param {string} intent - The name of the service intent to stop, for example
|
|
29
|
-
* `com.some.package.name/.YourServiceSubClassName`. This option is mandatory.
|
|
30
|
-
* !!! Only services in the app's under test scope could be stopped.
|
|
31
|
-
* @param {string | number} [user]
|
|
32
|
-
* @returns {Promise<string>} `true` if the service has been successfully stopped
|
|
33
|
-
* @throws {Error} If there was a failure while stopping the service
|
|
34
|
-
* or required options are missing
|
|
35
|
-
*/
|
|
36
|
-
export async function mobileStopService (intent, user) {
|
|
37
|
-
return /** @type {string} */ (await this.espresso.jwproxy.command(
|
|
38
|
-
'/appium/execute_mobile/stop_service', 'POST', {intent, user}
|
|
39
|
-
));
|
|
40
|
-
}
|