appium-android-driver 9.15.0 → 10.0.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 +121 -0
- package/build/lib/commands/app-management.d.ts +39 -26
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js +59 -42
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/appearance.d.ts +10 -4
- package/build/lib/commands/appearance.d.ts.map +1 -1
- package/build/lib/commands/appearance.js +10 -7
- package/build/lib/commands/appearance.js.map +1 -1
- package/build/lib/commands/bluetooth.d.ts +2 -2
- package/build/lib/commands/bluetooth.d.ts.map +1 -1
- package/build/lib/commands/bluetooth.js +2 -3
- package/build/lib/commands/bluetooth.js.map +1 -1
- package/build/lib/commands/context/exports.d.ts +2 -2
- package/build/lib/commands/context/exports.d.ts.map +1 -1
- package/build/lib/commands/context/exports.js +3 -3
- package/build/lib/commands/context/exports.js.map +1 -1
- package/build/lib/commands/device/emulator-actions.d.ts +25 -18
- package/build/lib/commands/device/emulator-actions.d.ts.map +1 -1
- package/build/lib/commands/device/emulator-actions.js +38 -40
- package/build/lib/commands/device/emulator-actions.js.map +1 -1
- package/build/lib/commands/device/emulator-console.d.ts +9 -2
- package/build/lib/commands/device/emulator-console.d.ts.map +1 -1
- package/build/lib/commands/device/emulator-console.js +9 -3
- package/build/lib/commands/device/emulator-console.js.map +1 -1
- package/build/lib/commands/deviceidle.d.ts +3 -2
- package/build/lib/commands/deviceidle.d.ts.map +1 -1
- package/build/lib/commands/deviceidle.js +3 -3
- package/build/lib/commands/deviceidle.js.map +1 -1
- package/build/lib/commands/execute.d.ts +6 -15
- package/build/lib/commands/execute.d.ts.map +1 -1
- package/build/lib/commands/execute.js +36 -93
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/file-actions.d.ts +13 -24
- package/build/lib/commands/file-actions.d.ts.map +1 -1
- package/build/lib/commands/file-actions.js +13 -38
- package/build/lib/commands/file-actions.js.map +1 -1
- package/build/lib/commands/geolocation.d.ts +9 -4
- package/build/lib/commands/geolocation.d.ts.map +1 -1
- package/build/lib/commands/geolocation.js +14 -6
- package/build/lib/commands/geolocation.js.map +1 -1
- package/build/lib/commands/image-injection.d.ts +2 -2
- package/build/lib/commands/image-injection.d.ts.map +1 -1
- package/build/lib/commands/image-injection.js +2 -3
- package/build/lib/commands/image-injection.js.map +1 -1
- package/build/lib/commands/intent.d.ts +70 -8
- package/build/lib/commands/intent.d.ts.map +1 -1
- package/build/lib/commands/intent.js +118 -16
- package/build/lib/commands/intent.js.map +1 -1
- package/build/lib/commands/keyboard.d.ts +2 -2
- package/build/lib/commands/keyboard.d.ts.map +1 -1
- package/build/lib/commands/keyboard.js +2 -4
- package/build/lib/commands/keyboard.js.map +1 -1
- package/build/lib/commands/lock/exports.d.ts +12 -8
- package/build/lib/commands/lock/exports.d.ts.map +1 -1
- package/build/lib/commands/lock/exports.js +12 -13
- package/build/lib/commands/lock/exports.js.map +1 -1
- package/build/lib/commands/media-projection.d.ts +41 -4
- package/build/lib/commands/media-projection.d.ts.map +1 -1
- package/build/lib/commands/media-projection.js +52 -11
- package/build/lib/commands/media-projection.js.map +1 -1
- package/build/lib/commands/memory.d.ts +4 -2
- package/build/lib/commands/memory.d.ts.map +1 -1
- package/build/lib/commands/memory.js +4 -3
- package/build/lib/commands/memory.js.map +1 -1
- package/build/lib/commands/network.d.ts +10 -4
- package/build/lib/commands/network.d.ts.map +1 -1
- package/build/lib/commands/network.js +17 -14
- package/build/lib/commands/network.js.map +1 -1
- package/build/lib/commands/nfc.d.ts +2 -2
- package/build/lib/commands/nfc.d.ts.map +1 -1
- package/build/lib/commands/nfc.js +2 -3
- package/build/lib/commands/nfc.js.map +1 -1
- package/build/lib/commands/performance.d.ts +3 -2
- package/build/lib/commands/performance.d.ts.map +1 -1
- package/build/lib/commands/performance.js +3 -4
- package/build/lib/commands/performance.js.map +1 -1
- package/build/lib/commands/permissions.d.ts +23 -5
- package/build/lib/commands/permissions.d.ts.map +1 -1
- package/build/lib/commands/permissions.js +27 -8
- package/build/lib/commands/permissions.js.map +1 -1
- package/build/lib/commands/shell.d.ts +3 -9
- package/build/lib/commands/shell.d.ts.map +1 -1
- package/build/lib/commands/shell.js +3 -10
- package/build/lib/commands/shell.js.map +1 -1
- package/build/lib/commands/streamscreen.d.ts +56 -6
- package/build/lib/commands/streamscreen.d.ts.map +1 -1
- package/build/lib/commands/streamscreen.js +28 -4
- package/build/lib/commands/streamscreen.js.map +1 -1
- package/build/lib/commands/system-bars.d.ts +6 -2
- package/build/lib/commands/system-bars.d.ts.map +1 -1
- package/build/lib/commands/system-bars.js +7 -7
- package/build/lib/commands/system-bars.js.map +1 -1
- package/build/lib/commands/time.d.ts +2 -2
- package/build/lib/commands/time.d.ts.map +1 -1
- package/build/lib/commands/time.js +3 -3
- package/build/lib/commands/time.js.map +1 -1
- package/build/lib/commands/types.d.ts +0 -588
- package/build/lib/commands/types.d.ts.map +1 -1
- package/build/lib/driver.d.ts +364 -12
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +2 -8
- package/build/lib/driver.js.map +1 -1
- package/build/lib/execute-method-map.d.ts +361 -0
- package/build/lib/execute-method-map.d.ts.map +1 -0
- package/build/lib/execute-method-map.js +437 -0
- package/build/lib/execute-method-map.js.map +1 -0
- package/lib/commands/app-management.js +68 -42
- package/lib/commands/appearance.js +10 -8
- package/lib/commands/bluetooth.js +2 -3
- package/lib/commands/context/exports.js +3 -3
- package/lib/commands/device/emulator-actions.js +28 -30
- package/lib/commands/device/emulator-console.js +9 -4
- package/lib/commands/deviceidle.js +3 -4
- package/lib/commands/execute.js +42 -124
- package/lib/commands/file-actions.js +13 -38
- package/lib/commands/geolocation.js +14 -6
- package/lib/commands/image-injection.js +2 -3
- package/lib/commands/intent.js +174 -16
- package/lib/commands/keyboard.js +2 -4
- package/lib/commands/lock/exports.js +12 -13
- package/lib/commands/media-projection.js +62 -11
- package/lib/commands/memory.js +4 -4
- package/lib/commands/network.js +14 -10
- package/lib/commands/nfc.js +2 -3
- package/lib/commands/performance.js +3 -4
- package/lib/commands/permissions.js +33 -14
- package/lib/commands/{shell.js → shell.ts} +8 -11
- package/lib/commands/streamscreen.js +39 -15
- package/lib/commands/system-bars.js +7 -9
- package/lib/commands/time.js +3 -3
- package/lib/commands/types.ts +0 -646
- package/lib/driver.ts +4 -16
- package/lib/execute-method-map.ts +464 -0
- package/package.json +2 -2
|
@@ -35,24 +35,48 @@ const ADB_SCREEN_STREAMING_FEATURE = 'adb_screen_streaming';
|
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* @this {import('../driver').AndroidDriver}
|
|
38
|
-
* @param {
|
|
38
|
+
* @param {number} [width] The scaled width of the device's screen.
|
|
39
|
+
* If unset then the script will assign it to the actual screen width measured
|
|
40
|
+
* in pixels.
|
|
41
|
+
* @param {number} [height] The scaled height of the device's screen.
|
|
42
|
+
* If unset then the script will assign it to the actual screen height
|
|
43
|
+
* measured in pixels.
|
|
44
|
+
* @param {number} [bitRate=4000000] The video bit rate for the video, in bits per second.
|
|
45
|
+
* The default value is 4 Mb/s. You can increase the bit rate to improve video
|
|
46
|
+
* quality, but doing so results in larger movie files.
|
|
47
|
+
* @param {string} [host='127.0.0.1'] The IP address/host name to start the MJPEG server on.
|
|
48
|
+
* You can set it to `0.0.0.0` to trigger the broadcast on all available
|
|
49
|
+
* network interfaces.
|
|
50
|
+
* @param {number} [port=8093] The port number to start the MJPEG server on.
|
|
51
|
+
* @param {number} [tcpPort=8094] The port number to start the internal TCP MJPEG broadcast on.
|
|
52
|
+
* @param {string} [pathname] The HTTP request path the MJPEG server should be available on.
|
|
53
|
+
* If unset, then any pathname on the given `host`/`port` combination will
|
|
54
|
+
* work. Note that the value should always start with a single slash: `/`
|
|
55
|
+
* @param {number} [quality=70] The quality value for the streamed JPEG images.
|
|
56
|
+
* This number should be in range `[1,100]`, where `100` is the best quality.
|
|
57
|
+
* @param {boolean} [considerRotation=false] If set to `true` then GStreamer pipeline will increase the dimensions of
|
|
58
|
+
* the resulting images to properly fit images in both landscape and portrait
|
|
59
|
+
* orientations.
|
|
60
|
+
* Set it to `true` if the device rotation is not going to be the same during
|
|
61
|
+
* the broadcasting session.
|
|
62
|
+
* @param {boolean} [logPipelineDetails=false] Whether to log GStreamer pipeline events into the standard log output.
|
|
63
|
+
* Might be useful for debugging purposes.
|
|
39
64
|
* @returns {Promise<void>}
|
|
40
|
-
|
|
41
|
-
export async function mobileStartScreenStreaming(
|
|
65
|
+
*/
|
|
66
|
+
export async function mobileStartScreenStreaming(
|
|
67
|
+
width,
|
|
68
|
+
height,
|
|
69
|
+
bitRate,
|
|
70
|
+
host = DEFAULT_HOST,
|
|
71
|
+
port = DEFAULT_PORT,
|
|
72
|
+
pathname,
|
|
73
|
+
tcpPort = DEFAULT_PORT + 1,
|
|
74
|
+
quality = DEFAULT_QUALITY,
|
|
75
|
+
considerRotation = false,
|
|
76
|
+
logPipelineDetails = false,
|
|
77
|
+
) {
|
|
42
78
|
this.assertFeatureEnabled(ADB_SCREEN_STREAMING_FEATURE);
|
|
43
79
|
|
|
44
|
-
const {
|
|
45
|
-
width,
|
|
46
|
-
height,
|
|
47
|
-
bitRate,
|
|
48
|
-
host = DEFAULT_HOST,
|
|
49
|
-
port = DEFAULT_PORT,
|
|
50
|
-
pathname,
|
|
51
|
-
tcpPort = DEFAULT_PORT + 1,
|
|
52
|
-
quality = DEFAULT_QUALITY,
|
|
53
|
-
considerRotation = false,
|
|
54
|
-
logPipelineDetails = false,
|
|
55
|
-
} = options;
|
|
56
80
|
if (_.isUndefined(this._screenStreamingProps)) {
|
|
57
81
|
await verifyStreamingRequirements(this.adb);
|
|
58
82
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
1
|
import {errors} from 'appium/driver';
|
|
4
2
|
import _ from 'lodash';
|
|
5
|
-
import {requireArgs} from '../utils';
|
|
6
3
|
|
|
7
4
|
const WINDOW_TITLE_PATTERN = /^\s+Window\s#\d+\sWindow\{[0-9a-f]+\s\w+\s([\w-]+)\}:$/;
|
|
8
5
|
const FRAME_PATTERN = /\bm?[Ff]rame=\[([0-9.-]+),([0-9.-]+)\]\[([0-9.-]+),([0-9.-]+)\]/;
|
|
@@ -38,12 +35,14 @@ export async function getSystemBars() {
|
|
|
38
35
|
|
|
39
36
|
/**
|
|
40
37
|
* @this {import('../driver').AndroidDriver}
|
|
41
|
-
* @param {import('./types').
|
|
38
|
+
* @param {import('./types').StatusBarCommand} command Each list
|
|
39
|
+
* item must separated with a new line (`\n`) character.
|
|
40
|
+
* @param {string} [component] The name of the tile component.
|
|
41
|
+
* It is only required for `(add|remove|click)Tile` commands.
|
|
42
|
+
* Example value: `com.package.name/.service.QuickSettingsTileComponent`
|
|
42
43
|
* @returns {Promise<string>}
|
|
43
44
|
*/
|
|
44
|
-
export async function mobilePerformStatusBarCommand(
|
|
45
|
-
const {command} = requireArgs('command', opts);
|
|
46
|
-
|
|
45
|
+
export async function mobilePerformStatusBarCommand(command, component) {
|
|
47
46
|
/**
|
|
48
47
|
*
|
|
49
48
|
* @param {string} cmd
|
|
@@ -57,8 +56,7 @@ export async function mobilePerformStatusBarCommand(opts) {
|
|
|
57
56
|
cmd,
|
|
58
57
|
...(argsCallable ? _.castArray(argsCallable()) : []),
|
|
59
58
|
]);
|
|
60
|
-
const tileCommandArgsCallable = () =>
|
|
61
|
-
/** @type {string} */ (requireArgs('component', opts).component);
|
|
59
|
+
const tileCommandArgsCallable = () => /** @type {string} */ (component);
|
|
62
60
|
const statusBarCommands = _.fromPairs(
|
|
63
61
|
/** @type {const} */ ([
|
|
64
62
|
['expandNotifications', ['expand-notifications']],
|
package/lib/commands/time.js
CHANGED
|
@@ -24,11 +24,11 @@ export async function getDeviceTime(format = MOMENT_FORMAT_ISO8601) {
|
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* @this {AndroidDriver}
|
|
27
|
-
* @param {
|
|
27
|
+
* @param {string} [format='YYYY-MM-DDTHH:mm:ssZ']
|
|
28
28
|
* @returns {Promise<string>}
|
|
29
29
|
*/
|
|
30
|
-
export async function mobileGetDeviceTime(
|
|
31
|
-
return await this.getDeviceTime(
|
|
30
|
+
export async function mobileGetDeviceTime(format) {
|
|
31
|
+
return await this.getDeviceTime(format);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/**
|