appium-mac2-driver 3.2.15 → 3.2.17

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 (83) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/lib/commands/app-management.d.ts.map +1 -1
  3. package/build/lib/commands/app-management.js.map +1 -1
  4. package/build/lib/commands/applescript.d.ts.map +1 -1
  5. package/build/lib/commands/applescript.js.map +1 -1
  6. package/build/lib/commands/bidi/models.d.ts.map +1 -1
  7. package/build/lib/commands/bidi/models.js.map +1 -1
  8. package/build/lib/commands/clipboard.d.ts.map +1 -1
  9. package/build/lib/commands/clipboard.js +2 -2
  10. package/build/lib/commands/clipboard.js.map +1 -1
  11. package/build/lib/commands/execute.d.ts.map +1 -1
  12. package/build/lib/commands/execute.js +3 -1
  13. package/build/lib/commands/execute.js.map +1 -1
  14. package/build/lib/commands/find.d.ts.map +1 -1
  15. package/build/lib/commands/find.js.map +1 -1
  16. package/build/lib/commands/gestures.d.ts.map +1 -1
  17. package/build/lib/commands/gestures.js.map +1 -1
  18. package/build/lib/commands/helpers.d.ts.map +1 -1
  19. package/build/lib/commands/helpers.js.map +1 -1
  20. package/build/lib/commands/native-record-screen.d.ts.map +1 -1
  21. package/build/lib/commands/native-record-screen.js +7 -7
  22. package/build/lib/commands/native-record-screen.js.map +1 -1
  23. package/build/lib/commands/navigation.d.ts.map +1 -1
  24. package/build/lib/commands/navigation.js.map +1 -1
  25. package/build/lib/commands/record-screen.d.ts.map +1 -1
  26. package/build/lib/commands/record-screen.js +2 -3
  27. package/build/lib/commands/record-screen.js.map +1 -1
  28. package/build/lib/commands/screenshots.d.ts.map +1 -1
  29. package/build/lib/commands/screenshots.js.map +1 -1
  30. package/build/lib/commands/source.d.ts.map +1 -1
  31. package/build/lib/commands/source.js.map +1 -1
  32. package/build/lib/doctor/optional-checks.d.ts.map +1 -1
  33. package/build/lib/doctor/optional-checks.js.map +1 -1
  34. package/build/lib/doctor/required-checks.d.ts.map +1 -1
  35. package/build/lib/doctor/required-checks.js.map +1 -1
  36. package/build/lib/driver.d.ts.map +1 -1
  37. package/build/lib/driver.js +1 -1
  38. package/build/lib/driver.js.map +1 -1
  39. package/build/lib/execute-method-map.d.ts.map +1 -1
  40. package/build/lib/execute-method-map.js +31 -140
  41. package/build/lib/execute-method-map.js.map +1 -1
  42. package/build/lib/index.d.ts +4 -0
  43. package/build/lib/index.d.ts.map +1 -0
  44. package/build/{index.js → lib/index.js} +1 -1
  45. package/build/lib/index.js.map +1 -0
  46. package/build/lib/logger.js.map +1 -1
  47. package/build/lib/types.d.ts.map +1 -1
  48. package/build/lib/utils.d.ts.map +1 -1
  49. package/build/lib/utils.js +2 -1
  50. package/build/lib/utils.js.map +1 -1
  51. package/build/lib/wda-mac.d.ts.map +1 -1
  52. package/build/lib/wda-mac.js +24 -25
  53. package/build/lib/wda-mac.js.map +1 -1
  54. package/lib/commands/app-management.ts +9 -10
  55. package/lib/commands/applescript.ts +5 -6
  56. package/lib/commands/bidi/models.ts +2 -2
  57. package/lib/commands/clipboard.ts +9 -8
  58. package/lib/commands/execute.ts +6 -5
  59. package/lib/commands/find.ts +3 -4
  60. package/lib/commands/gestures.ts +25 -26
  61. package/lib/commands/helpers.ts +8 -6
  62. package/lib/commands/native-record-screen.ts +61 -52
  63. package/lib/commands/navigation.ts +3 -4
  64. package/lib/commands/record-screen.ts +35 -32
  65. package/lib/commands/screenshots.ts +4 -5
  66. package/lib/commands/source.ts +6 -7
  67. package/lib/constraints.ts +0 -1
  68. package/lib/doctor/optional-checks.ts +3 -3
  69. package/lib/doctor/required-checks.ts +12 -9
  70. package/lib/doctor/utils.ts +0 -1
  71. package/lib/driver.ts +20 -18
  72. package/lib/execute-method-map.ts +32 -141
  73. package/lib/index.ts +4 -0
  74. package/lib/logger.ts +1 -2
  75. package/lib/method-map.ts +0 -1
  76. package/lib/types.ts +1 -1
  77. package/lib/utils.ts +7 -6
  78. package/lib/wda-mac.ts +113 -86
  79. package/npm-shrinkwrap.json +402 -1850
  80. package/package.json +7 -6
  81. package/build/index.d.ts +0 -4
  82. package/build/index.d.ts.map +0 -1
  83. package/build/index.js.map +0 -1
@@ -1,86 +1,48 @@
1
- import { ExecuteMethodMap } from '@appium/types';
1
+ import {ExecuteMethodMap} from '@appium/types';
2
2
 
3
3
  export const executeMethodMap = {
4
4
  'macos: click': {
5
5
  command: 'macosClick',
6
6
  params: {
7
- optional: [
8
- 'elementId',
9
- 'x',
10
- 'y',
11
- 'keyModifierFlags',
12
- ],
7
+ optional: ['elementId', 'x', 'y', 'keyModifierFlags'],
13
8
  },
14
9
  },
15
10
  'macos: scroll': {
16
11
  command: 'macosScroll',
17
12
  params: {
18
- required: [
19
- 'deltaX',
20
- 'deltaY',
21
- ],
22
- optional: [
23
- 'elementId',
24
- 'x',
25
- 'y',
26
- 'keyModifierFlags',
27
- ],
13
+ required: ['deltaX', 'deltaY'],
14
+ optional: ['elementId', 'x', 'y', 'keyModifierFlags'],
28
15
  },
29
16
  },
30
17
  'macos: swipe': {
31
18
  command: 'macosSwipe',
32
19
  params: {
33
- required: [
34
- 'direction',
35
- ],
36
- optional: [
37
- 'elementId',
38
- 'x',
39
- 'y',
40
- 'velocity',
41
- 'keyModifierFlags',
42
- ],
20
+ required: ['direction'],
21
+ optional: ['elementId', 'x', 'y', 'velocity', 'keyModifierFlags'],
43
22
  },
44
23
  },
45
24
  'macos: rightClick': {
46
25
  command: 'macosRightClick',
47
26
  params: {
48
- optional: [
49
- 'elementId',
50
- 'x',
51
- 'y',
52
- 'keyModifierFlags',
53
- ],
27
+ optional: ['elementId', 'x', 'y', 'keyModifierFlags'],
54
28
  },
55
29
  },
56
30
  'macos: hover': {
57
31
  command: 'macosHover',
58
32
  params: {
59
- optional: [
60
- 'elementId',
61
- 'x',
62
- 'y',
63
- 'keyModifierFlags',
64
- ],
33
+ optional: ['elementId', 'x', 'y', 'keyModifierFlags'],
65
34
  },
66
35
  },
67
36
  'macos: doubleClick': {
68
37
  command: 'macosDoubleClick',
69
38
  params: {
70
- optional: [
71
- 'elementId',
72
- 'x',
73
- 'y',
74
- 'keyModifierFlags',
75
- ],
39
+ optional: ['elementId', 'x', 'y', 'keyModifierFlags'],
76
40
  },
77
41
  },
78
42
  'macos: clickAndDrag': {
79
43
  command: 'macosClickAndDrag',
80
44
  params: {
81
- required: [
82
- 'duration',
83
- ],
45
+ required: ['duration'],
84
46
  optional: [
85
47
  'sourceElementId',
86
48
  'destinationElementId',
@@ -95,10 +57,7 @@ export const executeMethodMap = {
95
57
  'macos: clickAndDragAndHold': {
96
58
  command: 'macosClickAndDragAndHold',
97
59
  params: {
98
- required: [
99
- 'duration',
100
- 'holdDuration',
101
- ],
60
+ required: ['duration', 'holdDuration'],
102
61
  optional: [
103
62
  'sourceElementId',
104
63
  'destinationElementId',
@@ -114,56 +73,33 @@ export const executeMethodMap = {
114
73
  'macos: keys': {
115
74
  command: 'macosKeys',
116
75
  params: {
117
- required: [
118
- 'keys'
119
- ],
120
- optional: [
121
- 'elementId'
122
- ],
76
+ required: ['keys'],
77
+ optional: ['elementId'],
123
78
  },
124
79
  },
125
80
  'macos: tap': {
126
81
  command: 'macosTap',
127
82
  params: {
128
- optional: [
129
- 'elementId',
130
- 'x',
131
- 'y',
132
- 'keyModifierFlags',
133
- ],
83
+ optional: ['elementId', 'x', 'y', 'keyModifierFlags'],
134
84
  },
135
85
  },
136
86
  'macos: doubleTap': {
137
87
  command: 'macosDoubleTap',
138
88
  params: {
139
- optional: [
140
- 'elementId',
141
- 'x',
142
- 'y',
143
- 'keyModifierFlags',
144
- ],
89
+ optional: ['elementId', 'x', 'y', 'keyModifierFlags'],
145
90
  },
146
91
  },
147
92
  'macos: press': {
148
93
  command: 'macosPressAndHold',
149
94
  params: {
150
- required: [
151
- 'duration',
152
- ],
153
- optional: [
154
- 'elementId',
155
- 'x',
156
- 'y',
157
- 'keyModifierFlags',
158
- ],
95
+ required: ['duration'],
96
+ optional: ['elementId', 'x', 'y', 'keyModifierFlags'],
159
97
  },
160
98
  },
161
99
  'macos: pressAndDrag': {
162
100
  command: 'macosPressAndDrag',
163
101
  params: {
164
- required: [
165
- 'duration',
166
- ],
102
+ required: ['duration'],
167
103
  optional: [
168
104
  'sourceElementId',
169
105
  'destinationElementId',
@@ -178,10 +114,7 @@ export const executeMethodMap = {
178
114
  'macos: pressAndDragAndHold': {
179
115
  command: 'macosPressAndDragAndHold',
180
116
  params: {
181
- required: [
182
- 'duration',
183
- 'holdDuration',
184
- ],
117
+ required: ['duration', 'holdDuration'],
185
118
  optional: [
186
119
  'sourceElementId',
187
120
  'destinationElementId',
@@ -197,86 +130,56 @@ export const executeMethodMap = {
197
130
  'macos: source': {
198
131
  command: 'macosSource',
199
132
  params: {
200
- optional: [
201
- 'format',
202
- ],
133
+ optional: ['format'],
203
134
  },
204
135
  },
205
136
  'macos: deepLink': {
206
137
  command: 'macosDeepLink',
207
138
  params: {
208
- required: [
209
- 'url',
210
- ],
211
- optional: [
212
- 'bundleId'
213
- ],
139
+ required: ['url'],
140
+ optional: ['bundleId'],
214
141
  },
215
142
  },
216
143
  'macos: screenshots': {
217
144
  command: 'macosScreenshots',
218
145
  params: {
219
- optional: [
220
- 'displayId'
221
- ],
146
+ optional: ['displayId'],
222
147
  },
223
148
  },
224
149
  'macos: appleScript': {
225
150
  command: 'macosExecAppleScript',
226
151
  params: {
227
- optional: [
228
- 'script',
229
- 'language',
230
- 'command',
231
- 'cwd',
232
- 'timeout',
233
- ],
152
+ optional: ['script', 'language', 'command', 'cwd', 'timeout'],
234
153
  },
235
154
  },
236
155
  'macos: launchApp': {
237
156
  command: 'macosLaunchApp',
238
157
  params: {
239
- optional: [
240
- 'bundleId',
241
- 'path',
242
- 'arguments',
243
- 'environment',
244
- ],
158
+ optional: ['bundleId', 'path', 'arguments', 'environment'],
245
159
  },
246
160
  },
247
161
  'macos: activateApp': {
248
162
  command: 'macosActivateApp',
249
163
  params: {
250
- optional: [
251
- 'bundleId',
252
- 'path',
253
- ],
164
+ optional: ['bundleId', 'path'],
254
165
  },
255
166
  },
256
167
  'macos: terminateApp': {
257
168
  command: 'macosTerminateApp',
258
169
  params: {
259
- optional: [
260
- 'bundleId',
261
- 'path',
262
- ],
170
+ optional: ['bundleId', 'path'],
263
171
  },
264
172
  },
265
173
  'macos: queryAppState': {
266
174
  command: 'macosQueryAppState',
267
175
  params: {
268
- optional: [
269
- 'bundleId',
270
- 'path',
271
- ],
176
+ optional: ['bundleId', 'path'],
272
177
  },
273
178
  },
274
179
  'macos: startRecordingScreen': {
275
180
  command: 'startRecordingScreen',
276
181
  params: {
277
- required: [
278
- 'deviceId'
279
- ],
182
+ required: ['deviceId'],
280
183
  optional: [
281
184
  'timeLimit',
282
185
  'videoFilter',
@@ -284,32 +187,20 @@ export const executeMethodMap = {
284
187
  'preset',
285
188
  'captureCursor',
286
189
  'captureClicks',
287
- 'forceRestart'
190
+ 'forceRestart',
288
191
  ],
289
192
  },
290
193
  },
291
194
  'macos: stopRecordingScreen': {
292
195
  command: 'stopRecordingScreen',
293
196
  params: {
294
- optional: [
295
- 'remotePath',
296
- 'user',
297
- 'pass',
298
- 'method',
299
- 'headers',
300
- 'fileFieldName',
301
- 'formFields'
302
- ],
197
+ optional: ['remotePath', 'user', 'pass', 'method', 'headers', 'fileFieldName', 'formFields'],
303
198
  },
304
199
  },
305
200
  'macos: startNativeScreenRecording': {
306
201
  command: 'macosStartNativeScreenRecording',
307
202
  params: {
308
- optional: [
309
- 'fps',
310
- 'codec',
311
- 'displayId',
312
- ],
203
+ optional: ['fps', 'codec', 'displayId'],
313
204
  },
314
205
  },
315
206
  'macos: getNativeScreenRecordingInfo': {
package/lib/index.ts ADDED
@@ -0,0 +1,4 @@
1
+ import {Mac2Driver} from './driver';
2
+
3
+ export default Mac2Driver;
4
+ export {Mac2Driver};
package/lib/logger.ts CHANGED
@@ -1,6 +1,5 @@
1
- import { logger } from 'appium/support';
1
+ import {logger} from 'appium/support';
2
2
 
3
3
  const log = logger.getLogger('Mac2Driver');
4
4
 
5
5
  export default log;
6
-
package/lib/method-map.ts CHANGED
@@ -12,4 +12,3 @@ export const newMethodMap = {
12
12
  },
13
13
  },
14
14
  } as const;
15
-
package/lib/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { StringRecord } from '@appium/types';
1
+ import type {StringRecord} from '@appium/types';
2
2
 
3
3
  export interface KeyOptions {
4
4
  /**
package/lib/utils.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import _ from 'lodash';
2
- import { exec } from 'teen_process';
3
- import { node } from 'appium/support';
2
+ import {exec} from 'teen_process';
3
+ import {node} from 'appium/support';
4
4
 
5
5
  const MODULE_NAME = 'appium-mac2-driver';
6
6
 
@@ -10,7 +10,7 @@ const MODULE_NAME = 'appium-mac2-driver';
10
10
  * @returns The full path to module root
11
11
  * @throws If the current module root folder cannot be determined
12
12
  */
13
- export const getModuleRoot = _.memoize(function getModuleRoot (): string {
13
+ export const getModuleRoot = _.memoize(function getModuleRoot(): string {
14
14
  const root = node.getModuleRootSync(MODULE_NAME, __filename);
15
15
  if (!root) {
16
16
  throw new Error(`Cannot find the root folder of the ${MODULE_NAME} Node.js module`);
@@ -26,10 +26,11 @@ export const getModuleRoot = _.memoize(function getModuleRoot (): string {
26
26
  * @returns the list of matched children process ids
27
27
  * or an empty list if none matched
28
28
  */
29
- export async function listChildrenProcessIds (parentPid: number | string): Promise<string[]> {
30
- const { stdout } = await exec('ps', ['axu', '-o', 'ppid']);
29
+ export async function listChildrenProcessIds(parentPid: number | string): Promise<string[]> {
30
+ const {stdout} = await exec('ps', ['axu', '-o', 'ppid']);
31
31
  // USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND PPID
32
- return stdout.split('\n')
32
+ return stdout
33
+ .split('\n')
33
34
  .filter(_.trim)
34
35
  .map((line: string) => {
35
36
  const [, pid, ...rest] = line.split(/\s+/).filter(_.trim);