appium-android-driver 5.14.7 → 6.0.1

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 (210) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/build/lib/commands/actions.d.ts +6 -224
  3. package/build/lib/commands/actions.d.ts.map +1 -1
  4. package/build/lib/commands/actions.js +306 -405
  5. package/build/lib/commands/actions.js.map +1 -1
  6. package/build/lib/commands/alert.d.ts +7 -9
  7. package/build/lib/commands/alert.d.ts.map +1 -1
  8. package/build/lib/commands/alert.js +24 -18
  9. package/build/lib/commands/alert.js.map +1 -1
  10. package/build/lib/commands/app-management.d.ts +7 -313
  11. package/build/lib/commands/app-management.d.ts.map +1 -1
  12. package/build/lib/commands/app-management.js +135 -293
  13. package/build/lib/commands/app-management.js.map +1 -1
  14. package/build/lib/commands/context.d.ts +8 -92
  15. package/build/lib/commands/context.d.ts.map +1 -1
  16. package/build/lib/commands/context.js +381 -439
  17. package/build/lib/commands/context.js.map +1 -1
  18. package/build/lib/commands/element.d.ts +8 -35
  19. package/build/lib/commands/element.d.ts.map +1 -1
  20. package/build/lib/commands/element.js +153 -136
  21. package/build/lib/commands/element.js.map +1 -1
  22. package/build/lib/commands/emu-console.d.ts +6 -48
  23. package/build/lib/commands/emu-console.d.ts.map +1 -1
  24. package/build/lib/commands/emu-console.js +19 -34
  25. package/build/lib/commands/emu-console.js.map +1 -1
  26. package/build/lib/commands/execute.d.ts +6 -5
  27. package/build/lib/commands/execute.d.ts.map +1 -1
  28. package/build/lib/commands/execute.js +77 -66
  29. package/build/lib/commands/execute.js.map +1 -1
  30. package/build/lib/commands/file-actions.d.ts +7 -128
  31. package/build/lib/commands/file-actions.d.ts.map +1 -1
  32. package/build/lib/commands/file-actions.js +183 -219
  33. package/build/lib/commands/file-actions.js.map +1 -1
  34. package/build/lib/commands/find.d.ts +8 -12
  35. package/build/lib/commands/find.d.ts.map +1 -1
  36. package/build/lib/commands/find.js +19 -23
  37. package/build/lib/commands/find.js.map +1 -1
  38. package/build/lib/commands/general.d.ts +9 -132
  39. package/build/lib/commands/general.d.ts.map +1 -1
  40. package/build/lib/commands/general.js +281 -312
  41. package/build/lib/commands/general.js.map +1 -1
  42. package/build/lib/commands/ime.d.ts +7 -10
  43. package/build/lib/commands/ime.d.ts.map +1 -1
  44. package/build/lib/commands/ime.js +47 -35
  45. package/build/lib/commands/ime.js.map +1 -1
  46. package/build/lib/commands/index.d.ts +27 -2
  47. package/build/lib/commands/index.d.ts.map +1 -1
  48. package/build/lib/commands/index.js +41 -19
  49. package/build/lib/commands/index.js.map +1 -1
  50. package/build/lib/commands/intent.d.ts +7 -417
  51. package/build/lib/commands/intent.d.ts.map +1 -1
  52. package/build/lib/commands/intent.js +104 -216
  53. package/build/lib/commands/intent.js.map +1 -1
  54. package/build/lib/commands/keyboard.d.ts +6 -5
  55. package/build/lib/commands/keyboard.d.ts.map +1 -1
  56. package/build/lib/commands/keyboard.js +16 -8
  57. package/build/lib/commands/keyboard.js.map +1 -1
  58. package/build/lib/commands/log.d.ts +7 -44
  59. package/build/lib/commands/log.d.ts.map +1 -1
  60. package/build/lib/commands/log.js +146 -108
  61. package/build/lib/commands/log.js.map +1 -1
  62. package/build/lib/commands/media-projection.d.ts +7 -143
  63. package/build/lib/commands/media-projection.d.ts.map +1 -1
  64. package/build/lib/commands/media-projection.js +113 -140
  65. package/build/lib/commands/media-projection.js.map +1 -1
  66. package/build/lib/commands/mixins.d.ts +740 -0
  67. package/build/lib/commands/mixins.d.ts.map +1 -0
  68. package/build/lib/commands/mixins.js +19 -0
  69. package/build/lib/commands/mixins.js.map +1 -0
  70. package/build/lib/commands/network.d.ts +7 -138
  71. package/build/lib/commands/network.d.ts.map +1 -1
  72. package/build/lib/commands/network.js +212 -254
  73. package/build/lib/commands/network.js.map +1 -1
  74. package/build/lib/commands/performance.d.ts +24 -70
  75. package/build/lib/commands/performance.d.ts.map +1 -1
  76. package/build/lib/commands/performance.js +144 -100
  77. package/build/lib/commands/performance.js.map +1 -1
  78. package/build/lib/commands/permissions.d.ts +8 -92
  79. package/build/lib/commands/permissions.d.ts.map +1 -1
  80. package/build/lib/commands/permissions.js +75 -87
  81. package/build/lib/commands/permissions.js.map +1 -1
  82. package/build/lib/commands/recordscreen.d.ts +7 -193
  83. package/build/lib/commands/recordscreen.d.ts.map +1 -1
  84. package/build/lib/commands/recordscreen.js +151 -182
  85. package/build/lib/commands/recordscreen.js.map +1 -1
  86. package/build/lib/commands/shell.d.ts +7 -7
  87. package/build/lib/commands/shell.d.ts.map +1 -1
  88. package/build/lib/commands/shell.js +40 -33
  89. package/build/lib/commands/shell.js.map +1 -1
  90. package/build/lib/commands/streamscreen.d.ts +9 -103
  91. package/build/lib/commands/streamscreen.d.ts.map +1 -1
  92. package/build/lib/commands/streamscreen.js +261 -218
  93. package/build/lib/commands/streamscreen.js.map +1 -1
  94. package/build/lib/commands/system-bars.d.ts +22 -90
  95. package/build/lib/commands/system-bars.d.ts.map +1 -1
  96. package/build/lib/commands/system-bars.js +76 -74
  97. package/build/lib/commands/system-bars.js.map +1 -1
  98. package/build/lib/commands/touch.d.ts +10 -29
  99. package/build/lib/commands/touch.d.ts.map +1 -1
  100. package/build/lib/commands/touch.js +301 -285
  101. package/build/lib/commands/touch.js.map +1 -1
  102. package/build/lib/commands/types.d.ts +978 -0
  103. package/build/lib/commands/types.d.ts.map +1 -0
  104. package/build/lib/commands/types.js +3 -0
  105. package/build/lib/commands/types.js.map +1 -0
  106. package/build/lib/constraints.d.ts +291 -0
  107. package/build/lib/constraints.d.ts.map +1 -0
  108. package/build/lib/{desired-caps.js → constraints.js} +103 -102
  109. package/build/lib/constraints.js.map +1 -0
  110. package/build/lib/driver.d.ts +68 -37
  111. package/build/lib/driver.d.ts.map +1 -1
  112. package/build/lib/driver.js +123 -80
  113. package/build/lib/driver.js.map +1 -1
  114. package/build/lib/helpers/android.d.ts +164 -0
  115. package/build/lib/helpers/android.d.ts.map +1 -0
  116. package/build/lib/helpers/android.js +819 -0
  117. package/build/lib/helpers/android.js.map +1 -0
  118. package/build/lib/helpers/index.d.ts +7 -0
  119. package/build/lib/helpers/index.d.ts.map +1 -0
  120. package/build/lib/helpers/index.js +29 -0
  121. package/build/lib/helpers/index.js.map +1 -0
  122. package/build/lib/helpers/types.d.ts +121 -0
  123. package/build/lib/helpers/types.d.ts.map +1 -0
  124. package/build/lib/helpers/types.js +3 -0
  125. package/build/lib/helpers/types.js.map +1 -0
  126. package/build/lib/helpers/unlock.d.ts +32 -0
  127. package/build/lib/helpers/unlock.d.ts.map +1 -0
  128. package/build/lib/helpers/unlock.js +273 -0
  129. package/build/lib/helpers/unlock.js.map +1 -0
  130. package/build/lib/helpers/webview.d.ts +74 -0
  131. package/build/lib/helpers/webview.d.ts.map +1 -0
  132. package/build/lib/helpers/webview.js +421 -0
  133. package/build/lib/helpers/webview.js.map +1 -0
  134. package/build/lib/index.d.ts +9 -0
  135. package/build/lib/index.d.ts.map +1 -0
  136. package/build/lib/index.js +37 -0
  137. package/build/lib/index.js.map +1 -0
  138. package/build/lib/method-map.d.ts +0 -8
  139. package/build/lib/method-map.d.ts.map +1 -1
  140. package/build/lib/method-map.js +63 -74
  141. package/build/lib/method-map.js.map +1 -1
  142. package/build/lib/stubs.d.ts +0 -1
  143. package/build/lib/stubs.d.ts.map +1 -1
  144. package/build/lib/stubs.js +1 -0
  145. package/build/lib/stubs.js.map +1 -1
  146. package/build/lib/utils.d.ts +1 -1
  147. package/build/lib/utils.d.ts.map +1 -1
  148. package/lib/commands/actions.js +351 -464
  149. package/lib/commands/alert.js +27 -17
  150. package/lib/commands/app-management.js +156 -314
  151. package/lib/commands/context.js +457 -441
  152. package/lib/commands/element.js +201 -157
  153. package/lib/commands/emu-console.js +25 -45
  154. package/lib/commands/execute.js +106 -90
  155. package/lib/commands/file-actions.js +222 -240
  156. package/lib/commands/find.ts +103 -0
  157. package/lib/commands/general.js +327 -339
  158. package/lib/commands/ime.js +50 -34
  159. package/lib/commands/{index.js → index.ts} +20 -24
  160. package/lib/commands/intent.js +108 -249
  161. package/lib/commands/keyboard.js +20 -8
  162. package/lib/commands/log.js +172 -116
  163. package/lib/commands/media-projection.js +134 -161
  164. package/lib/commands/mixins.ts +966 -0
  165. package/lib/commands/network.js +252 -281
  166. package/lib/commands/performance.js +203 -132
  167. package/lib/commands/permissions.js +108 -109
  168. package/lib/commands/recordscreen.js +212 -209
  169. package/lib/commands/shell.js +51 -40
  170. package/lib/commands/streamscreen.js +355 -289
  171. package/lib/commands/system-bars.js +92 -83
  172. package/lib/commands/touch.js +357 -294
  173. package/lib/commands/types.ts +1097 -0
  174. package/lib/{desired-caps.js → constraints.ts} +106 -103
  175. package/lib/{driver.js → driver.ts} +278 -132
  176. package/lib/helpers/android.ts +1143 -0
  177. package/lib/helpers/index.ts +6 -0
  178. package/lib/helpers/types.ts +134 -0
  179. package/lib/helpers/unlock.ts +329 -0
  180. package/lib/helpers/webview.ts +582 -0
  181. package/lib/index.ts +18 -0
  182. package/lib/method-map.js +87 -98
  183. package/lib/stubs.ts +0 -1
  184. package/package.json +26 -19
  185. package/build/index.js +0 -51
  186. package/build/lib/android-helpers.d.ts +0 -136
  187. package/build/lib/android-helpers.d.ts.map +0 -1
  188. package/build/lib/android-helpers.js +0 -855
  189. package/build/lib/android-helpers.js.map +0 -1
  190. package/build/lib/commands/coverage.d.ts +0 -5
  191. package/build/lib/commands/coverage.d.ts.map +0 -1
  192. package/build/lib/commands/coverage.js +0 -19
  193. package/build/lib/commands/coverage.js.map +0 -1
  194. package/build/lib/desired-caps.d.ts +0 -353
  195. package/build/lib/desired-caps.d.ts.map +0 -1
  196. package/build/lib/desired-caps.js.map +0 -1
  197. package/build/lib/unlock-helpers.d.ts +0 -38
  198. package/build/lib/unlock-helpers.d.ts.map +0 -1
  199. package/build/lib/unlock-helpers.js +0 -266
  200. package/build/lib/unlock-helpers.js.map +0 -1
  201. package/build/lib/webview-helpers.d.ts +0 -224
  202. package/build/lib/webview-helpers.d.ts.map +0 -1
  203. package/build/lib/webview-helpers.js +0 -528
  204. package/build/lib/webview-helpers.js.map +0 -1
  205. package/index.js +0 -24
  206. package/lib/android-helpers.js +0 -983
  207. package/lib/commands/coverage.js +0 -18
  208. package/lib/commands/find.js +0 -82
  209. package/lib/unlock-helpers.js +0 -278
  210. package/lib/webview-helpers.js +0 -602
package/lib/method-map.js CHANGED
@@ -1,169 +1,164 @@
1
1
  export const newMethodMap = /** @type {const} */ ({
2
2
  '/session/:sessionId/timeouts/implicit_wait': {
3
- POST: { command: 'implicitWait', payloadParams: { required: ['ms'] } }
3
+ POST: {command: 'implicitWait', payloadParams: {required: ['ms']}},
4
4
  },
5
- '/session/:sessionId/ime/available_engines': { GET: { command: 'availableIMEEngines' } },
6
- '/session/:sessionId/ime/active_engine': { GET: { command: 'getActiveIMEEngine' } },
7
- '/session/:sessionId/ime/activated': { GET: { command: 'isIMEActivated' } },
8
- '/session/:sessionId/ime/deactivate': { POST: { command: 'deactivateIMEEngine' } },
5
+ '/session/:sessionId/ime/available_engines': {GET: {command: 'availableIMEEngines'}},
6
+ '/session/:sessionId/ime/active_engine': {GET: {command: 'getActiveIMEEngine'}},
7
+ '/session/:sessionId/ime/activated': {GET: {command: 'isIMEActivated'}},
8
+ '/session/:sessionId/ime/deactivate': {POST: {command: 'deactivateIMEEngine'}},
9
9
  '/session/:sessionId/ime/activate': {
10
10
  POST: {
11
11
  command: 'activateIMEEngine',
12
- payloadParams: { required: ['engine'] }
13
- }
12
+ payloadParams: {required: ['engine']},
13
+ },
14
14
  },
15
- '/session/:sessionId/window/:windowhandle/size': { GET: { command: 'getWindowSize' } },
15
+ '/session/:sessionId/window/:windowhandle/size': {GET: {command: 'getWindowSize'}},
16
16
  '/session/:sessionId/keys': {
17
- POST: { command: 'keys', payloadParams: { required: ['value'] } }
17
+ POST: {command: 'keys', payloadParams: {required: ['value']}},
18
18
  },
19
- '/session/:sessionId/element/:elementId/location': { GET: { command: 'getLocation' } },
20
- '/session/:sessionId/element/:elementId/location_in_view': { GET: { command: 'getLocationInView' } },
21
- '/session/:sessionId/element/:elementId/size': { GET: { command: 'getSize' } },
19
+ '/session/:sessionId/element/:elementId/location': {GET: {command: 'getLocation'}},
20
+ '/session/:sessionId/element/:elementId/location_in_view': {GET: {command: 'getLocationInView'}},
21
+ '/session/:sessionId/element/:elementId/size': {GET: {command: 'getSize'}},
22
22
  '/session/:sessionId/touch/click': {
23
- POST: { command: 'click', payloadParams: { required: ['element'] } }
23
+ POST: {command: 'click', payloadParams: {required: ['element']}},
24
24
  },
25
25
  '/session/:sessionId/touch/down': {
26
- POST: { command: 'touchDown', payloadParams: { required: ['x', 'y'] } }
26
+ POST: {command: 'touchDown', payloadParams: {required: ['x', 'y']}},
27
27
  },
28
28
  '/session/:sessionId/touch/up': {
29
- POST: { command: 'touchUp', payloadParams: { required: ['x', 'y'] } }
29
+ POST: {command: 'touchUp', payloadParams: {required: ['x', 'y']}},
30
30
  },
31
31
  '/session/:sessionId/touch/move': {
32
- POST: { command: 'touchMove', payloadParams: { required: ['x', 'y'] } }
32
+ POST: {command: 'touchMove', payloadParams: {required: ['x', 'y']}},
33
33
  },
34
34
  '/session/:sessionId/touch/longclick': {
35
35
  POST: {
36
36
  command: 'touchLongClick',
37
- payloadParams: { required: ['elements'] }
38
- }
37
+ payloadParams: {required: ['elements']},
38
+ },
39
39
  },
40
40
  '/session/:sessionId/touch/flick': {
41
41
  POST: {
42
42
  command: 'flick',
43
43
  payloadParams: {
44
- optional: [
45
- 'element',
46
- 'xspeed',
47
- 'yspeed',
48
- 'xoffset',
49
- 'yoffset',
50
- 'speed'
51
- ]
52
- }
53
- }
44
+ optional: ['element', 'xspeed', 'yspeed', 'xoffset', 'yoffset', 'speed'],
45
+ },
46
+ },
54
47
  },
55
48
  '/session/:sessionId/touch/perform': {
56
49
  POST: {
57
50
  command: 'performTouch',
58
- payloadParams: { wrap: 'actions', required: ['actions'] }
59
- }
51
+ payloadParams: {wrap: 'actions', required: ['actions']},
52
+ },
60
53
  },
61
54
  '/session/:sessionId/touch/multi/perform': {
62
55
  POST: {
63
56
  command: 'performMultiAction',
64
- payloadParams: { required: ['actions'], optional: ['elementId'] }
65
- }
57
+ payloadParams: {required: ['actions'], optional: ['elementId']},
58
+ },
66
59
  },
67
60
  '/session/:sessionId/appium/device/lock': {
68
- POST: { command: 'lock', payloadParams: { optional: ['seconds'] } }
61
+ POST: {command: 'lock', payloadParams: {optional: ['seconds']}},
69
62
  },
70
- '/session/:sessionId/appium/device/unlock': { POST: { command: 'unlock' } },
71
- '/session/:sessionId/appium/device/is_locked': { POST: { command: 'isLocked' } },
63
+ '/session/:sessionId/appium/device/unlock': {POST: {command: 'unlock'}},
64
+ '/session/:sessionId/appium/device/is_locked': {POST: {command: 'isLocked'}},
72
65
  '/session/:sessionId/appium/start_recording_screen': {
73
66
  POST: {
74
67
  command: 'startRecordingScreen',
75
- payloadParams: { optional: ['options'] }
76
- }
68
+ payloadParams: {optional: ['options']},
69
+ },
77
70
  },
78
71
  '/session/:sessionId/appium/stop_recording_screen': {
79
72
  POST: {
80
73
  command: 'stopRecordingScreen',
81
- payloadParams: { optional: ['options'] }
82
- }
74
+ payloadParams: {optional: ['options']},
75
+ },
83
76
  },
84
- '/session/:sessionId/appium/performanceData/types': { POST: { command: 'getPerformanceDataTypes' } },
77
+ '/session/:sessionId/appium/performanceData/types': {POST: {command: 'getPerformanceDataTypes'}},
85
78
  '/session/:sessionId/appium/getPerformanceData': {
86
79
  POST: {
87
80
  command: 'getPerformanceData',
88
81
  payloadParams: {
89
82
  required: ['packageName', 'dataType'],
90
- optional: ['dataReadTimeout']
91
- }
92
- }
83
+ optional: ['dataReadTimeout'],
84
+ },
85
+ },
93
86
  },
94
87
  '/session/:sessionId/appium/device/press_keycode': {
95
88
  POST: {
96
89
  command: 'pressKeyCode',
97
- payloadParams: { required: ['keycode'], optional: ['metastate', 'flags'] }
98
- }
90
+ payloadParams: {required: ['keycode'], optional: ['metastate', 'flags']},
91
+ },
99
92
  },
100
93
  '/session/:sessionId/appium/device/long_press_keycode': {
101
94
  POST: {
102
95
  command: 'longPressKeyCode',
103
- payloadParams: { required: ['keycode'], optional: ['metastate', 'flags'] }
104
- }
96
+ payloadParams: {required: ['keycode'], optional: ['metastate', 'flags']},
97
+ },
105
98
  },
106
99
  '/session/:sessionId/appium/device/finger_print': {
107
100
  POST: {
108
101
  command: 'fingerprint',
109
- payloadParams: { required: ['fingerprintId'] }
110
- }
102
+ payloadParams: {required: ['fingerprintId']},
103
+ },
111
104
  },
112
105
  '/session/:sessionId/appium/device/send_sms': {
113
106
  POST: {
114
107
  command: 'sendSMS',
115
- payloadParams: { required: ['phoneNumber', 'message'] }
116
- }
108
+ payloadParams: {required: ['phoneNumber', 'message']},
109
+ },
117
110
  },
118
111
  '/session/:sessionId/appium/device/gsm_call': {
119
112
  POST: {
120
113
  command: 'gsmCall',
121
- payloadParams: { required: ['phoneNumber', 'action'] }
122
- }
114
+ payloadParams: {required: ['phoneNumber', 'action']},
115
+ },
123
116
  },
124
117
  '/session/:sessionId/appium/device/gsm_signal': {
125
118
  POST: {
126
119
  command: 'gsmSignal',
127
- payloadParams: { required: ['signalStrength'] }
128
- }
120
+ payloadParams: {required: ['signalStrength']},
121
+ },
129
122
  },
130
123
  '/session/:sessionId/appium/device/gsm_voice': {
131
- POST: { command: 'gsmVoice', payloadParams: { required: ['state'] } }
124
+ POST: {command: 'gsmVoice', payloadParams: {required: ['state']}},
132
125
  },
133
126
  '/session/:sessionId/appium/device/power_capacity': {
134
127
  POST: {
135
128
  command: 'powerCapacity',
136
- payloadParams: { required: ['percent'] }
137
- }
129
+ payloadParams: {required: ['percent']},
130
+ },
138
131
  },
139
132
  '/session/:sessionId/appium/device/power_ac': {
140
- POST: { command: 'powerAC', payloadParams: { required: ['state'] } }
133
+ POST: {command: 'powerAC', payloadParams: {required: ['state']}},
141
134
  },
142
135
  '/session/:sessionId/appium/device/network_speed': {
143
136
  POST: {
144
137
  command: 'networkSpeed',
145
- payloadParams: { required: ['netspeed'] }
146
- }
138
+ payloadParams: {required: ['netspeed']},
139
+ },
147
140
  },
148
141
  '/session/:sessionId/appium/device/keyevent': {
149
142
  POST: {
150
143
  command: 'keyevent',
151
- payloadParams: { required: ['keycode'], optional: ['metastate'] }
152
- }
144
+ payloadParams: {required: ['keycode'], optional: ['metastate']},
145
+ },
153
146
  },
154
- '/session/:sessionId/appium/device/current_activity': { GET: { command: 'getCurrentActivity' } },
155
- '/session/:sessionId/appium/device/current_package': { GET: { command: 'getCurrentPackage' } },
147
+ '/session/:sessionId/appium/device/current_activity': {GET: {command: 'getCurrentActivity'}},
148
+ '/session/:sessionId/appium/device/current_package': {GET: {command: 'getCurrentPackage'}},
156
149
  '/session/:sessionId/appium/device/app_state': {
157
150
  POST: {
158
151
  command: 'queryAppState',
159
- payloadParams: { required: [['appId'], ['bundleId']] }
160
- }
161
- },
162
- '/session/:sessionId/appium/device/toggle_airplane_mode': { POST: { command: 'toggleFlightMode' } },
163
- '/session/:sessionId/appium/device/toggle_data': { POST: { command: 'toggleData' } },
164
- '/session/:sessionId/appium/device/toggle_wifi': { POST: { command: 'toggleWiFi' } },
165
- '/session/:sessionId/appium/device/toggle_location_services': { POST: { command: 'toggleLocationServices' } },
166
- '/session/:sessionId/appium/device/open_notifications': { POST: { command: 'openNotifications' } },
152
+ payloadParams: {required: [['appId'], ['bundleId']]},
153
+ },
154
+ },
155
+ '/session/:sessionId/appium/device/toggle_airplane_mode': {POST: {command: 'toggleFlightMode'}},
156
+ '/session/:sessionId/appium/device/toggle_data': {POST: {command: 'toggleData'}},
157
+ '/session/:sessionId/appium/device/toggle_wifi': {POST: {command: 'toggleWiFi'}},
158
+ '/session/:sessionId/appium/device/toggle_location_services': {
159
+ POST: {command: 'toggleLocationServices'},
160
+ },
161
+ '/session/:sessionId/appium/device/open_notifications': {POST: {command: 'openNotifications'}},
167
162
  '/session/:sessionId/appium/device/start_activity': {
168
163
  POST: {
169
164
  command: 'startActivity',
@@ -176,44 +171,38 @@ export const newMethodMap = /** @type {const} */ ({
176
171
  'intentCategory',
177
172
  'intentFlags',
178
173
  'optionalIntentArguments',
179
- 'dontStopAppOnReset'
180
- ]
181
- }
182
- }
183
- },
184
- '/session/:sessionId/appium/device/system_bars': { GET: { command: 'getSystemBars' } },
185
- '/session/:sessionId/appium/device/display_density': { GET: { command: 'getDisplayDensity' } },
186
- '/session/:sessionId/appium/app/launch': { POST: { command: 'launchApp' } },
187
- '/session/:sessionId/appium/app/close': { POST: { command: 'closeApp' } },
188
- '/session/:sessionId/appium/app/reset': { POST: { command: 'reset' } },
174
+ 'dontStopAppOnReset',
175
+ ],
176
+ },
177
+ },
178
+ },
179
+ '/session/:sessionId/appium/device/system_bars': {GET: {command: 'getSystemBars'}},
180
+ '/session/:sessionId/appium/device/display_density': {GET: {command: 'getDisplayDensity'}},
181
+ '/session/:sessionId/appium/app/launch': {POST: {command: 'launchApp'}},
182
+ '/session/:sessionId/appium/app/close': {POST: {command: 'closeApp'}},
183
+ '/session/:sessionId/appium/app/reset': {POST: {command: 'reset'}},
189
184
  '/session/:sessionId/appium/app/background': {
190
185
  POST: {
191
186
  command: 'background',
192
- payloadParams: { required: ['seconds'] }
193
- }
194
- },
195
- '/session/:sessionId/appium/app/end_test_coverage': {
196
- POST: {
197
- command: 'endCoverage',
198
- payloadParams: { required: ['intent', 'path'] }
199
- }
187
+ payloadParams: {required: ['seconds']},
188
+ },
200
189
  },
201
190
  '/session/:sessionId/appium/app/strings': {
202
191
  POST: {
203
192
  command: 'getStrings',
204
- payloadParams: { optional: ['language', 'stringFile'] }
205
- }
193
+ payloadParams: {optional: ['language', 'stringFile']},
194
+ },
206
195
  },
207
196
  '/session/:sessionId/appium/element/:elementId/value': {
208
197
  POST: {
209
198
  command: 'setValueImmediate',
210
- payloadParams: { required: ['text'] }
211
- }
199
+ payloadParams: {required: ['text']},
200
+ },
212
201
  },
213
202
  '/session/:sessionId/appium/element/:elementId/replace_value': {
214
203
  POST: {
215
204
  command: 'replaceValue',
216
- payloadParams: { required: ['text'] }
217
- }
218
- }
205
+ payloadParams: {required: ['text']},
206
+ },
207
+ },
219
208
  });
package/lib/stubs.ts CHANGED
@@ -3,6 +3,5 @@
3
3
  * @module
4
4
  */
5
5
 
6
- declare module 'appium-adb';
7
6
  declare module 'shared-preferences-builder';
8
7
  declare module 'io.appium.settings';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-android-driver",
3
- "version": "5.14.7",
3
+ "version": "6.0.1",
4
4
  "description": "Android UiAutomator and Chrome support for Appium",
5
5
  "keywords": [
6
6
  "appium",
@@ -19,18 +19,18 @@
19
19
  },
20
20
  "license": "Apache-2.0",
21
21
  "author": "Appium Contributors",
22
- "main": "./build/index.js",
22
+ "main": "./build/lib/index.js",
23
23
  "bin": {},
24
24
  "directories": {
25
25
  "lib": "lib"
26
26
  },
27
27
  "files": [
28
- "index.js",
29
28
  "lib",
30
- "build/index.js",
31
- "build/lib",
29
+ "build",
32
30
  "bootstrap/bin/AppiumBootstrap.jar",
33
- "CHANGELOG.md"
31
+ "CHANGELOG.md",
32
+ "!build/test",
33
+ "!build/tsconfig.tsbuildinfo"
34
34
  ],
35
35
  "scripts": {
36
36
  "build": "tsc -b",
@@ -41,8 +41,8 @@
41
41
  "lint:commit": "commitlint",
42
42
  "lint:fix": "npm run lint -- --fix",
43
43
  "lint:staged": "lint-staged",
44
- "prepare": "husky install && npm run rebuild",
45
- "rebuild": "npm run clean && npm run build",
44
+ "prepare": "husky install; npm run rebuild",
45
+ "rebuild": "npm run clean; npm run build",
46
46
  "test": "mocha --exit --timeout 1m \"./test/unit/**/*-specs.js\""
47
47
  },
48
48
  "lint-staged": {
@@ -57,8 +57,8 @@
57
57
  "singleQuote": true
58
58
  },
59
59
  "dependencies": {
60
- "appium-adb": "^9.11.2",
61
- "appium-chromedriver": "^5.2.0",
60
+ "appium-adb": "^9.12.0",
61
+ "appium-chromedriver": "^5.5.1",
62
62
  "asyncbox": "^2.8.0",
63
63
  "axios": "^1.x",
64
64
  "bluebird": "^3.4.7",
@@ -73,12 +73,14 @@
73
73
  "shared-preferences-builder": "^0.x",
74
74
  "source-map-support": "^0.x",
75
75
  "teen_process": "^2.0.0",
76
+ "type-fest": "^3.11.1",
76
77
  "ws": "^8.0.0"
77
78
  },
78
79
  "devDependencies": {
79
- "@appium/eslint-config-appium": "^6.0.0",
80
- "@appium/support": "^4.0.1",
81
- "@appium/test-support": "^3.0.0",
80
+ "@appium/eslint-config-appium": "^8.0.4",
81
+ "@appium/eslint-config-appium-ts": "^0.3.1",
82
+ "@appium/support": "^4.1.2",
83
+ "@appium/test-support": "^3.0.20",
82
84
  "@appium/tsconfig": "^0.3.0",
83
85
  "@appium/types": "^0.13.4",
84
86
  "@commitlint/cli": "^17.6.3",
@@ -97,16 +99,20 @@
97
99
  "@types/source-map-support": "^0.5.6",
98
100
  "@types/teen_process": "^2.0.0",
99
101
  "@types/ws": "^8.5.4",
102
+ "@typescript-eslint/eslint-plugin": "^5.59.5",
103
+ "@typescript-eslint/parser": "^5.59.5",
100
104
  "@xmldom/xmldom": "^0.x",
101
105
  "android-apidemos": "^4.1.0",
106
+ "appium": "^2.0.0-rc.5",
102
107
  "chai": "^4.1.2",
103
108
  "chai-as-promised": "^7.1.1",
104
109
  "conventional-changelog-conventionalcommits": "^7.0.1",
105
- "eslint": "^7.32.0",
106
- "eslint-config-prettier": "^8.5.0",
107
- "eslint-plugin-import": "^2.26.0",
108
- "eslint-plugin-mocha": "^9.0.0",
109
- "eslint-plugin-promise": "^6.0.0",
110
+ "eslint": "^8.40.0",
111
+ "eslint-config-prettier": "^8.8.0",
112
+ "eslint-import-resolver-typescript": "^3.5.5",
113
+ "eslint-plugin-import": "^2.27.5",
114
+ "eslint-plugin-mocha": "^10.1.0",
115
+ "eslint-plugin-promise": "^6.1.1",
110
116
  "husky": "^8.0.3",
111
117
  "lint-staged": "^14.0.0",
112
118
  "mocha": "^10.0.0",
@@ -124,5 +130,6 @@
124
130
  "engines": {
125
131
  "node": ">=14",
126
132
  "npm": ">=8"
127
- }
133
+ },
134
+ "types": "./build/lib/index.d.ts"
128
135
  }
package/build/index.js DELETED
@@ -1,51 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || function (mod) {
20
- if (mod && mod.__esModule) return mod;
21
- var result = {};
22
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
- __setModuleDefault(result, mod);
24
- return result;
25
- };
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.SETTINGS_HELPER_PKG_ID = exports.CHROMIUM_WIN = exports.WEBVIEW_BASE = exports.WEBVIEW_WIN = exports.NATIVE_WIN = exports.webviewHelpers = exports.commonCapConstraints = exports.AndroidDriver = exports.androidCommands = exports.androidHelpers = void 0;
28
- const source_map_support_1 = require("source-map-support");
29
- (0, source_map_support_1.install)();
30
- const driver = __importStar(require("./lib/driver"));
31
- const androidHelperIndex = __importStar(require("./lib/android-helpers"));
32
- const commandIndex = __importStar(require("./lib/commands/index"));
33
- const webview = __importStar(require("./lib/webview-helpers"));
34
- const caps = __importStar(require("./lib/desired-caps"));
35
- const { AndroidDriver } = driver;
36
- exports.AndroidDriver = AndroidDriver;
37
- const { helpers: webviewHelpers, NATIVE_WIN, WEBVIEW_WIN, WEBVIEW_BASE, CHROMIUM_WIN } = webview;
38
- exports.webviewHelpers = webviewHelpers;
39
- exports.NATIVE_WIN = NATIVE_WIN;
40
- exports.WEBVIEW_WIN = WEBVIEW_WIN;
41
- exports.WEBVIEW_BASE = WEBVIEW_BASE;
42
- exports.CHROMIUM_WIN = CHROMIUM_WIN;
43
- const { commonCapConstraints } = caps;
44
- exports.commonCapConstraints = commonCapConstraints;
45
- const { commands: androidCommands } = commandIndex;
46
- exports.androidCommands = androidCommands;
47
- const { helpers: androidHelpers, SETTINGS_HELPER_PKG_ID } = androidHelperIndex;
48
- exports.androidHelpers = androidHelpers;
49
- exports.SETTINGS_HELPER_PKG_ID = SETTINGS_HELPER_PKG_ID;
50
- exports.default = AndroidDriver;
51
- //# sourceMappingURL=index.js.map
@@ -1,136 +0,0 @@
1
- export default helpers;
2
- export namespace helpers {
3
- export function createBaseADB(opts?: {}): Promise<any>;
4
- export function prepareEmulator(adb: any, opts: any): Promise<void>;
5
- /**
6
- * Set and ensure the locale name of the device under test.
7
- *
8
- * @param {Object} adb - The adb module instance.
9
- * @param {string} language - Language. The language field is case insensitive, but Locale always canonicalizes to lower case.
10
- * format: [a-zA-Z]{2,8}. e.g. en, ja : https://developer.android.com/reference/java/util/Locale.html
11
- * @param {string} country - Country. The country (region) field is case insensitive, but Locale always canonicalizes to upper case.
12
- * format: [a-zA-Z]{2} | [0-9]{3}. e.g. US, JP : https://developer.android.com/reference/java/util/Locale.html
13
- * @param {?string} script - Script. The script field is case insensitive but Locale always canonicalizes to title case.
14
- * format: [a-zA-Z]{4}. e.g. Hans in zh-Hans-CN : https://developer.android.com/reference/java/util/Locale.html
15
- * @throws {Error} If it failed to set locale properly
16
- */
17
- export function ensureDeviceLocale(adb: any, language: string, country: string, script?: string | null): Promise<void>;
18
- export function getDeviceInfoFromCaps(opts?: {}): Promise<{
19
- udid: any;
20
- emPort: any;
21
- }>;
22
- export function createADB(opts?: {}): Promise<any>;
23
- export function validatePackageActivityNames(opts: any): void;
24
- export function getLaunchInfo(adb: any, opts: any): Promise<{
25
- appPackage: any;
26
- appWaitPackage: any;
27
- appActivity: any;
28
- appWaitActivity: any;
29
- } | undefined>;
30
- export function resetApp(adb: any, opts?: {}): Promise<void>;
31
- export function installApk(adb: any, opts?: {}): Promise<void>;
32
- /**
33
- * Installs an array of apks
34
- * @param {ADB} adb Instance of Appium ADB object
35
- * @param {Object} opts Opts defined in driver.js
36
- */
37
- export function installOtherApks(otherApps: any, adb: any, opts: any): Promise<void>;
38
- /**
39
- * Uninstall an array of packages
40
- * @param {ADB} adb Instance of Appium ADB object
41
- * @param {Array<string>} appPackages An array of package names to uninstall. If this includes `'*'`, uninstall all of 3rd party apps
42
- * @param {Array<string>} filterPackages An array of packages does not uninstall when `*` is provided as `appPackages`
43
- */
44
- export function uninstallOtherPackages(adb: any, appPackages: string[], filterPackages?: string[]): Promise<void>;
45
- /**
46
- * Get third party packages filtered with `filterPackages`
47
- * @param {ADB} adb Instance of Appium ADB object
48
- * @param {Array<string>} filterPackages An array of packages does not uninstall when `*` is provided as `appPackages`
49
- * @returns {Array<string>} An array of installed third pary packages
50
- */
51
- export function getThirdPartyPackages(adb: any, filterPackages?: string[]): string[];
52
- export function initUnicodeKeyboard(adb: any): Promise<any>;
53
- export function setMockLocationApp(adb: any, app: any): Promise<void>;
54
- export function resetMockLocation(adb: any): Promise<void>;
55
- export function installHelperApp(adb: any, apkPath: any, packageId: any): Promise<void>;
56
- /**
57
- * Pushes and installs io.appium.settings app.
58
- * Throws an error if the setting app is required
59
- *
60
- * @param {Adb} adb - The adb module instance.
61
- * @param {Object} opts - Driver options dictionary.
62
- * @param {boolean} throwError [false] - Whether throw an error if Settings app fails to start
63
- * @throws {Error} If throwError is true and something happens in installation step
64
- */
65
- export function pushSettingsApp(adb: Adb, throwError?: boolean, opts?: any): Promise<void>;
66
- /**
67
- * Extracts string.xml and converts it to string.json and pushes
68
- * it to /data/local/tmp/string.json on for use of bootstrap
69
- * If app is not present to extract string.xml it deletes remote strings.json
70
- * If app does not have strings.xml we push an empty json object to remote
71
- *
72
- * @param {?string} language - Language abbreviation, for example 'fr'. The default language
73
- * is used if this argument is not defined.
74
- * @param {Object} adb - The adb module instance.
75
- * @param {Object} opts - Driver options dictionary.
76
- * @returns {Object} The dictionary, where string resource identifiers are keys
77
- * along with their corresponding values for the given language or an empty object
78
- * if no matching resources were extracted.
79
- */
80
- export function pushStrings(language: string | null, adb: any, opts: any): any;
81
- export function unlock(driver: any, adb: any, capabilities: any): Promise<void>;
82
- export function verifyUnlock(adb: any, timeoutMs?: null): Promise<void>;
83
- export function initDevice(adb: any, opts: any): Promise<any>;
84
- export function removeNullProperties(obj: any): void;
85
- export function truncateDecimals(number: any, digits: any): number;
86
- export function isChromeBrowser(browser: any): boolean;
87
- export function getChromePkg(browser: any): any;
88
- export function removeAllSessionWebSocketHandlers(server: any, sessionId: any): Promise<void>;
89
- /**
90
- * Takes a desired capability and tries to JSON.parse it as an array,
91
- * and either returns the parsed array or a singleton array.
92
- *
93
- * @param {any} cap A desired capability
94
- */
95
- export function parseArray(cap: any): any[];
96
- /**
97
- * Validate desired capabilities. Returns true if capability is valid
98
- *
99
- * @param {*} cap A desired capability
100
- * @return {boolean} Returns true if the capability is valid
101
- * @throws {Error} If the caps has invalid capability
102
- */
103
- export function validateDesiredCaps(caps: any): boolean;
104
- /**
105
- * Adjust the capabilities for a browser session
106
- *
107
- * @param {Object} caps - Current capabilities object
108
- * !!! The object is mutated by this method call !!!
109
- * @returns {Object} The same possibly mutated `opts` instance.
110
- * No mutation is happening is the current session if
111
- * appPackage/appActivity caps have already been provided.
112
- */
113
- export function adjustBrowserSessionCaps(caps?: any): any;
114
- /**
115
- * Checks whether the current device under test is an emulator
116
- *
117
- * @param {ADB} adb - appium-adb instance
118
- * @param {Object} opts - driver options mapping
119
- * @returns {boolean} `true` if the device is an Android emulator
120
- */
121
- export function isEmulator(adb: any, opts: any): boolean;
122
- export { Bootstrap as bootstrap };
123
- export { unlocker };
124
- }
125
- export const SETTINGS_HELPER_PKG_ID: "io.appium.settings";
126
- export const APP_STATE: Readonly<{
127
- NOT_INSTALLED: 0;
128
- NOT_RUNNING: 1;
129
- RUNNING_IN_BACKGROUND: 3;
130
- RUNNING_IN_FOREGROUND: 4;
131
- }>;
132
- export function prepareAvdArgs(adb: any, opts: any): any[];
133
- export function ensureNetworkSpeed(adb: any, networkSpeed: any): any;
134
- import Bootstrap from './bootstrap';
135
- import { helpers as unlocker } from './unlock-helpers';
136
- //# sourceMappingURL=android-helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"android-helpers.d.ts","sourceRoot":"","sources":["../../lib/android-helpers.js"],"names":[],"mappings":";;IAiHA,uDAmCC;IAED,oEAuCC;IAED;;;;;;;;;;;OAWG;IACH,uHAaC;IAED;;;OA4FC;IAGD,mDASC;IAED,8DAeC;IAED;;;;;mBA8BC;IAED,6DAsDC;IAED,+DAsCC;IAED;;;;OAIG;IACH,qFAgBC;IAED;;;;;OAKG;IACH,kHAQC;IAED;;;;;OAKG;IACH,qFAUC;IAED,4DAYC;IAED,sEAiCC;IAED,2DA+BC;IAED,wFAQC;IAED;;;;;;;;OAQG;IACH,2FA0DC;IAED;;;;;;;;;;;;;OAaG;IACH,+EAiCC;IAED,gFAsCC;IAED,wEAUC;IAED,8DA6DC;IAED,qDAMC;IAED,mEAMC;IAED,uDAEC;IAED,gDAEC;IAED,8FASC;IAED;;;;;OAKG;IACH,4CAaC;IAED;;;;;;OAMG;IACH,wDAoBC;IAED;;;;;;;;OAQG;IACH,0DAmBC;IAED;;;;;;OAMG;IACH,yDAGC;;;;AA55BD,0DAAoD;AAKpD;;;;;GAKG;AAYH,2DAqBC;AA9BD,qEAOC;sBAlEqB,aAAa;oCAO5B,kBAAkB"}