appium-uiautomator2-driver 6.7.6 → 6.7.8

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 (91) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/lib/commands/actions.d.ts +26 -29
  3. package/build/lib/commands/actions.d.ts.map +1 -1
  4. package/build/lib/commands/actions.js +19 -27
  5. package/build/lib/commands/actions.js.map +1 -1
  6. package/build/lib/commands/alert.d.ts +14 -22
  7. package/build/lib/commands/alert.d.ts.map +1 -1
  8. package/build/lib/commands/alert.js +8 -19
  9. package/build/lib/commands/alert.js.map +1 -1
  10. package/build/lib/commands/app-management.d.ts +7 -10
  11. package/build/lib/commands/app-management.d.ts.map +1 -1
  12. package/build/lib/commands/app-management.js +4 -14
  13. package/build/lib/commands/app-management.js.map +1 -1
  14. package/build/lib/commands/battery.d.ts +4 -5
  15. package/build/lib/commands/battery.d.ts.map +1 -1
  16. package/build/lib/commands/battery.js +4 -9
  17. package/build/lib/commands/battery.js.map +1 -1
  18. package/build/lib/commands/clipboard.d.ts +9 -13
  19. package/build/lib/commands/clipboard.d.ts.map +1 -1
  20. package/build/lib/commands/clipboard.js +7 -14
  21. package/build/lib/commands/clipboard.js.map +1 -1
  22. package/build/lib/commands/element.d.ts +29 -0
  23. package/build/lib/commands/element.d.ts.map +1 -1
  24. package/build/lib/commands/element.js +29 -0
  25. package/build/lib/commands/element.js.map +1 -1
  26. package/build/lib/commands/find.d.ts +13 -9
  27. package/build/lib/commands/find.d.ts.map +1 -1
  28. package/build/lib/commands/find.js +4 -16
  29. package/build/lib/commands/find.js.map +1 -1
  30. package/build/lib/commands/gestures.d.ts +63 -0
  31. package/build/lib/commands/gestures.d.ts.map +1 -1
  32. package/build/lib/commands/gestures.js +63 -0
  33. package/build/lib/commands/gestures.js.map +1 -1
  34. package/build/lib/commands/keyboard.d.ts +30 -41
  35. package/build/lib/commands/keyboard.d.ts.map +1 -1
  36. package/build/lib/commands/keyboard.js +22 -37
  37. package/build/lib/commands/keyboard.js.map +1 -1
  38. package/build/lib/commands/misc.d.ts +4 -0
  39. package/build/lib/commands/misc.d.ts.map +1 -1
  40. package/build/lib/commands/misc.js +4 -0
  41. package/build/lib/commands/misc.js.map +1 -1
  42. package/build/lib/commands/navigation.d.ts +11 -16
  43. package/build/lib/commands/navigation.d.ts.map +1 -1
  44. package/build/lib/commands/navigation.js +9 -17
  45. package/build/lib/commands/navigation.js.map +1 -1
  46. package/build/lib/commands/viewport.d.ts +23 -22
  47. package/build/lib/commands/viewport.d.ts.map +1 -1
  48. package/build/lib/commands/viewport.js +17 -24
  49. package/build/lib/commands/viewport.js.map +1 -1
  50. package/build/lib/doctor/optional-checks.d.ts +4 -4
  51. package/build/lib/doctor/optional-checks.d.ts.map +1 -1
  52. package/build/lib/doctor/optional-checks.js.map +1 -1
  53. package/build/lib/doctor/required-checks.d.ts +5 -21
  54. package/build/lib/doctor/required-checks.d.ts.map +1 -1
  55. package/build/lib/doctor/required-checks.js.map +1 -1
  56. package/build/lib/index.d.ts +4 -0
  57. package/build/lib/index.d.ts.map +1 -0
  58. package/build/{index.js → lib/index.js} +1 -1
  59. package/build/lib/index.js.map +1 -0
  60. package/build/tsconfig.tsbuildinfo +1 -1
  61. package/lib/commands/actions.ts +95 -0
  62. package/lib/commands/alert.ts +46 -0
  63. package/lib/commands/app-management.ts +25 -0
  64. package/lib/commands/battery.ts +19 -0
  65. package/lib/commands/clipboard.ts +29 -0
  66. package/lib/commands/element.ts +29 -0
  67. package/lib/commands/find.ts +48 -0
  68. package/lib/commands/gestures.ts +63 -0
  69. package/lib/commands/keyboard.ts +102 -0
  70. package/lib/commands/misc.ts +4 -0
  71. package/lib/commands/navigation.ts +32 -0
  72. package/lib/commands/viewport.ts +78 -0
  73. package/lib/doctor/optional-checks.ts +7 -0
  74. package/lib/doctor/required-checks.ts +8 -0
  75. package/{index.js → lib/index.ts} +2 -1
  76. package/npm-shrinkwrap.json +2 -2
  77. package/package.json +3 -7
  78. package/build/index.d.ts +0 -4
  79. package/build/index.d.ts.map +0 -1
  80. package/build/index.js.map +0 -1
  81. package/lib/commands/actions.js +0 -107
  82. package/lib/commands/alert.js +0 -63
  83. package/lib/commands/app-management.js +0 -32
  84. package/lib/commands/battery.js +0 -23
  85. package/lib/commands/clipboard.js +0 -37
  86. package/lib/commands/find.js +0 -47
  87. package/lib/commands/keyboard.js +0 -108
  88. package/lib/commands/navigation.js +0 -33
  89. package/lib/commands/viewport.js +0 -100
  90. package/lib/doctor/optional-checks.js +0 -5
  91. package/lib/doctor/required-checks.js +0 -6
@@ -1,100 +0,0 @@
1
-
2
- // memoized in constructor
3
- /**
4
- * @this {AndroidUiautomator2Driver}
5
- * @returns {Promise<number>}
6
- */
7
- export async function getStatusBarHeight() {
8
- const {statusBar} = /** @type {{statusBar: number}} */ (
9
- await /** @type {import('../uiautomator2').UiAutomator2Server} */ (
10
- this.uiautomator2
11
- ).jwproxy.command(`/appium/device/system_bars`, 'GET', {})
12
- );
13
- return statusBar;
14
- }
15
-
16
- // memoized in constructor
17
- /**
18
- * @this {AndroidUiautomator2Driver}
19
- * @returns {Promise<string>}
20
- */
21
- export async function getDevicePixelRatio() {
22
- return String(
23
- await /** @type {import('../uiautomator2').UiAutomator2Server} */ (
24
- this.uiautomator2
25
- ).jwproxy.command('/appium/device/pixel_ratio', 'GET', {})
26
- );
27
- }
28
-
29
- /**
30
- * @this {AndroidUiautomator2Driver}
31
- * @returns {Promise<import('./types').RelativeRect>}
32
- */
33
- export async function getViewPortRect() {
34
- const windowSize = await this.getWindowSize();
35
- const statusBarHeight = await this.getStatusBarHeight();
36
- // android returns the upscaled window size, so to get the true size of the
37
- // rect we have to downscale
38
- return {
39
- left: 0,
40
- top: statusBarHeight,
41
- width: windowSize.width,
42
- height: windowSize.height - statusBarHeight,
43
- };
44
- }
45
-
46
- /**
47
- * Returns the viewport coordinates.
48
- * @this {AndroidUiautomator2Driver}
49
- * @returns {Promise<import('./types').RelativeRect>} The viewport coordinates.
50
- */
51
- export async function mobileViewPortRect() {
52
- return await this.getViewPortRect();
53
- }
54
-
55
- // For W3C
56
- /**
57
- * @this {AndroidUiautomator2Driver}
58
- * @returns {Promise<import('@appium/types').Rect>}
59
- */
60
- export async function getWindowRect() {
61
- const {width, height} = await this.getWindowSize();
62
- return {
63
- width,
64
- height,
65
- x: 0,
66
- y: 0,
67
- };
68
- }
69
-
70
- /**
71
- * @this {AndroidUiautomator2Driver}
72
- * @returns {Promise<number>}
73
- */
74
- export async function getDisplayDensity() {
75
- return /** @type {number} */ (
76
- await this.uiautomator2.jwproxy.command(
77
- '/appium/device/display_density',
78
- 'GET',
79
- {}
80
- )
81
- );
82
- }
83
-
84
- /**
85
- * @this {AndroidUiautomator2Driver}
86
- * @returns {Promise<import('@appium/types').Size>}
87
- */
88
- export async function getWindowSize() {
89
- return /** @type {import('@appium/types').Size} */ (
90
- await this.uiautomator2.jwproxy.command(
91
- '/window/current/size',
92
- 'GET',
93
- {}
94
- )
95
- );
96
- }
97
-
98
- /**
99
- * @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
100
- */
@@ -1,5 +0,0 @@
1
- import { doctor } from 'appium-android-driver';
2
-
3
- export const optionalBundletoolCheck = doctor.optionalBundletoolCheck;
4
- export const optionalGstreamerCheck = doctor.optionalGstreamerCheck;
5
- export const optionalFfmpegCheck = doctor.optionalFfmpegCheck;
@@ -1,6 +0,0 @@
1
- import { doctor } from 'appium-android-driver';
2
-
3
- export const androidHomeCheck = doctor.androidHomeCheck;
4
- export const javaHomeCheck = doctor.javaHomeCheck;
5
- export const javaHomeValueCheck = doctor.javaHomeValueCheck;
6
- export const androidSdkCheck = doctor.androidSdkCheck;