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.
- package/CHANGELOG.md +12 -0
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/applescript.d.ts.map +1 -1
- package/build/lib/commands/applescript.js.map +1 -1
- package/build/lib/commands/bidi/models.d.ts.map +1 -1
- package/build/lib/commands/bidi/models.js.map +1 -1
- package/build/lib/commands/clipboard.d.ts.map +1 -1
- package/build/lib/commands/clipboard.js +2 -2
- package/build/lib/commands/clipboard.js.map +1 -1
- package/build/lib/commands/execute.d.ts.map +1 -1
- package/build/lib/commands/execute.js +3 -1
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/find.d.ts.map +1 -1
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/gestures.d.ts.map +1 -1
- package/build/lib/commands/gestures.js.map +1 -1
- package/build/lib/commands/helpers.d.ts.map +1 -1
- package/build/lib/commands/helpers.js.map +1 -1
- package/build/lib/commands/native-record-screen.d.ts.map +1 -1
- package/build/lib/commands/native-record-screen.js +7 -7
- package/build/lib/commands/native-record-screen.js.map +1 -1
- package/build/lib/commands/navigation.d.ts.map +1 -1
- package/build/lib/commands/navigation.js.map +1 -1
- package/build/lib/commands/record-screen.d.ts.map +1 -1
- package/build/lib/commands/record-screen.js +2 -3
- package/build/lib/commands/record-screen.js.map +1 -1
- package/build/lib/commands/screenshots.d.ts.map +1 -1
- package/build/lib/commands/screenshots.js.map +1 -1
- package/build/lib/commands/source.d.ts.map +1 -1
- package/build/lib/commands/source.js.map +1 -1
- package/build/lib/doctor/optional-checks.d.ts.map +1 -1
- package/build/lib/doctor/optional-checks.js.map +1 -1
- package/build/lib/doctor/required-checks.d.ts.map +1 -1
- package/build/lib/doctor/required-checks.js.map +1 -1
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +1 -1
- package/build/lib/driver.js.map +1 -1
- package/build/lib/execute-method-map.d.ts.map +1 -1
- package/build/lib/execute-method-map.js +31 -140
- package/build/lib/execute-method-map.js.map +1 -1
- package/build/lib/index.d.ts +4 -0
- package/build/lib/index.d.ts.map +1 -0
- package/build/{index.js → lib/index.js} +1 -1
- package/build/lib/index.js.map +1 -0
- package/build/lib/logger.js.map +1 -1
- package/build/lib/types.d.ts.map +1 -1
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +2 -1
- package/build/lib/utils.js.map +1 -1
- package/build/lib/wda-mac.d.ts.map +1 -1
- package/build/lib/wda-mac.js +24 -25
- package/build/lib/wda-mac.js.map +1 -1
- package/lib/commands/app-management.ts +9 -10
- package/lib/commands/applescript.ts +5 -6
- package/lib/commands/bidi/models.ts +2 -2
- package/lib/commands/clipboard.ts +9 -8
- package/lib/commands/execute.ts +6 -5
- package/lib/commands/find.ts +3 -4
- package/lib/commands/gestures.ts +25 -26
- package/lib/commands/helpers.ts +8 -6
- package/lib/commands/native-record-screen.ts +61 -52
- package/lib/commands/navigation.ts +3 -4
- package/lib/commands/record-screen.ts +35 -32
- package/lib/commands/screenshots.ts +4 -5
- package/lib/commands/source.ts +6 -7
- package/lib/constraints.ts +0 -1
- package/lib/doctor/optional-checks.ts +3 -3
- package/lib/doctor/required-checks.ts +12 -9
- package/lib/doctor/utils.ts +0 -1
- package/lib/driver.ts +20 -18
- package/lib/execute-method-map.ts +32 -141
- package/lib/index.ts +4 -0
- package/lib/logger.ts +1 -2
- package/lib/method-map.ts +0 -1
- package/lib/types.ts +1 -1
- package/lib/utils.ts +7 -6
- package/lib/wda-mac.ts +113 -86
- package/npm-shrinkwrap.json +402 -1850
- package/package.json +7 -6
- package/build/index.d.ts +0 -4
- package/build/index.d.ts.map +0 -1
- package/build/index.js.map +0 -1
|
@@ -1,86 +1,48 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
package/lib/logger.ts
CHANGED
package/lib/method-map.ts
CHANGED
package/lib/types.ts
CHANGED
package/lib/utils.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
|
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
|
|
30
|
-
const {
|
|
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
|
|
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);
|