@appium/base-driver 8.7.3 → 9.1.0
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/build/lib/basedriver/capabilities.d.ts +11 -163
- package/build/lib/basedriver/capabilities.d.ts.map +1 -1
- package/build/lib/basedriver/capabilities.js +355 -236
- package/build/lib/basedriver/capabilities.js.map +1 -1
- package/build/lib/basedriver/commands/event.d.ts +7 -6
- package/build/lib/basedriver/commands/event.d.ts.map +1 -1
- package/build/lib/basedriver/commands/event.js +55 -35
- package/build/lib/basedriver/commands/event.js.map +1 -1
- package/build/lib/basedriver/commands/execute.d.ts +7 -6
- package/build/lib/basedriver/commands/execute.d.ts.map +1 -1
- package/build/lib/basedriver/commands/execute.js +66 -58
- package/build/lib/basedriver/commands/execute.js.map +1 -1
- package/build/lib/basedriver/commands/find.d.ts +9 -7
- package/build/lib/basedriver/commands/find.d.ts.map +1 -1
- package/build/lib/basedriver/commands/find.js +102 -54
- package/build/lib/basedriver/commands/find.js.map +1 -1
- package/build/lib/basedriver/commands/index.d.ts +3 -7
- package/build/lib/basedriver/commands/index.d.ts.map +1 -1
- package/build/lib/basedriver/commands/index.js +30 -33
- package/build/lib/basedriver/commands/index.js.map +1 -1
- package/build/lib/basedriver/commands/log.d.ts +8 -9
- package/build/lib/basedriver/commands/log.d.ts.map +1 -1
- package/build/lib/basedriver/commands/log.js +54 -38
- package/build/lib/basedriver/commands/log.js.map +1 -1
- package/build/lib/basedriver/commands/session.d.ts +7 -6
- package/build/lib/basedriver/commands/session.d.ts.map +1 -1
- package/build/lib/basedriver/commands/session.js +46 -39
- package/build/lib/basedriver/commands/session.js.map +1 -1
- package/build/lib/basedriver/commands/settings.d.ts +7 -7
- package/build/lib/basedriver/commands/settings.d.ts.map +1 -1
- package/build/lib/basedriver/commands/settings.js +35 -28
- package/build/lib/basedriver/commands/settings.js.map +1 -1
- package/build/lib/basedriver/commands/timeout.d.ts +7 -5
- package/build/lib/basedriver/commands/timeout.d.ts.map +1 -1
- package/build/lib/basedriver/commands/timeout.js +144 -162
- package/build/lib/basedriver/commands/timeout.js.map +1 -1
- package/build/lib/basedriver/core.d.ts +6 -157
- package/build/lib/basedriver/core.d.ts.map +1 -1
- package/build/lib/basedriver/core.js +361 -230
- package/build/lib/basedriver/core.js.map +1 -1
- package/build/lib/basedriver/desired-caps.js +80 -110
- package/build/lib/basedriver/desired-caps.js.map +1 -1
- package/build/lib/basedriver/device-settings.js +57 -62
- package/build/lib/basedriver/device-settings.js.map +1 -1
- package/build/lib/basedriver/driver.d.ts +11 -262
- package/build/lib/basedriver/driver.d.ts.map +1 -1
- package/build/lib/basedriver/driver.js +362 -262
- package/build/lib/basedriver/driver.js.map +1 -1
- package/build/lib/basedriver/helpers.js +500 -495
- package/build/lib/basedriver/helpers.js.map +1 -1
- package/build/lib/basedriver/logger.d.ts +1 -1
- package/build/lib/basedriver/logger.d.ts.map +1 -1
- package/build/lib/basedriver/logger.js +5 -15
- package/build/lib/basedriver/logger.js.map +1 -1
- package/build/lib/constants.js +14 -14
- package/build/lib/constants.js.map +1 -1
- package/build/lib/express/crash.js +8 -15
- package/build/lib/express/crash.js.map +1 -1
- package/build/lib/express/express-logging.js +49 -59
- package/build/lib/express/express-logging.js.map +1 -1
- package/build/lib/express/idempotency.js +125 -177
- package/build/lib/express/idempotency.js.map +1 -1
- package/build/lib/express/logger.d.ts +1 -1
- package/build/lib/express/logger.d.ts.map +1 -1
- package/build/lib/express/logger.js +5 -15
- package/build/lib/express/logger.js.map +1 -1
- package/build/lib/express/middleware.js +82 -107
- package/build/lib/express/middleware.js.map +1 -1
- package/build/lib/express/server.d.ts +17 -5
- package/build/lib/express/server.d.ts.map +1 -1
- package/build/lib/express/server.js +259 -224
- package/build/lib/express/server.js.map +1 -1
- package/build/lib/express/static.js +64 -81
- package/build/lib/express/static.js.map +1 -1
- package/build/lib/express/websocket.js +115 -87
- package/build/lib/express/websocket.js.map +1 -1
- package/build/lib/helpers/capabilities.d.ts +1 -59
- package/build/lib/helpers/capabilities.d.ts.map +1 -1
- package/build/lib/helpers/capabilities.js +72 -69
- package/build/lib/helpers/capabilities.js.map +1 -1
- package/build/lib/index.js +64 -180
- package/build/lib/index.js.map +1 -1
- package/build/lib/jsonwp-proxy/protocol-converter.js +215 -227
- package/build/lib/jsonwp-proxy/protocol-converter.js.map +1 -1
- package/build/lib/jsonwp-proxy/proxy.d.ts.map +1 -1
- package/build/lib/jsonwp-proxy/proxy.js +355 -393
- package/build/lib/jsonwp-proxy/proxy.js.map +1 -1
- package/build/lib/jsonwp-status/status.js +119 -130
- package/build/lib/jsonwp-status/status.js.map +1 -1
- package/build/lib/protocol/errors.d.ts +135 -32
- package/build/lib/protocol/errors.d.ts.map +1 -1
- package/build/lib/protocol/errors.js +871 -919
- package/build/lib/protocol/errors.js.map +1 -1
- package/build/lib/protocol/helpers.js +37 -37
- package/build/lib/protocol/helpers.js.map +1 -1
- package/build/lib/protocol/index.js +22 -109
- package/build/lib/protocol/index.js.map +1 -1
- package/build/lib/protocol/protocol.js +394 -350
- package/build/lib/protocol/protocol.js.map +1 -1
- package/build/lib/protocol/routes.d.ts +1248 -4
- package/build/lib/protocol/routes.d.ts.map +1 -1
- package/build/lib/protocol/routes.js +972 -1327
- package/build/lib/protocol/routes.js.map +1 -1
- package/build/lib/protocol/validators.js +32 -39
- package/build/lib/protocol/validators.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/lib/basedriver/capabilities.js +83 -39
- package/lib/basedriver/commands/event.js +10 -5
- package/lib/basedriver/commands/execute.js +14 -9
- package/lib/basedriver/commands/find.js +18 -12
- package/lib/basedriver/commands/index.js +21 -16
- package/lib/basedriver/commands/log.js +24 -18
- package/lib/basedriver/commands/session.js +10 -5
- package/lib/basedriver/commands/settings.js +9 -6
- package/lib/basedriver/commands/timeout.js +10 -4
- package/lib/basedriver/core.js +2 -3
- package/lib/basedriver/driver.js +12 -16
- package/lib/express/server.js +6 -3
- package/lib/protocol/errors.js +155 -44
- package/lib/protocol/routes.js +19 -7
- package/package.json +16 -18
package/lib/protocol/errors.js
CHANGED
|
@@ -45,9 +45,12 @@ export class NoSuchDriverError extends ProtocolError {
|
|
|
45
45
|
static error() {
|
|
46
46
|
return 'invalid session id';
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
/**
|
|
49
|
+
* @param {string} [message] error message
|
|
50
|
+
*/
|
|
51
|
+
constructor(message) {
|
|
49
52
|
super(
|
|
50
|
-
|
|
53
|
+
message || 'A session is either terminated or not started',
|
|
51
54
|
NoSuchDriverError.code(),
|
|
52
55
|
NoSuchDriverError.w3cStatus(),
|
|
53
56
|
NoSuchDriverError.error()
|
|
@@ -65,9 +68,13 @@ export class NoSuchElementError extends ProtocolError {
|
|
|
65
68
|
static error() {
|
|
66
69
|
return 'no such element';
|
|
67
70
|
}
|
|
68
|
-
|
|
71
|
+
/**
|
|
72
|
+
* @param {string} [message] error message
|
|
73
|
+
*/
|
|
74
|
+
constructor(message) {
|
|
69
75
|
super(
|
|
70
|
-
|
|
76
|
+
message ||
|
|
77
|
+
'An element could not be located on the page using the given ' + 'search parameters.',
|
|
71
78
|
NoSuchElementError.code(),
|
|
72
79
|
NoSuchElementError.w3cStatus(),
|
|
73
80
|
NoSuchElementError.error()
|
|
@@ -85,9 +92,13 @@ export class NoSuchFrameError extends ProtocolError {
|
|
|
85
92
|
static w3cStatus() {
|
|
86
93
|
return HTTPStatusCodes.NOT_FOUND;
|
|
87
94
|
}
|
|
88
|
-
|
|
95
|
+
/**
|
|
96
|
+
*
|
|
97
|
+
* @param {string} [message]
|
|
98
|
+
*/
|
|
99
|
+
constructor(message) {
|
|
89
100
|
super(
|
|
90
|
-
|
|
101
|
+
message ||
|
|
91
102
|
'A request to switch to a frame could not be satisfied because ' +
|
|
92
103
|
'the frame could not be found.',
|
|
93
104
|
NoSuchFrameError.code(),
|
|
@@ -107,9 +118,13 @@ export class UnknownCommandError extends ProtocolError {
|
|
|
107
118
|
static error() {
|
|
108
119
|
return 'unknown command';
|
|
109
120
|
}
|
|
110
|
-
|
|
121
|
+
/**
|
|
122
|
+
*
|
|
123
|
+
* @param {string} [message]
|
|
124
|
+
*/
|
|
125
|
+
constructor(message) {
|
|
111
126
|
super(
|
|
112
|
-
|
|
127
|
+
message ||
|
|
113
128
|
'The requested resource could not be found, or a request was ' +
|
|
114
129
|
'received using an HTTP method that is not supported by the mapped ' +
|
|
115
130
|
'resource.',
|
|
@@ -130,9 +145,13 @@ export class StaleElementReferenceError extends ProtocolError {
|
|
|
130
145
|
static error() {
|
|
131
146
|
return 'stale element reference';
|
|
132
147
|
}
|
|
133
|
-
|
|
148
|
+
/**
|
|
149
|
+
*
|
|
150
|
+
* @param {string} [message]
|
|
151
|
+
*/
|
|
152
|
+
constructor(message) {
|
|
134
153
|
super(
|
|
135
|
-
|
|
154
|
+
message ||
|
|
136
155
|
'An element command failed because the referenced element is no ' +
|
|
137
156
|
'longer attached to the DOM.',
|
|
138
157
|
StaleElementReferenceError.code(),
|
|
@@ -152,9 +171,12 @@ export class ElementNotVisibleError extends ProtocolError {
|
|
|
152
171
|
static error() {
|
|
153
172
|
return 'element not visible';
|
|
154
173
|
}
|
|
155
|
-
|
|
174
|
+
/**
|
|
175
|
+
* @param {string} [message] error message
|
|
176
|
+
*/
|
|
177
|
+
constructor(message) {
|
|
156
178
|
super(
|
|
157
|
-
|
|
179
|
+
message ||
|
|
158
180
|
'An element command could not be completed because the element is ' +
|
|
159
181
|
'not visible on the page.',
|
|
160
182
|
ElementNotVisibleError.code(),
|
|
@@ -174,9 +196,13 @@ export class InvalidElementStateError extends ProtocolError {
|
|
|
174
196
|
static error() {
|
|
175
197
|
return 'invalid element state';
|
|
176
198
|
}
|
|
177
|
-
|
|
199
|
+
/**
|
|
200
|
+
*
|
|
201
|
+
* @param {string} [message]
|
|
202
|
+
*/
|
|
203
|
+
constructor(message) {
|
|
178
204
|
super(
|
|
179
|
-
|
|
205
|
+
message ||
|
|
180
206
|
'An element command could not be completed because the element is ' +
|
|
181
207
|
'in an invalid state (e.g. attempting to click a disabled element).',
|
|
182
208
|
InvalidElementStateError.code(),
|
|
@@ -217,9 +243,13 @@ export class UnknownMethodError extends ProtocolError {
|
|
|
217
243
|
static error() {
|
|
218
244
|
return 'unknown method';
|
|
219
245
|
}
|
|
220
|
-
|
|
246
|
+
/**
|
|
247
|
+
* @param {string} [message] error message
|
|
248
|
+
*/
|
|
249
|
+
constructor(message) {
|
|
221
250
|
super(
|
|
222
|
-
|
|
251
|
+
message ||
|
|
252
|
+
'The requested command matched a known URL but did not match an method for that URL',
|
|
223
253
|
UnknownMethodError.code(),
|
|
224
254
|
UnknownMethodError.w3cStatus(),
|
|
225
255
|
UnknownMethodError.error()
|
|
@@ -237,9 +267,12 @@ export class UnsupportedOperationError extends ProtocolError {
|
|
|
237
267
|
static error() {
|
|
238
268
|
return 'unsupported operation';
|
|
239
269
|
}
|
|
240
|
-
|
|
270
|
+
/**
|
|
271
|
+
* @param {string} [message] error message
|
|
272
|
+
*/
|
|
273
|
+
constructor(message) {
|
|
241
274
|
super(
|
|
242
|
-
|
|
275
|
+
message || 'A server-side error occurred. Command cannot be supported.',
|
|
243
276
|
UnsupportedOperationError.code(),
|
|
244
277
|
UnsupportedOperationError.w3cStatus(),
|
|
245
278
|
UnsupportedOperationError.error()
|
|
@@ -257,9 +290,12 @@ export class ElementIsNotSelectableError extends ProtocolError {
|
|
|
257
290
|
static w3cStatus() {
|
|
258
291
|
return HTTPStatusCodes.BAD_REQUEST;
|
|
259
292
|
}
|
|
260
|
-
|
|
293
|
+
/**
|
|
294
|
+
* @param {string} [message] error message
|
|
295
|
+
*/
|
|
296
|
+
constructor(message) {
|
|
261
297
|
super(
|
|
262
|
-
|
|
298
|
+
message || 'An attempt was made to select an element that cannot be selected.',
|
|
263
299
|
ElementIsNotSelectableError.code(),
|
|
264
300
|
ElementIsNotSelectableError.w3cStatus(),
|
|
265
301
|
ElementIsNotSelectableError.error()
|
|
@@ -277,9 +313,12 @@ export class ElementClickInterceptedError extends ProtocolError {
|
|
|
277
313
|
static w3cStatus() {
|
|
278
314
|
return HTTPStatusCodes.BAD_REQUEST;
|
|
279
315
|
}
|
|
280
|
-
|
|
316
|
+
/**
|
|
317
|
+
* @param {string} [message] error message
|
|
318
|
+
*/
|
|
319
|
+
constructor(message) {
|
|
281
320
|
super(
|
|
282
|
-
|
|
321
|
+
message ||
|
|
283
322
|
'The Element Click command could not be completed because the element receiving ' +
|
|
284
323
|
'the events is obscuring the element that was requested clicked',
|
|
285
324
|
ElementClickInterceptedError.code(),
|
|
@@ -299,9 +338,12 @@ export class ElementNotInteractableError extends ProtocolError {
|
|
|
299
338
|
static w3cStatus() {
|
|
300
339
|
return HTTPStatusCodes.BAD_REQUEST;
|
|
301
340
|
}
|
|
302
|
-
|
|
341
|
+
/**
|
|
342
|
+
* @param {string} [message] error message
|
|
343
|
+
*/
|
|
344
|
+
constructor(message) {
|
|
303
345
|
super(
|
|
304
|
-
|
|
346
|
+
message ||
|
|
305
347
|
'A command could not be completed because the element is not pointer- or keyboard interactable',
|
|
306
348
|
ElementNotInteractableError.code(),
|
|
307
349
|
ElementNotInteractableError.w3cStatus(),
|
|
@@ -314,9 +356,12 @@ export class InsecureCertificateError extends ProtocolError {
|
|
|
314
356
|
static error() {
|
|
315
357
|
return 'insecure certificate';
|
|
316
358
|
}
|
|
317
|
-
|
|
359
|
+
/**
|
|
360
|
+
* @param {string} [message] error message
|
|
361
|
+
*/
|
|
362
|
+
constructor(message) {
|
|
318
363
|
super(
|
|
319
|
-
|
|
364
|
+
message ||
|
|
320
365
|
'Navigation caused the user agent to hit a certificate warning, which is usually the result of an expired or invalid TLS certificate',
|
|
321
366
|
ElementIsNotSelectableError.code(),
|
|
322
367
|
null,
|
|
@@ -335,9 +380,12 @@ export class JavaScriptError extends ProtocolError {
|
|
|
335
380
|
static error() {
|
|
336
381
|
return 'javascript error';
|
|
337
382
|
}
|
|
338
|
-
|
|
383
|
+
/**
|
|
384
|
+
* @param {string} [message] error message
|
|
385
|
+
*/
|
|
386
|
+
constructor(message) {
|
|
339
387
|
super(
|
|
340
|
-
|
|
388
|
+
message || 'An error occurred while executing user supplied JavaScript.',
|
|
341
389
|
JavaScriptError.code(),
|
|
342
390
|
JavaScriptError.w3cStatus(),
|
|
343
391
|
JavaScriptError.error()
|
|
@@ -355,9 +403,12 @@ export class XPathLookupError extends ProtocolError {
|
|
|
355
403
|
static error() {
|
|
356
404
|
return 'invalid selector';
|
|
357
405
|
}
|
|
358
|
-
|
|
406
|
+
/**
|
|
407
|
+
* @param {string} [message] error message
|
|
408
|
+
*/
|
|
409
|
+
constructor(message) {
|
|
359
410
|
super(
|
|
360
|
-
|
|
411
|
+
message || 'An error occurred while searching for an element by XPath.',
|
|
361
412
|
XPathLookupError.code(),
|
|
362
413
|
XPathLookupError.w3cStatus(),
|
|
363
414
|
XPathLookupError.error()
|
|
@@ -375,9 +426,12 @@ export class TimeoutError extends ProtocolError {
|
|
|
375
426
|
static error() {
|
|
376
427
|
return 'timeout';
|
|
377
428
|
}
|
|
378
|
-
|
|
429
|
+
/**
|
|
430
|
+
* @param {string} [message] error message
|
|
431
|
+
*/
|
|
432
|
+
constructor(message) {
|
|
379
433
|
super(
|
|
380
|
-
|
|
434
|
+
message || 'An operation did not complete before its timeout expired.',
|
|
381
435
|
TimeoutError.code(),
|
|
382
436
|
TimeoutError.w3cStatus(),
|
|
383
437
|
TimeoutError.error()
|
|
@@ -395,9 +449,12 @@ export class NoSuchWindowError extends ProtocolError {
|
|
|
395
449
|
static w3cStatus() {
|
|
396
450
|
return HTTPStatusCodes.NOT_FOUND;
|
|
397
451
|
}
|
|
398
|
-
|
|
452
|
+
/**
|
|
453
|
+
* @param {string} [message] error message
|
|
454
|
+
*/
|
|
455
|
+
constructor(message) {
|
|
399
456
|
super(
|
|
400
|
-
|
|
457
|
+
message ||
|
|
401
458
|
'A request to switch to a different window could not be satisfied ' +
|
|
402
459
|
'because the window could not be found.',
|
|
403
460
|
NoSuchWindowError.code(),
|
|
@@ -417,6 +474,9 @@ export class InvalidArgumentError extends ProtocolError {
|
|
|
417
474
|
static w3cStatus() {
|
|
418
475
|
return HTTPStatusCodes.BAD_REQUEST;
|
|
419
476
|
}
|
|
477
|
+
/**
|
|
478
|
+
* @param {string} [err] error message
|
|
479
|
+
*/
|
|
420
480
|
constructor(err) {
|
|
421
481
|
super(
|
|
422
482
|
err || 'The arguments passed to the command are either invalid or malformed',
|
|
@@ -437,6 +497,9 @@ export class InvalidCookieDomainError extends ProtocolError {
|
|
|
437
497
|
static w3cStatus() {
|
|
438
498
|
return HTTPStatusCodes.BAD_REQUEST;
|
|
439
499
|
}
|
|
500
|
+
/**
|
|
501
|
+
* @param {string} [err] error message
|
|
502
|
+
*/
|
|
440
503
|
constructor(err) {
|
|
441
504
|
super(
|
|
442
505
|
err ||
|
|
@@ -459,6 +522,9 @@ export class NoSuchCookieError extends ProtocolError {
|
|
|
459
522
|
static error() {
|
|
460
523
|
return 'no such cookie';
|
|
461
524
|
}
|
|
525
|
+
/**
|
|
526
|
+
* @param {string} [err] error message
|
|
527
|
+
*/
|
|
462
528
|
constructor(err) {
|
|
463
529
|
super(
|
|
464
530
|
err ||
|
|
@@ -480,6 +546,9 @@ export class UnableToSetCookieError extends ProtocolError {
|
|
|
480
546
|
static error() {
|
|
481
547
|
return 'unable to set cookie';
|
|
482
548
|
}
|
|
549
|
+
/**
|
|
550
|
+
* @param {string} [err] error message
|
|
551
|
+
*/
|
|
483
552
|
constructor(err) {
|
|
484
553
|
super(
|
|
485
554
|
err || "A request to set a cookie's value could not be satisfied.",
|
|
@@ -500,9 +569,12 @@ export class UnexpectedAlertOpenError extends ProtocolError {
|
|
|
500
569
|
static error() {
|
|
501
570
|
return 'unexpected alert open';
|
|
502
571
|
}
|
|
503
|
-
|
|
572
|
+
/**
|
|
573
|
+
* @param {string} [message] error message
|
|
574
|
+
*/
|
|
575
|
+
constructor(message) {
|
|
504
576
|
super(
|
|
505
|
-
|
|
577
|
+
message || 'A modal dialog was open, blocking this operation',
|
|
506
578
|
UnexpectedAlertOpenError.code(),
|
|
507
579
|
UnexpectedAlertOpenError.w3cStatus(),
|
|
508
580
|
UnexpectedAlertOpenError.error()
|
|
@@ -520,9 +592,13 @@ export class NoAlertOpenError extends ProtocolError {
|
|
|
520
592
|
static error() {
|
|
521
593
|
return 'no such alert';
|
|
522
594
|
}
|
|
523
|
-
|
|
595
|
+
/**
|
|
596
|
+
*
|
|
597
|
+
* @param {string} [message]
|
|
598
|
+
*/
|
|
599
|
+
constructor(message) {
|
|
524
600
|
super(
|
|
525
|
-
|
|
601
|
+
message || 'An attempt was made to operate on a modal dialog when one ' + 'was not open.',
|
|
526
602
|
NoAlertOpenError.code(),
|
|
527
603
|
NoAlertOpenError.w3cStatus(),
|
|
528
604
|
NoAlertOpenError.error()
|
|
@@ -542,6 +618,9 @@ export class ScriptTimeoutError extends ProtocolError {
|
|
|
542
618
|
static error() {
|
|
543
619
|
return 'script timeout';
|
|
544
620
|
}
|
|
621
|
+
/**
|
|
622
|
+
* @param {string} [err] error message
|
|
623
|
+
*/
|
|
545
624
|
constructor(err) {
|
|
546
625
|
super(
|
|
547
626
|
err || 'A script did not complete before its timeout expired.',
|
|
@@ -562,6 +641,9 @@ export class InvalidElementCoordinatesError extends ProtocolError {
|
|
|
562
641
|
static error() {
|
|
563
642
|
return 'invalid coordinates';
|
|
564
643
|
}
|
|
644
|
+
/**
|
|
645
|
+
* @param {string} [err] error message
|
|
646
|
+
*/
|
|
565
647
|
constructor(err) {
|
|
566
648
|
super(
|
|
567
649
|
err || 'The coordinates provided to an interactions operation are invalid.',
|
|
@@ -584,9 +666,12 @@ export class IMENotAvailableError extends ProtocolError {
|
|
|
584
666
|
static error() {
|
|
585
667
|
return 'unsupported operation';
|
|
586
668
|
}
|
|
587
|
-
|
|
669
|
+
/**
|
|
670
|
+
* @param {string} [message] error message
|
|
671
|
+
*/
|
|
672
|
+
constructor(message) {
|
|
588
673
|
super(
|
|
589
|
-
|
|
674
|
+
message || 'IME was not available.',
|
|
590
675
|
IMENotAvailableError.code(),
|
|
591
676
|
IMENotAvailableError.w3cStatus(),
|
|
592
677
|
IMENotAvailableError.error()
|
|
@@ -604,6 +689,9 @@ export class IMEEngineActivationFailedError extends ProtocolError {
|
|
|
604
689
|
static error() {
|
|
605
690
|
return 'unsupported operation';
|
|
606
691
|
}
|
|
692
|
+
/**
|
|
693
|
+
* @param {string} [err] error message
|
|
694
|
+
*/
|
|
607
695
|
constructor(err) {
|
|
608
696
|
super(
|
|
609
697
|
err || 'An IME engine could not be started.',
|
|
@@ -624,6 +712,9 @@ export class InvalidSelectorError extends ProtocolError {
|
|
|
624
712
|
static error() {
|
|
625
713
|
return 'invalid selector';
|
|
626
714
|
}
|
|
715
|
+
/**
|
|
716
|
+
* @param {string} [err] error message
|
|
717
|
+
*/
|
|
627
718
|
constructor(err) {
|
|
628
719
|
super(
|
|
629
720
|
err || 'Argument was an invalid selector (e.g. XPath/CSS).',
|
|
@@ -669,6 +760,9 @@ export class MoveTargetOutOfBoundsError extends ProtocolError {
|
|
|
669
760
|
static error() {
|
|
670
761
|
return 'move target out of bounds';
|
|
671
762
|
}
|
|
763
|
+
/**
|
|
764
|
+
* @param {string} [err] error message
|
|
765
|
+
*/
|
|
672
766
|
constructor(err) {
|
|
673
767
|
super(
|
|
674
768
|
err || 'Target provided for a move action is out of bounds.',
|
|
@@ -683,8 +777,12 @@ export class NoSuchContextError extends ProtocolError {
|
|
|
683
777
|
static code() {
|
|
684
778
|
return 35;
|
|
685
779
|
}
|
|
686
|
-
|
|
687
|
-
|
|
780
|
+
/**
|
|
781
|
+
*
|
|
782
|
+
* @param {string} [message]
|
|
783
|
+
*/
|
|
784
|
+
constructor(message) {
|
|
785
|
+
super(message || 'No such context found.', NoSuchContextError.code());
|
|
688
786
|
}
|
|
689
787
|
}
|
|
690
788
|
|
|
@@ -692,9 +790,13 @@ export class InvalidContextError extends ProtocolError {
|
|
|
692
790
|
static code() {
|
|
693
791
|
return 36;
|
|
694
792
|
}
|
|
695
|
-
|
|
793
|
+
/**
|
|
794
|
+
*
|
|
795
|
+
* @param {string} [message]
|
|
796
|
+
*/
|
|
797
|
+
constructor(message) {
|
|
696
798
|
super(
|
|
697
|
-
|
|
799
|
+
message || 'That command could not be executed in the current context.',
|
|
698
800
|
InvalidContextError.code()
|
|
699
801
|
);
|
|
700
802
|
}
|
|
@@ -702,11 +804,17 @@ export class InvalidContextError extends ProtocolError {
|
|
|
702
804
|
|
|
703
805
|
// These are aliases for UnknownMethodError
|
|
704
806
|
export class NotYetImplementedError extends UnknownMethodError {
|
|
807
|
+
/**
|
|
808
|
+
* @param {string} [err] error message
|
|
809
|
+
*/
|
|
705
810
|
constructor(err) {
|
|
706
811
|
super(err || 'Method has not yet been implemented');
|
|
707
812
|
}
|
|
708
813
|
}
|
|
709
814
|
export class NotImplementedError extends UnknownMethodError {
|
|
815
|
+
/**
|
|
816
|
+
* @param {string} [err] error message
|
|
817
|
+
*/
|
|
710
818
|
constructor(err) {
|
|
711
819
|
super(err || 'Method is not implemented');
|
|
712
820
|
}
|
|
@@ -722,6 +830,9 @@ export class UnableToCaptureScreen extends ProtocolError {
|
|
|
722
830
|
static error() {
|
|
723
831
|
return 'unable to capture screen';
|
|
724
832
|
}
|
|
833
|
+
/**
|
|
834
|
+
* @param {string} [err] error message
|
|
835
|
+
*/
|
|
725
836
|
constructor(err) {
|
|
726
837
|
super(
|
|
727
838
|
err || 'A screen capture was made impossible',
|
package/lib/protocol/routes.js
CHANGED
|
@@ -18,9 +18,8 @@ const SET_ALERT_TEXT_PAYLOAD_PARAMS = {
|
|
|
18
18
|
* define the routes, mapping of HTTP methods to particular driver commands, and
|
|
19
19
|
* any parameters that are expected in a request parameters can be `required` or
|
|
20
20
|
* `optional`
|
|
21
|
-
* @type {MethodMap}
|
|
22
21
|
*/
|
|
23
|
-
const METHOD_MAP = {
|
|
22
|
+
const METHOD_MAP = /** @type {const} */ ({
|
|
24
23
|
'/status': {
|
|
25
24
|
GET: {command: 'getStatus'},
|
|
26
25
|
},
|
|
@@ -304,6 +303,14 @@ const METHOD_MAP = {
|
|
|
304
303
|
payloadParams: {required: ['orientation']},
|
|
305
304
|
},
|
|
306
305
|
},
|
|
306
|
+
// w3c v2 https://www.w3.org/TR/webdriver2/#get-computed-role
|
|
307
|
+
'session/:sessionId/element/:elementId/computedrole': {
|
|
308
|
+
GET: {command: 'getComputedRole'},
|
|
309
|
+
},
|
|
310
|
+
// W3C v2 https://www.w3.org/TR/webdriver2/#get-computed-label
|
|
311
|
+
'session/:sessionId/element/:elementId/computedlabel': {
|
|
312
|
+
GET: {command: 'getComputedLabel'},
|
|
313
|
+
},
|
|
307
314
|
'/session/:sessionId/rotation': {
|
|
308
315
|
GET: {command: 'getRotation'},
|
|
309
316
|
POST: {command: 'setRotation', payloadParams: {required: ['x', 'y', 'z']}},
|
|
@@ -915,7 +922,7 @@ const METHOD_MAP = {
|
|
|
915
922
|
},
|
|
916
923
|
|
|
917
924
|
//endregion
|
|
918
|
-
};
|
|
925
|
+
});
|
|
919
926
|
|
|
920
927
|
// driver command names
|
|
921
928
|
let ALL_COMMANDS = [];
|
|
@@ -991,9 +998,9 @@ function routeToCommandName(endpoint, method, basePath = DEFAULT_BASE_PATH) {
|
|
|
991
998
|
}
|
|
992
999
|
if (!dstRoute) return; // eslint-disable-line curly
|
|
993
1000
|
|
|
994
|
-
const methods =
|
|
1001
|
+
const methods = METHOD_MAP[dstRoute];
|
|
995
1002
|
method = /** @type {Uppercase<typeof method>} */ (_.toUpper(method));
|
|
996
|
-
if (
|
|
1003
|
+
if (method in methods) {
|
|
997
1004
|
const dstMethod = _.get(methods, method);
|
|
998
1005
|
if (dstMethod.command) {
|
|
999
1006
|
return dstMethod.command;
|
|
@@ -1007,6 +1014,11 @@ const NO_SESSION_ID_COMMANDS = ['createSession', 'getStatus', 'getSessions'];
|
|
|
1007
1014
|
export {METHOD_MAP, ALL_COMMANDS, NO_SESSION_ID_COMMANDS, routeToCommandName};
|
|
1008
1015
|
|
|
1009
1016
|
/**
|
|
1010
|
-
*
|
|
1011
|
-
* @
|
|
1017
|
+
* This checks compat with the `MethodMap` interface.
|
|
1018
|
+
* @ignore
|
|
1012
1019
|
*/
|
|
1020
|
+
// eslint-disable-next-line no-unused-vars
|
|
1021
|
+
const _validMethodMap =
|
|
1022
|
+
/** @type {import('@appium/types').MethodMap<import('@appium/types').ExternalDriver<import('@appium/types').BaseDriverCapConstraints>>} */ (
|
|
1023
|
+
METHOD_MAP
|
|
1024
|
+
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appium/base-driver",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.1.0",
|
|
4
4
|
"description": "Base driver class for Appium drivers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"automation",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "Apache-2.0",
|
|
25
25
|
"author": "https://github.com/appium",
|
|
26
|
+
"types": "./build/lib/index.d.ts",
|
|
26
27
|
"directories": {
|
|
27
28
|
"lib": "lib"
|
|
28
29
|
},
|
|
@@ -34,48 +35,45 @@
|
|
|
34
35
|
"build"
|
|
35
36
|
],
|
|
36
37
|
"scripts": {
|
|
37
|
-
"build": "babel lib --root-mode=upward --out-dir=build/lib",
|
|
38
|
-
"dev": "npm run build -- --watch",
|
|
39
|
-
"fix": "npm run lint -- --fix",
|
|
40
|
-
"lint": "eslint -c ../../.eslintrc --ignore-path ../../.eslintignore .",
|
|
41
|
-
"prepare": "npm run build",
|
|
42
38
|
"test": "npm run test:unit",
|
|
43
|
-
"test:e2e": "mocha --timeout 20s --slow 10s \"./test/e2e/**/*.spec.js\"",
|
|
39
|
+
"test:e2e": "mocha -p --timeout 20s --slow 10s \"./test/e2e/**/*.spec.js\"",
|
|
44
40
|
"test:smoke": "node ./index.js",
|
|
45
41
|
"test:unit": "mocha \"./test/unit/**/*.spec.js\""
|
|
46
42
|
},
|
|
47
43
|
"dependencies": {
|
|
48
|
-
"@appium/support": "^
|
|
44
|
+
"@appium/support": "^3.0.1",
|
|
49
45
|
"@colors/colors": "1.5.0",
|
|
50
46
|
"@types/async-lock": "1.3.0",
|
|
51
|
-
"@types/bluebird": "3.5.
|
|
52
|
-
"@types/express": "4.17.
|
|
47
|
+
"@types/bluebird": "3.5.38",
|
|
48
|
+
"@types/express": "4.17.15",
|
|
53
49
|
"@types/method-override": "0.0.32",
|
|
54
50
|
"@types/serve-favicon": "2.5.3",
|
|
55
|
-
"async-lock": "1.
|
|
56
|
-
"asyncbox": "2.9.
|
|
57
|
-
"axios": "
|
|
51
|
+
"async-lock": "1.4.0",
|
|
52
|
+
"asyncbox": "2.9.4",
|
|
53
|
+
"axios": "1.2.1",
|
|
58
54
|
"bluebird": "3.7.2",
|
|
59
55
|
"body-parser": "1.20.1",
|
|
60
56
|
"es6-error": "4.1.1",
|
|
61
57
|
"express": "4.18.2",
|
|
62
58
|
"http-status-codes": "2.2.0",
|
|
63
59
|
"lodash": "4.17.21",
|
|
64
|
-
"lru-cache": "7.14.
|
|
60
|
+
"lru-cache": "7.14.1",
|
|
65
61
|
"method-override": "3.0.0",
|
|
66
62
|
"morgan": "1.10.0",
|
|
67
63
|
"serve-favicon": "2.5.0",
|
|
68
64
|
"source-map-support": "0.5.21",
|
|
69
|
-
"type-fest": "3.
|
|
65
|
+
"type-fest": "3.4.0",
|
|
70
66
|
"validate.js": "0.13.1"
|
|
71
67
|
},
|
|
72
68
|
"engines": {
|
|
73
|
-
"node": ">=
|
|
69
|
+
"node": "^14.17.0 || ^16.13.0 || >=18.0.0",
|
|
74
70
|
"npm": ">=8"
|
|
75
71
|
},
|
|
76
72
|
"publishConfig": {
|
|
77
73
|
"access": "public"
|
|
78
74
|
},
|
|
79
|
-
"
|
|
80
|
-
"
|
|
75
|
+
"gitHead": "2e76ba9607729f59ca967e47c2cba738e90a57b8",
|
|
76
|
+
"typedoc": {
|
|
77
|
+
"entryPoint": "./build/lib/index.js"
|
|
78
|
+
}
|
|
81
79
|
}
|