appium-uiautomator2-driver 6.7.5 → 6.7.7

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 (76) 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 +64 -69
  23. package/build/lib/commands/element.d.ts.map +1 -1
  24. package/build/lib/commands/element.js +64 -84
  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 +87 -189
  31. package/build/lib/commands/gestures.d.ts.map +1 -1
  32. package/build/lib/commands/gestures.js +77 -204
  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 +19 -35
  39. package/build/lib/commands/misc.d.ts.map +1 -1
  40. package/build/lib/commands/misc.js +15 -30
  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/tsconfig.tsbuildinfo +1 -1
  51. package/lib/commands/actions.ts +95 -0
  52. package/lib/commands/alert.ts +46 -0
  53. package/lib/commands/app-management.ts +25 -0
  54. package/lib/commands/battery.ts +19 -0
  55. package/lib/commands/clipboard.ts +29 -0
  56. package/lib/commands/element.ts +180 -0
  57. package/lib/commands/find.ts +48 -0
  58. package/lib/commands/gestures.ts +297 -0
  59. package/lib/commands/keyboard.ts +102 -0
  60. package/lib/commands/misc.ts +67 -0
  61. package/lib/commands/navigation.ts +32 -0
  62. package/lib/commands/viewport.ts +78 -0
  63. package/npm-shrinkwrap.json +16 -46
  64. package/package.json +1 -1
  65. package/lib/commands/actions.js +0 -107
  66. package/lib/commands/alert.js +0 -63
  67. package/lib/commands/app-management.js +0 -32
  68. package/lib/commands/battery.js +0 -23
  69. package/lib/commands/clipboard.js +0 -37
  70. package/lib/commands/element.js +0 -261
  71. package/lib/commands/find.js +0 -47
  72. package/lib/commands/gestures.js +0 -446
  73. package/lib/commands/keyboard.js +0 -108
  74. package/lib/commands/misc.js +0 -109
  75. package/lib/commands/navigation.js +0 -33
  76. package/lib/commands/viewport.js +0 -100
@@ -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
- */