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.
Files changed (135) hide show
  1. package/CHANGELOG.md +121 -0
  2. package/build/lib/commands/app-management.d.ts +39 -26
  3. package/build/lib/commands/app-management.d.ts.map +1 -1
  4. package/build/lib/commands/app-management.js +59 -42
  5. package/build/lib/commands/app-management.js.map +1 -1
  6. package/build/lib/commands/appearance.d.ts +10 -4
  7. package/build/lib/commands/appearance.d.ts.map +1 -1
  8. package/build/lib/commands/appearance.js +10 -7
  9. package/build/lib/commands/appearance.js.map +1 -1
  10. package/build/lib/commands/bluetooth.d.ts +2 -2
  11. package/build/lib/commands/bluetooth.d.ts.map +1 -1
  12. package/build/lib/commands/bluetooth.js +2 -3
  13. package/build/lib/commands/bluetooth.js.map +1 -1
  14. package/build/lib/commands/context/exports.d.ts +2 -2
  15. package/build/lib/commands/context/exports.d.ts.map +1 -1
  16. package/build/lib/commands/context/exports.js +3 -3
  17. package/build/lib/commands/context/exports.js.map +1 -1
  18. package/build/lib/commands/device/emulator-actions.d.ts +25 -18
  19. package/build/lib/commands/device/emulator-actions.d.ts.map +1 -1
  20. package/build/lib/commands/device/emulator-actions.js +38 -40
  21. package/build/lib/commands/device/emulator-actions.js.map +1 -1
  22. package/build/lib/commands/device/emulator-console.d.ts +9 -2
  23. package/build/lib/commands/device/emulator-console.d.ts.map +1 -1
  24. package/build/lib/commands/device/emulator-console.js +9 -3
  25. package/build/lib/commands/device/emulator-console.js.map +1 -1
  26. package/build/lib/commands/deviceidle.d.ts +3 -2
  27. package/build/lib/commands/deviceidle.d.ts.map +1 -1
  28. package/build/lib/commands/deviceidle.js +3 -3
  29. package/build/lib/commands/deviceidle.js.map +1 -1
  30. package/build/lib/commands/execute.d.ts +6 -15
  31. package/build/lib/commands/execute.d.ts.map +1 -1
  32. package/build/lib/commands/execute.js +36 -93
  33. package/build/lib/commands/execute.js.map +1 -1
  34. package/build/lib/commands/file-actions.d.ts +13 -24
  35. package/build/lib/commands/file-actions.d.ts.map +1 -1
  36. package/build/lib/commands/file-actions.js +13 -38
  37. package/build/lib/commands/file-actions.js.map +1 -1
  38. package/build/lib/commands/geolocation.d.ts +9 -4
  39. package/build/lib/commands/geolocation.d.ts.map +1 -1
  40. package/build/lib/commands/geolocation.js +14 -6
  41. package/build/lib/commands/geolocation.js.map +1 -1
  42. package/build/lib/commands/image-injection.d.ts +2 -2
  43. package/build/lib/commands/image-injection.d.ts.map +1 -1
  44. package/build/lib/commands/image-injection.js +2 -3
  45. package/build/lib/commands/image-injection.js.map +1 -1
  46. package/build/lib/commands/intent.d.ts +70 -8
  47. package/build/lib/commands/intent.d.ts.map +1 -1
  48. package/build/lib/commands/intent.js +118 -16
  49. package/build/lib/commands/intent.js.map +1 -1
  50. package/build/lib/commands/keyboard.d.ts +2 -2
  51. package/build/lib/commands/keyboard.d.ts.map +1 -1
  52. package/build/lib/commands/keyboard.js +2 -4
  53. package/build/lib/commands/keyboard.js.map +1 -1
  54. package/build/lib/commands/lock/exports.d.ts +12 -8
  55. package/build/lib/commands/lock/exports.d.ts.map +1 -1
  56. package/build/lib/commands/lock/exports.js +12 -13
  57. package/build/lib/commands/lock/exports.js.map +1 -1
  58. package/build/lib/commands/media-projection.d.ts +41 -4
  59. package/build/lib/commands/media-projection.d.ts.map +1 -1
  60. package/build/lib/commands/media-projection.js +52 -11
  61. package/build/lib/commands/media-projection.js.map +1 -1
  62. package/build/lib/commands/memory.d.ts +4 -2
  63. package/build/lib/commands/memory.d.ts.map +1 -1
  64. package/build/lib/commands/memory.js +4 -3
  65. package/build/lib/commands/memory.js.map +1 -1
  66. package/build/lib/commands/network.d.ts +10 -4
  67. package/build/lib/commands/network.d.ts.map +1 -1
  68. package/build/lib/commands/network.js +17 -14
  69. package/build/lib/commands/network.js.map +1 -1
  70. package/build/lib/commands/nfc.d.ts +2 -2
  71. package/build/lib/commands/nfc.d.ts.map +1 -1
  72. package/build/lib/commands/nfc.js +2 -3
  73. package/build/lib/commands/nfc.js.map +1 -1
  74. package/build/lib/commands/performance.d.ts +3 -2
  75. package/build/lib/commands/performance.d.ts.map +1 -1
  76. package/build/lib/commands/performance.js +3 -4
  77. package/build/lib/commands/performance.js.map +1 -1
  78. package/build/lib/commands/permissions.d.ts +23 -5
  79. package/build/lib/commands/permissions.d.ts.map +1 -1
  80. package/build/lib/commands/permissions.js +27 -8
  81. package/build/lib/commands/permissions.js.map +1 -1
  82. package/build/lib/commands/shell.d.ts +3 -9
  83. package/build/lib/commands/shell.d.ts.map +1 -1
  84. package/build/lib/commands/shell.js +3 -10
  85. package/build/lib/commands/shell.js.map +1 -1
  86. package/build/lib/commands/streamscreen.d.ts +56 -6
  87. package/build/lib/commands/streamscreen.d.ts.map +1 -1
  88. package/build/lib/commands/streamscreen.js +28 -4
  89. package/build/lib/commands/streamscreen.js.map +1 -1
  90. package/build/lib/commands/system-bars.d.ts +6 -2
  91. package/build/lib/commands/system-bars.d.ts.map +1 -1
  92. package/build/lib/commands/system-bars.js +7 -7
  93. package/build/lib/commands/system-bars.js.map +1 -1
  94. package/build/lib/commands/time.d.ts +2 -2
  95. package/build/lib/commands/time.d.ts.map +1 -1
  96. package/build/lib/commands/time.js +3 -3
  97. package/build/lib/commands/time.js.map +1 -1
  98. package/build/lib/commands/types.d.ts +0 -588
  99. package/build/lib/commands/types.d.ts.map +1 -1
  100. package/build/lib/driver.d.ts +364 -12
  101. package/build/lib/driver.d.ts.map +1 -1
  102. package/build/lib/driver.js +2 -8
  103. package/build/lib/driver.js.map +1 -1
  104. package/build/lib/execute-method-map.d.ts +361 -0
  105. package/build/lib/execute-method-map.d.ts.map +1 -0
  106. package/build/lib/execute-method-map.js +437 -0
  107. package/build/lib/execute-method-map.js.map +1 -0
  108. package/lib/commands/app-management.js +68 -42
  109. package/lib/commands/appearance.js +10 -8
  110. package/lib/commands/bluetooth.js +2 -3
  111. package/lib/commands/context/exports.js +3 -3
  112. package/lib/commands/device/emulator-actions.js +28 -30
  113. package/lib/commands/device/emulator-console.js +9 -4
  114. package/lib/commands/deviceidle.js +3 -4
  115. package/lib/commands/execute.js +42 -124
  116. package/lib/commands/file-actions.js +13 -38
  117. package/lib/commands/geolocation.js +14 -6
  118. package/lib/commands/image-injection.js +2 -3
  119. package/lib/commands/intent.js +174 -16
  120. package/lib/commands/keyboard.js +2 -4
  121. package/lib/commands/lock/exports.js +12 -13
  122. package/lib/commands/media-projection.js +62 -11
  123. package/lib/commands/memory.js +4 -4
  124. package/lib/commands/network.js +14 -10
  125. package/lib/commands/nfc.js +2 -3
  126. package/lib/commands/performance.js +3 -4
  127. package/lib/commands/permissions.js +33 -14
  128. package/lib/commands/{shell.js → shell.ts} +8 -11
  129. package/lib/commands/streamscreen.js +39 -15
  130. package/lib/commands/system-bars.js +7 -9
  131. package/lib/commands/time.js +3 -3
  132. package/lib/commands/types.ts +0 -646
  133. package/lib/driver.ts +4 -16
  134. package/lib/execute-method-map.ts +464 -0
  135. 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 {import('./types').StartScreenStreamingOpts} [options={}]
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(options = {}) {
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').StatusBarCommandOpts} opts
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(opts) {
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']],
@@ -24,11 +24,11 @@ export async function getDeviceTime(format = MOMENT_FORMAT_ISO8601) {
24
24
 
25
25
  /**
26
26
  * @this {AndroidDriver}
27
- * @param {import('./types').DeviceTimeOpts} [opts={}]
27
+ * @param {string} [format='YYYY-MM-DDTHH:mm:ssZ']
28
28
  * @returns {Promise<string>}
29
29
  */
30
- export async function mobileGetDeviceTime(opts = {}) {
31
- return await this.getDeviceTime(opts.format);
30
+ export async function mobileGetDeviceTime(format) {
31
+ return await this.getDeviceTime(format);
32
32
  }
33
33
 
34
34
  /**