@appium/types 0.10.1 → 0.10.2
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/capabilities.d.ts +34 -23
- package/build/lib/capabilities.d.ts.map +1 -1
- package/build/lib/command.d.ts +24 -6
- package/build/lib/command.d.ts.map +1 -1
- package/build/lib/config.d.ts +2 -13
- package/build/lib/config.d.ts.map +1 -1
- package/build/lib/config.js.map +1 -1
- package/build/lib/constraints.d.ts +54 -67
- package/build/lib/constraints.d.ts.map +1 -1
- package/build/lib/constraints.js +2 -5
- package/build/lib/constraints.js.map +1 -1
- package/build/lib/driver.d.ts +203 -278
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/http.d.ts +11 -0
- package/build/lib/http.d.ts.map +1 -0
- package/build/lib/http.js +3 -0
- package/build/lib/http.js.map +1 -0
- package/build/lib/index.d.ts +5 -104
- package/build/lib/index.d.ts.map +1 -1
- package/build/lib/index.js +5 -3
- package/build/lib/index.js.map +1 -1
- package/build/lib/logger.d.ts +39 -0
- package/build/lib/logger.d.ts.map +1 -0
- package/build/lib/logger.js +3 -0
- package/build/lib/logger.js.map +1 -0
- package/build/lib/plugin.d.ts +29 -5
- package/build/lib/plugin.d.ts.map +1 -1
- package/build/lib/server.d.ts +60 -0
- package/build/lib/server.d.ts.map +1 -0
- package/build/lib/server.js +3 -0
- package/build/lib/server.js.map +1 -0
- package/build/lib/util.d.ts +51 -0
- package/build/lib/util.d.ts.map +1 -0
- package/build/lib/util.js +3 -0
- package/build/lib/util.js.map +1 -0
- package/lib/capabilities.ts +40 -53
- package/lib/command.ts +30 -10
- package/lib/config.ts +2 -36
- package/lib/{constraints.js → constraints.ts} +5 -5
- package/lib/driver.ts +236 -342
- package/lib/http.ts +31 -0
- package/lib/index.ts +5 -143
- package/lib/logger.ts +41 -0
- package/lib/plugin.ts +37 -6
- package/lib/server.ts +73 -0
- package/lib/util.ts +74 -0
- package/package.json +5 -4
package/lib/driver.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import type {EventEmitter} from 'events';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
UpdateServerCallback,
|
|
7
|
-
Class,
|
|
8
|
-
AppiumLogger,
|
|
9
|
-
StringRecord,
|
|
10
|
-
ConstraintsToCaps,
|
|
11
|
-
BaseDriverCapConstraints,
|
|
12
|
-
W3CCapabilities,
|
|
13
|
-
Capabilities,
|
|
14
|
-
} from '.';
|
|
2
|
+
import {Entries} from 'type-fest';
|
|
3
|
+
import {ActionSequence, Element} from './action';
|
|
4
|
+
import {Capabilities, DriverCaps, W3CCapabilities, W3CDriverCaps} from './capabilities';
|
|
5
|
+
import {ExecuteMethodMap, MethodMap} from './command';
|
|
15
6
|
import {ServerArgs} from './config';
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
7
|
+
import {HTTPHeaders, HTTPMethod} from './http';
|
|
8
|
+
import {AppiumLogger} from './logger';
|
|
9
|
+
import {AppiumServer, UpdateServerCallback} from './server';
|
|
10
|
+
import {Class, StringRecord} from './util';
|
|
18
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Interface implemented by the `DeviceSettings` class in `@appium/base-driver`
|
|
14
|
+
*/
|
|
15
|
+
export interface IDeviceSettings<T extends StringRecord> {
|
|
16
|
+
update(newSettings: T): Promise<void>;
|
|
17
|
+
getSettings(): T;
|
|
18
|
+
}
|
|
19
19
|
export interface ITimeoutCommands {
|
|
20
20
|
/**
|
|
21
21
|
* Set the various timeouts associated with a session
|
|
@@ -48,6 +48,7 @@ export interface ITimeoutCommands {
|
|
|
48
48
|
* @param ms - the timeout in ms
|
|
49
49
|
*
|
|
50
50
|
* @deprecated Use `timeouts` instead
|
|
51
|
+
*
|
|
51
52
|
*/
|
|
52
53
|
implicitWait(ms: number | string): Promise<void>;
|
|
53
54
|
|
|
@@ -169,7 +170,7 @@ export interface ISessionCommands {
|
|
|
169
170
|
*
|
|
170
171
|
* @returns A session data object
|
|
171
172
|
*/
|
|
172
|
-
getSession(): Promise<SingularSessionData
|
|
173
|
+
getSession<C extends Constraints>(): Promise<SingularSessionData<C>>;
|
|
173
174
|
}
|
|
174
175
|
|
|
175
176
|
export interface IExecuteCommands {
|
|
@@ -182,21 +183,24 @@ export interface IExecuteCommands {
|
|
|
182
183
|
*
|
|
183
184
|
* @returns The result of calling the Execute Method
|
|
184
185
|
*/
|
|
185
|
-
executeMethod<
|
|
186
|
+
executeMethod<
|
|
187
|
+
TArgs extends readonly any[] | readonly [StringRecord<unknown>] = unknown[],
|
|
188
|
+
TReturn = unknown
|
|
189
|
+
>(
|
|
190
|
+
script: string,
|
|
191
|
+
args: TArgs
|
|
192
|
+
): Promise<TReturn>;
|
|
186
193
|
}
|
|
187
194
|
|
|
188
|
-
export interface MultiSessionData<
|
|
189
|
-
C extends Constraints = BaseDriverCapConstraints,
|
|
190
|
-
Extra extends StringRecord | void = void
|
|
191
|
-
> {
|
|
195
|
+
export interface MultiSessionData<C extends Constraints = Constraints> {
|
|
192
196
|
id: string;
|
|
193
|
-
capabilities:
|
|
197
|
+
capabilities: DriverCaps<C>;
|
|
194
198
|
}
|
|
195
199
|
|
|
196
|
-
export type SingularSessionData<
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
+
export type SingularSessionData<C extends Constraints = Constraints> = DriverCaps<C> & {
|
|
201
|
+
events?: EventHistory;
|
|
202
|
+
error?: string;
|
|
203
|
+
};
|
|
200
204
|
|
|
201
205
|
export interface IFindCommands {
|
|
202
206
|
/**
|
|
@@ -343,7 +347,7 @@ export interface ILogCommands {
|
|
|
343
347
|
*
|
|
344
348
|
* @param logType - Name/key of log type as defined in {@linkcode ILogCommands.supportedLogTypes}.
|
|
345
349
|
*/
|
|
346
|
-
getLog(logType: string): Promise<
|
|
350
|
+
getLog(logType: string): Promise<unknown[]>;
|
|
347
351
|
}
|
|
348
352
|
|
|
349
353
|
/**
|
|
@@ -368,10 +372,10 @@ export interface LogDef {
|
|
|
368
372
|
*
|
|
369
373
|
* This implementation *should* drain, truncate or otherwise reset the log buffer.
|
|
370
374
|
*/
|
|
371
|
-
getter:
|
|
375
|
+
getter: (driver: any) => Promise<unknown[]> | unknown[];
|
|
372
376
|
}
|
|
373
377
|
|
|
374
|
-
export interface ISettingsCommands {
|
|
378
|
+
export interface ISettingsCommands<T extends StringRecord = StringRecord> {
|
|
375
379
|
/**
|
|
376
380
|
* Update the session's settings dictionary with a new settings object
|
|
377
381
|
*
|
|
@@ -385,14 +389,29 @@ export interface ISettingsCommands {
|
|
|
385
389
|
*
|
|
386
390
|
* @returns The settings object
|
|
387
391
|
*/
|
|
388
|
-
getSettings(): Promise<
|
|
392
|
+
getSettings(): Promise<T>;
|
|
389
393
|
}
|
|
390
394
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
395
|
+
/**
|
|
396
|
+
* @see {@linkcode ISessionHandler}
|
|
397
|
+
*/
|
|
398
|
+
export type DefaultCreateSessionResult<C extends Constraints> = [
|
|
399
|
+
sessionId: string,
|
|
400
|
+
capabilities: DriverCaps<C>
|
|
401
|
+
];
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* @see {@linkcode ISessionHandler}
|
|
405
|
+
*/
|
|
406
|
+
export type DefaultDeleteSessionResult = void;
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* An interface which creates and deletes sessions.
|
|
410
|
+
*/
|
|
411
|
+
export interface ISessionHandler<
|
|
412
|
+
C extends Constraints = Constraints,
|
|
413
|
+
CreateResult = DefaultCreateSessionResult<C>,
|
|
414
|
+
DeleteResult = DefaultDeleteSessionResult
|
|
396
415
|
> {
|
|
397
416
|
/**
|
|
398
417
|
* Start a new automation session
|
|
@@ -412,9 +431,9 @@ export interface SessionHandler<
|
|
|
412
431
|
* @returns The capabilities object representing the created session
|
|
413
432
|
*/
|
|
414
433
|
createSession(
|
|
415
|
-
w3cCaps1:
|
|
416
|
-
w3cCaps2?:
|
|
417
|
-
w3cCaps3?:
|
|
434
|
+
w3cCaps1: W3CDriverCaps<C>,
|
|
435
|
+
w3cCaps2?: W3CDriverCaps<C>,
|
|
436
|
+
w3cCaps3?: W3CDriverCaps<C>,
|
|
418
437
|
driverData?: DriverData[]
|
|
419
438
|
): Promise<CreateResult>;
|
|
420
439
|
|
|
@@ -433,19 +452,6 @@ export interface SessionHandler<
|
|
|
433
452
|
*/
|
|
434
453
|
export type DriverData = Record<string, unknown>;
|
|
435
454
|
|
|
436
|
-
/**
|
|
437
|
-
* Extensions can define new methods for the Appium server to map to command names, of the same
|
|
438
|
-
* format as used in Appium's `routes.js`.
|
|
439
|
-
*
|
|
440
|
-
*
|
|
441
|
-
* @example
|
|
442
|
-
* {
|
|
443
|
-
* '/session/:sessionId/new_method': {
|
|
444
|
-
* GET: {command: 'getNewThing'},
|
|
445
|
-
* POST: {command: 'setNewThing', payloadParams: {required: ['someParam']}}
|
|
446
|
-
* }
|
|
447
|
-
* }
|
|
448
|
-
*/
|
|
449
455
|
export interface Constraint {
|
|
450
456
|
readonly presence?: boolean | Readonly<{allowEmpty: boolean}>;
|
|
451
457
|
readonly isString?: boolean;
|
|
@@ -454,17 +460,26 @@ export interface Constraint {
|
|
|
454
460
|
readonly isObject?: boolean;
|
|
455
461
|
readonly isArray?: boolean;
|
|
456
462
|
readonly deprecated?: boolean;
|
|
457
|
-
readonly inclusion?: Readonly<[
|
|
458
|
-
readonly inclusionCaseInsensitive?: Readonly<[
|
|
463
|
+
readonly inclusion?: Readonly<[string, ...string[]]>;
|
|
464
|
+
readonly inclusionCaseInsensitive?: Readonly<[string, ...string[]]>;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* A collection of constraints describing the allowed capabilities for a driver.
|
|
469
|
+
*/
|
|
470
|
+
export interface Constraints {
|
|
471
|
+
[name: string]: Constraint;
|
|
459
472
|
}
|
|
460
|
-
export type Constraints = Readonly<Record<string, Constraint>>;
|
|
461
473
|
|
|
462
|
-
export interface DriverHelpers
|
|
463
|
-
configureApp: (
|
|
474
|
+
export interface DriverHelpers {
|
|
475
|
+
configureApp: (
|
|
476
|
+
app: string,
|
|
477
|
+
supportedAppExtensions?: string | string[] | ConfigureAppOptions
|
|
478
|
+
) => Promise<string>;
|
|
464
479
|
isPackageOrBundle: (app: string) => boolean;
|
|
465
480
|
duplicateKeys: <T>(input: T, firstKey: string, secondKey: string) => T;
|
|
466
481
|
parseCapsArray: (cap: string | string[]) => string[];
|
|
467
|
-
generateDriverLogPrefix: (obj: Core<C>, sessionId?: string) => string;
|
|
482
|
+
generateDriverLogPrefix: <C extends Constraints>(obj: Core<C>, sessionId?: string) => string;
|
|
468
483
|
}
|
|
469
484
|
|
|
470
485
|
export type SettingsUpdateListener<T extends Record<string, unknown> = Record<string, unknown>> = (
|
|
@@ -473,11 +488,6 @@ export type SettingsUpdateListener<T extends Record<string, unknown> = Record<st
|
|
|
473
488
|
curValue: unknown
|
|
474
489
|
) => Promise<void>;
|
|
475
490
|
|
|
476
|
-
export interface DeviceSettings<T = any> {
|
|
477
|
-
update(newSettings: Record<string, T>): Promise<void>;
|
|
478
|
-
getSettings(): Record<string, T>;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
491
|
// WebDriver
|
|
482
492
|
|
|
483
493
|
export interface Rect {
|
|
@@ -581,13 +591,13 @@ export interface EventHistoryCommand {
|
|
|
581
591
|
*
|
|
582
592
|
* This should not be used directly by external code.
|
|
583
593
|
*/
|
|
584
|
-
export interface Core<C extends Constraints =
|
|
594
|
+
export interface Core<C extends Constraints, Settings extends StringRecord = StringRecord> {
|
|
585
595
|
shouldValidateCaps: boolean;
|
|
586
596
|
sessionId: string | null;
|
|
587
597
|
opts: DriverOpts<C>;
|
|
588
|
-
initialOpts:
|
|
598
|
+
initialOpts: Partial<DriverOpts<C>>;
|
|
589
599
|
protocol?: string;
|
|
590
|
-
helpers: DriverHelpers
|
|
600
|
+
helpers: DriverHelpers;
|
|
591
601
|
basePath: string;
|
|
592
602
|
relaxedSecurityEnabled: boolean;
|
|
593
603
|
allowInsecure: string[];
|
|
@@ -597,9 +607,9 @@ export interface Core<C extends Constraints = BaseDriverCapConstraints> {
|
|
|
597
607
|
locatorStrategies: string[];
|
|
598
608
|
webLocatorStrategies: string[];
|
|
599
609
|
eventEmitter: EventEmitter;
|
|
600
|
-
settings:
|
|
610
|
+
settings: IDeviceSettings<Settings>;
|
|
601
611
|
log: AppiumLogger;
|
|
602
|
-
driverData
|
|
612
|
+
driverData: DriverData;
|
|
603
613
|
isCommandsQueueEnabled: boolean;
|
|
604
614
|
eventHistory: EventHistory;
|
|
605
615
|
onUnexpectedShutdown(handler: () => any): void;
|
|
@@ -635,7 +645,7 @@ export interface Core<C extends Constraints = BaseDriverCapConstraints> {
|
|
|
635
645
|
* ```
|
|
636
646
|
*/
|
|
637
647
|
getStatus(): Promise<any>;
|
|
638
|
-
sessionExists(sessionId
|
|
648
|
+
sessionExists(sessionId?: string): boolean;
|
|
639
649
|
isW3CProtocol(): boolean;
|
|
640
650
|
isMjsonwpProtocol(): boolean;
|
|
641
651
|
isFeatureEnabled(name: string): boolean;
|
|
@@ -658,24 +668,32 @@ export interface Core<C extends Constraints = BaseDriverCapConstraints> {
|
|
|
658
668
|
*
|
|
659
669
|
* `C` should be the constraints of the driver.
|
|
660
670
|
* `CArgs` would be the shape of `cliArgs`.
|
|
661
|
-
* `
|
|
671
|
+
* `Settings` is the shape of the raw device settings object (see {@linkcode IDeviceSettings})
|
|
662
672
|
*/
|
|
663
673
|
export interface Driver<
|
|
664
674
|
C extends Constraints = Constraints,
|
|
665
|
-
CArgs extends StringRecord = StringRecord
|
|
675
|
+
CArgs extends StringRecord = StringRecord,
|
|
676
|
+
Settings extends StringRecord = StringRecord,
|
|
677
|
+
CreateResult = DefaultCreateSessionResult<C>,
|
|
678
|
+
DeleteResult = DefaultDeleteSessionResult
|
|
666
679
|
> extends ISessionCommands,
|
|
667
680
|
ILogCommands,
|
|
668
681
|
IFindCommands,
|
|
669
|
-
ISettingsCommands
|
|
682
|
+
ISettingsCommands<Settings>,
|
|
670
683
|
ITimeoutCommands,
|
|
671
684
|
IEventCommands,
|
|
672
685
|
IExecuteCommands,
|
|
673
|
-
|
|
674
|
-
Core {
|
|
686
|
+
ISessionHandler<C, CreateResult, DeleteResult>,
|
|
687
|
+
Core<C, Settings> {
|
|
675
688
|
/**
|
|
676
689
|
* The set of command line arguments set for this driver
|
|
677
690
|
*/
|
|
678
691
|
cliArgs: CArgs;
|
|
692
|
+
// The following properties are assigned by appium */
|
|
693
|
+
server?: AppiumServer;
|
|
694
|
+
serverHost?: string;
|
|
695
|
+
serverPort?: number;
|
|
696
|
+
serverPath?: string;
|
|
679
697
|
|
|
680
698
|
// The following methods are implemented by `BaseDriver`.
|
|
681
699
|
|
|
@@ -707,6 +725,7 @@ export interface Driver<
|
|
|
707
725
|
* Reset the current session (run the delete session and create session subroutines)
|
|
708
726
|
*
|
|
709
727
|
* @deprecated Use explicit session management commands instead
|
|
728
|
+
* @privateRemarks This is implemented by `BaseDriver` and is used within `@appium/driver-test-support`
|
|
710
729
|
*/
|
|
711
730
|
reset(): Promise<void>;
|
|
712
731
|
|
|
@@ -734,7 +753,7 @@ export interface Driver<
|
|
|
734
753
|
*
|
|
735
754
|
* @returns Whether or not the capabilities are valid
|
|
736
755
|
*/
|
|
737
|
-
validateDesiredCaps(caps:
|
|
756
|
+
validateDesiredCaps(caps: DriverCaps<C>): boolean;
|
|
738
757
|
|
|
739
758
|
/**
|
|
740
759
|
* A helper function to log unrecognized capabilities to the console
|
|
@@ -743,7 +762,7 @@ export interface Driver<
|
|
|
743
762
|
*
|
|
744
763
|
* @internal
|
|
745
764
|
*/
|
|
746
|
-
logExtraCaps(caps:
|
|
765
|
+
logExtraCaps(caps: DriverCaps<C>): void;
|
|
747
766
|
|
|
748
767
|
/**
|
|
749
768
|
* A helper function used to assign server information to the driver instance so the driver knows
|
|
@@ -762,12 +781,6 @@ export interface Driver<
|
|
|
762
781
|
* None of these are implemented within Appium itself.
|
|
763
782
|
*/
|
|
764
783
|
export interface ExternalDriver<C extends Constraints = Constraints> extends Driver<C> {
|
|
765
|
-
// The following properties are assigned by appium */
|
|
766
|
-
server?: AppiumServer;
|
|
767
|
-
serverHost?: string;
|
|
768
|
-
serverPort?: number;
|
|
769
|
-
serverPath?: string;
|
|
770
|
-
|
|
771
784
|
// WebDriver spec commands
|
|
772
785
|
|
|
773
786
|
/**
|
|
@@ -1208,13 +1221,6 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1208
1221
|
|
|
1209
1222
|
// Appium W3C WebDriver Extension
|
|
1210
1223
|
|
|
1211
|
-
/**
|
|
1212
|
-
* Shake the device
|
|
1213
|
-
*
|
|
1214
|
-
* @deprecated
|
|
1215
|
-
*/
|
|
1216
|
-
mobileShake?(): Promise<void>;
|
|
1217
|
-
|
|
1218
1224
|
/**
|
|
1219
1225
|
* Get the current time on the device under timeouts
|
|
1220
1226
|
*
|
|
@@ -1224,52 +1230,6 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1224
1230
|
*/
|
|
1225
1231
|
getDeviceTime?(format?: string): Promise<string>;
|
|
1226
1232
|
|
|
1227
|
-
/**
|
|
1228
|
-
* Lock the device, and optionally unlock the device after a certain amount of time
|
|
1229
|
-
*
|
|
1230
|
-
* @param seconds - the number of seconds after which to unlock the device. Set to zero or leave
|
|
1231
|
-
* empty to not unlock the device automatically
|
|
1232
|
-
*
|
|
1233
|
-
* @deprecated
|
|
1234
|
-
*/
|
|
1235
|
-
lock?(seconds?: number): Promise<void>;
|
|
1236
|
-
|
|
1237
|
-
/**
|
|
1238
|
-
* Unlock the device
|
|
1239
|
-
*
|
|
1240
|
-
* @deprecated
|
|
1241
|
-
*/
|
|
1242
|
-
unlock?(): Promise<void>;
|
|
1243
|
-
|
|
1244
|
-
/**
|
|
1245
|
-
* Determine whether the device is locked
|
|
1246
|
-
*
|
|
1247
|
-
* @returns True if the device is locked, false otherwise
|
|
1248
|
-
*
|
|
1249
|
-
* @deprecated
|
|
1250
|
-
*/
|
|
1251
|
-
isLocked?(): Promise<boolean>;
|
|
1252
|
-
|
|
1253
|
-
/**
|
|
1254
|
-
* Direct Appium to start recording the device screen
|
|
1255
|
-
*
|
|
1256
|
-
* @param options - parameters for screen recording
|
|
1257
|
-
*
|
|
1258
|
-
* @deprecated
|
|
1259
|
-
*/
|
|
1260
|
-
startRecordingScreen?(options?: StartScreenRecordOptions): Promise<void>;
|
|
1261
|
-
|
|
1262
|
-
/**
|
|
1263
|
-
* Direct Appium to stop screen recording and return the video
|
|
1264
|
-
*
|
|
1265
|
-
* @param options - parameters for stopping like video Uploading
|
|
1266
|
-
*
|
|
1267
|
-
* @returns The base64-encoded video data
|
|
1268
|
-
*
|
|
1269
|
-
* @deprecated
|
|
1270
|
-
*/
|
|
1271
|
-
stopRecordingScreen?(options?: StopScreenRecordOptions): Promise<string>;
|
|
1272
|
-
|
|
1273
1233
|
/**
|
|
1274
1234
|
* List the performance data types supported by this driver, which can be used in a call to get
|
|
1275
1235
|
* the performance data by type.
|
|
@@ -1277,6 +1237,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1277
1237
|
* @returns The list of types
|
|
1278
1238
|
*
|
|
1279
1239
|
* @deprecated
|
|
1240
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1280
1241
|
*/
|
|
1281
1242
|
getPerformanceDataTypes?(): Promise<string[]>;
|
|
1282
1243
|
|
|
@@ -1291,6 +1252,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1291
1252
|
* @returns A list of performance data strings
|
|
1292
1253
|
*
|
|
1293
1254
|
* @deprecated
|
|
1255
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1294
1256
|
*/
|
|
1295
1257
|
getPerformanceData?(
|
|
1296
1258
|
packageName: string,
|
|
@@ -1306,6 +1268,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1306
1268
|
* @param flags - the code denoting the combination of extra flags
|
|
1307
1269
|
*
|
|
1308
1270
|
* @deprecated
|
|
1271
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1309
1272
|
*/
|
|
1310
1273
|
pressKeyCode?(keycode: number, metastate?: number, flags?: number): Promise<void>;
|
|
1311
1274
|
|
|
@@ -1317,6 +1280,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1317
1280
|
* @param flags - the code denoting the combination of extra flags
|
|
1318
1281
|
*
|
|
1319
1282
|
* @deprecated
|
|
1283
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1320
1284
|
*/
|
|
1321
1285
|
longPressKeyCode?(keycode: number, metastate?: number, flags?: number): Promise<void>;
|
|
1322
1286
|
|
|
@@ -1326,6 +1290,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1326
1290
|
* @param fingerprintId - the numeric ID of the fingerprint to use
|
|
1327
1291
|
*
|
|
1328
1292
|
* @deprecated
|
|
1293
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1329
1294
|
*/
|
|
1330
1295
|
fingerprint?(fingerprintId: number): Promise<void>;
|
|
1331
1296
|
|
|
@@ -1336,6 +1301,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1336
1301
|
* @param message - the SMS text
|
|
1337
1302
|
*
|
|
1338
1303
|
* @deprecated
|
|
1304
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1339
1305
|
*/
|
|
1340
1306
|
sendSMS?(phoneNumber: string, message: string): Promise<void>;
|
|
1341
1307
|
|
|
@@ -1347,6 +1313,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1347
1313
|
* @param action - the action to take in response (accept, reject, etc...)
|
|
1348
1314
|
*
|
|
1349
1315
|
* @deprecated
|
|
1316
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1350
1317
|
*/
|
|
1351
1318
|
gsmCall?(phoneNumber: string, action: string): Promise<void>;
|
|
1352
1319
|
|
|
@@ -1356,6 +1323,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1356
1323
|
* @param singalStrength - the strength in a driver-appropriate string
|
|
1357
1324
|
*
|
|
1358
1325
|
* @deprecated
|
|
1326
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1359
1327
|
*/
|
|
1360
1328
|
gsmSignal?(signalStrength: string): Promise<void>;
|
|
1361
1329
|
|
|
@@ -1365,6 +1333,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1365
1333
|
* @param state - the state
|
|
1366
1334
|
*
|
|
1367
1335
|
* @deprecated
|
|
1336
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1368
1337
|
*/
|
|
1369
1338
|
gsmVoice?(state: string): Promise<void>;
|
|
1370
1339
|
|
|
@@ -1374,6 +1343,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1374
1343
|
* @param percent - how full the battery should become
|
|
1375
1344
|
*
|
|
1376
1345
|
* @deprecated
|
|
1346
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1377
1347
|
*/
|
|
1378
1348
|
powerCapacity?(percent: number): Promise<void>;
|
|
1379
1349
|
|
|
@@ -1383,6 +1353,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1383
1353
|
* @param state - whether the device is connected to power or not
|
|
1384
1354
|
*
|
|
1385
1355
|
* @deprecated
|
|
1356
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1386
1357
|
*/
|
|
1387
1358
|
powerAC?(state: string): Promise<void>;
|
|
1388
1359
|
|
|
@@ -1392,6 +1363,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1392
1363
|
* @param netspeed - the speed as a string, like '3G'
|
|
1393
1364
|
*
|
|
1394
1365
|
* @deprecated
|
|
1366
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1395
1367
|
*/
|
|
1396
1368
|
networkSpeed?(netspeed: string): Promise<void>;
|
|
1397
1369
|
|
|
@@ -1402,6 +1374,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1402
1374
|
* @param metastate - the combination of meta startUnexpectedShutdown
|
|
1403
1375
|
*
|
|
1404
1376
|
* @deprecated
|
|
1377
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1405
1378
|
*/
|
|
1406
1379
|
keyevent?(keycode: string, metastate?: string): Promise<void>;
|
|
1407
1380
|
|
|
@@ -1416,6 +1389,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1416
1389
|
* @param elementId - if we're rotating around an element
|
|
1417
1390
|
*
|
|
1418
1391
|
* @deprecated Use setRotation instead
|
|
1392
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1419
1393
|
*/
|
|
1420
1394
|
mobileRotation?(
|
|
1421
1395
|
x: number,
|
|
@@ -1433,6 +1407,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1433
1407
|
* @returns The activity name
|
|
1434
1408
|
*
|
|
1435
1409
|
* @deprecated
|
|
1410
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1436
1411
|
*/
|
|
1437
1412
|
getCurrentActivity?(): Promise<string>;
|
|
1438
1413
|
|
|
@@ -1442,6 +1417,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1442
1417
|
* @returns The package name
|
|
1443
1418
|
*
|
|
1444
1419
|
* @deprecated
|
|
1420
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1445
1421
|
*/
|
|
1446
1422
|
getCurrentPackage?(): Promise<string>;
|
|
1447
1423
|
|
|
@@ -1489,10 +1465,11 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1489
1465
|
*
|
|
1490
1466
|
* @param appId - the package or bundle ID of the application
|
|
1491
1467
|
*
|
|
1492
|
-
* @returns A number representing the state. 0 means not installed, 1 means not running,
|
|
1493
|
-
* running in
|
|
1468
|
+
* @returns A number representing the state. `0` means not installed, `1` means not running, `2`
|
|
1469
|
+
* means running in background but suspended, `3` means running in the background, and `4` means
|
|
1470
|
+
* running in the foreground
|
|
1494
1471
|
*/
|
|
1495
|
-
queryAppState?(appId: string): Promise<0 | 1 | 3 | 4>;
|
|
1472
|
+
queryAppState?(appId: string): Promise<0 | 1 | 2 | 3 | 4>;
|
|
1496
1473
|
|
|
1497
1474
|
/**
|
|
1498
1475
|
* Attempt to hide a virtual keyboard
|
|
@@ -1541,6 +1518,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1541
1518
|
* Toggle airplane/flight mode for the device
|
|
1542
1519
|
*
|
|
1543
1520
|
* @deprecated
|
|
1521
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1544
1522
|
*/
|
|
1545
1523
|
toggleFlightMode?(): Promise<void>;
|
|
1546
1524
|
|
|
@@ -1548,6 +1526,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1548
1526
|
* Toggle cell network data
|
|
1549
1527
|
*
|
|
1550
1528
|
* @deprecated
|
|
1529
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1551
1530
|
*/
|
|
1552
1531
|
toggleData?(): Promise<void>;
|
|
1553
1532
|
|
|
@@ -1555,6 +1534,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1555
1534
|
* Toggle WiFi radio status
|
|
1556
1535
|
*
|
|
1557
1536
|
* @deprecated
|
|
1537
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1558
1538
|
*/
|
|
1559
1539
|
toggleWiFi?(): Promise<void>;
|
|
1560
1540
|
|
|
@@ -1562,6 +1542,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1562
1542
|
* Toggle location services for the device
|
|
1563
1543
|
*
|
|
1564
1544
|
* @deprecated
|
|
1545
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1565
1546
|
*/
|
|
1566
1547
|
toggleLocationServices?(): Promise<void>;
|
|
1567
1548
|
|
|
@@ -1569,6 +1550,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1569
1550
|
* Open the notifications shade/screen
|
|
1570
1551
|
*
|
|
1571
1552
|
* @deprecated
|
|
1553
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1572
1554
|
*/
|
|
1573
1555
|
openNotifications?(): Promise<void>;
|
|
1574
1556
|
|
|
@@ -1588,6 +1570,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1588
1570
|
* activity
|
|
1589
1571
|
*
|
|
1590
1572
|
* @deprecated
|
|
1573
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1591
1574
|
*/
|
|
1592
1575
|
startActivity?(
|
|
1593
1576
|
appPackage: string,
|
|
@@ -1607,6 +1590,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1607
1590
|
* @returns An array of information objects of driver-specific shape
|
|
1608
1591
|
*
|
|
1609
1592
|
* @deprecated
|
|
1593
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1610
1594
|
*/
|
|
1611
1595
|
getSystemBars?(): Promise<unknown[]>;
|
|
1612
1596
|
|
|
@@ -1616,50 +1600,10 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1616
1600
|
* @returns The density
|
|
1617
1601
|
*
|
|
1618
1602
|
* @deprecated
|
|
1603
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1619
1604
|
*/
|
|
1620
1605
|
getDisplayDensity?(): Promise<number>;
|
|
1621
1606
|
|
|
1622
|
-
/**
|
|
1623
|
-
* Trigger a touch/fingerprint match or match failure
|
|
1624
|
-
*
|
|
1625
|
-
* @param match - whether the match should be a success or failure
|
|
1626
|
-
*
|
|
1627
|
-
* @deprecated
|
|
1628
|
-
*/
|
|
1629
|
-
touchId?(match: boolean): Promise<void>;
|
|
1630
|
-
|
|
1631
|
-
/**
|
|
1632
|
-
* Toggle whether the device is enrolled in the touch ID program
|
|
1633
|
-
*
|
|
1634
|
-
* @param enabled - whether to enable or disable the touch ID program
|
|
1635
|
-
*
|
|
1636
|
-
* @deprecated
|
|
1637
|
-
*/
|
|
1638
|
-
toggleEnrollTouchId?(enabled: boolean): Promise<void>;
|
|
1639
|
-
|
|
1640
|
-
/**
|
|
1641
|
-
* Start the session after it has been started.
|
|
1642
|
-
*
|
|
1643
|
-
* @deprecated Don't use this, it never made sense.
|
|
1644
|
-
*/
|
|
1645
|
-
launchApp?(): Promise<void>;
|
|
1646
|
-
|
|
1647
|
-
/**
|
|
1648
|
-
* Stop the session without stopping the session
|
|
1649
|
-
*
|
|
1650
|
-
* @deprecated Don't use this, it never made sense.
|
|
1651
|
-
*/
|
|
1652
|
-
closeApp?(): Promise<void>;
|
|
1653
|
-
|
|
1654
|
-
/**
|
|
1655
|
-
* Background (close) the app either permanently or for a certain amount of time
|
|
1656
|
-
*
|
|
1657
|
-
* @param seconds - the number of seconds to background the app for, or `null` for permanently
|
|
1658
|
-
*
|
|
1659
|
-
* @deprecated
|
|
1660
|
-
*/
|
|
1661
|
-
background?(seconds: null | number): Promise<void>;
|
|
1662
|
-
|
|
1663
1607
|
/**
|
|
1664
1608
|
* End platform-specific code coverage tracing
|
|
1665
1609
|
*
|
|
@@ -1667,31 +1611,10 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1667
1611
|
* @param path - the path to place the results
|
|
1668
1612
|
*
|
|
1669
1613
|
* @deprecated
|
|
1614
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1670
1615
|
*/
|
|
1671
1616
|
endCoverage?(intent: string, path: string): Promise<void>;
|
|
1672
1617
|
|
|
1673
|
-
/**
|
|
1674
|
-
* Return the language-specific strings for an app
|
|
1675
|
-
*
|
|
1676
|
-
* @param language - the language to retrieve strings for
|
|
1677
|
-
* @param stringFile - the path to the localized strings file if not in the default location
|
|
1678
|
-
*
|
|
1679
|
-
* @returns A record of localized keys to localized text
|
|
1680
|
-
*
|
|
1681
|
-
* @deprecated
|
|
1682
|
-
*/
|
|
1683
|
-
getStrings?(language?: string, stringFile?: string): Promise<Record<string, unknown>>;
|
|
1684
|
-
|
|
1685
|
-
/**
|
|
1686
|
-
* Set the value, but like, now? Don't use this.
|
|
1687
|
-
*
|
|
1688
|
-
* @param value - the value to set
|
|
1689
|
-
* @param elementId - the element to set the value of
|
|
1690
|
-
*
|
|
1691
|
-
* @deprecated
|
|
1692
|
-
*/
|
|
1693
|
-
setValueImmediate?(value: string, elementId: string): Promise<void>;
|
|
1694
|
-
|
|
1695
1618
|
/**
|
|
1696
1619
|
* Set the value of a text field but ensure the current value is replace and not appended
|
|
1697
1620
|
*
|
|
@@ -1699,93 +1622,11 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1699
1622
|
* @param elementId - the element to set it in
|
|
1700
1623
|
*
|
|
1701
1624
|
* @deprecated
|
|
1625
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1702
1626
|
*/
|
|
1703
1627
|
replaceValue?(value: string, elementId: string): Promise<void>;
|
|
1704
1628
|
|
|
1705
|
-
/**
|
|
1706
|
-
* Collect the response of an async script execution? It's unclear what this is for. Don't use
|
|
1707
|
-
* it.
|
|
1708
|
-
*
|
|
1709
|
-
* @param response - idk
|
|
1710
|
-
*
|
|
1711
|
-
* @deprecated
|
|
1712
|
-
*/
|
|
1713
|
-
receiveAsyncResponse?(response: unknown): Promise<void>;
|
|
1714
|
-
|
|
1715
|
-
/**
|
|
1716
|
-
* Set the contents of the device clipboard
|
|
1717
|
-
*
|
|
1718
|
-
* @param content - the text to set
|
|
1719
|
-
* @param contentType - the media type if not text
|
|
1720
|
-
* @param label - the label if not text
|
|
1721
|
-
*
|
|
1722
|
-
* @deprecated
|
|
1723
|
-
*/
|
|
1724
|
-
setClipboard?(content: string, contentType?: string, label?: string): Promise<void>;
|
|
1725
|
-
|
|
1726
|
-
/**
|
|
1727
|
-
* Get the contents of the device clipboard, converted into an appropriate media type
|
|
1728
|
-
*
|
|
1729
|
-
* @param contentType - the media type if not text
|
|
1730
|
-
*
|
|
1731
|
-
* @returns The text or media content (base64-encoded) of the clipboard
|
|
1732
|
-
*
|
|
1733
|
-
* @deprecated
|
|
1734
|
-
*/
|
|
1735
|
-
getClipboard?(contentType?: string): Promise<string>;
|
|
1736
|
-
|
|
1737
1629
|
// JSONWP
|
|
1738
|
-
/**
|
|
1739
|
-
* Set the async execute script timeout
|
|
1740
|
-
*
|
|
1741
|
-
* @param ms - the timeout
|
|
1742
|
-
*
|
|
1743
|
-
* @deprecated Use the W3C timeouts command instead
|
|
1744
|
-
*/
|
|
1745
|
-
asyncScriptTimeout?(ms: number): Promise<void>;
|
|
1746
|
-
|
|
1747
|
-
/**
|
|
1748
|
-
* Get the window size
|
|
1749
|
-
*
|
|
1750
|
-
* @returns The size (width and height)
|
|
1751
|
-
*
|
|
1752
|
-
* @deprecated Use getWindowRect instead
|
|
1753
|
-
*/
|
|
1754
|
-
getWindowSize?(): Promise<Size>;
|
|
1755
|
-
|
|
1756
|
-
/**
|
|
1757
|
-
* Get the position of an element on screen
|
|
1758
|
-
*
|
|
1759
|
-
* @param elementId - the element ID
|
|
1760
|
-
*
|
|
1761
|
-
* @returns The position of the element
|
|
1762
|
-
*
|
|
1763
|
-
* @deprecated Use getElementRect instead
|
|
1764
|
-
*/
|
|
1765
|
-
getLocation?(elementId: string): Promise<Position>;
|
|
1766
|
-
|
|
1767
|
-
/**
|
|
1768
|
-
* Get the position of an element on screen within a certain other view
|
|
1769
|
-
*
|
|
1770
|
-
* @param elementId - the element ID
|
|
1771
|
-
*
|
|
1772
|
-
* @returns The position of the element
|
|
1773
|
-
*
|
|
1774
|
-
* @deprecated Use getElementRect instead
|
|
1775
|
-
*/
|
|
1776
|
-
getLocationInView?(elementId: string): Promise<Position>;
|
|
1777
|
-
|
|
1778
|
-
/**
|
|
1779
|
-
* Get the size of an element
|
|
1780
|
-
*
|
|
1781
|
-
* @param elementId - the element ID
|
|
1782
|
-
*
|
|
1783
|
-
* @returns The size of the element
|
|
1784
|
-
*
|
|
1785
|
-
* @deprecated Use getElementRect instead
|
|
1786
|
-
*/
|
|
1787
|
-
getSize?(elementId: string): Promise<Size>;
|
|
1788
|
-
|
|
1789
1630
|
/**
|
|
1790
1631
|
* Check whether two elements are identical
|
|
1791
1632
|
*
|
|
@@ -1795,33 +1636,16 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1795
1636
|
* @returns True if the elements are equal, false otherwise
|
|
1796
1637
|
*
|
|
1797
1638
|
* @deprecated
|
|
1639
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1798
1640
|
*/
|
|
1799
1641
|
equalsElement?(elementId: string, otherElementId: string): Promise<boolean>;
|
|
1800
|
-
|
|
1801
|
-
/**
|
|
1802
|
-
* Submit the form an element is in
|
|
1803
|
-
*
|
|
1804
|
-
* @param elementId - the element ID
|
|
1805
|
-
*
|
|
1806
|
-
* @deprecated
|
|
1807
|
-
*/
|
|
1808
|
-
submit?(elementId: string): Promise<void>;
|
|
1809
|
-
|
|
1810
|
-
/**
|
|
1811
|
-
* Send keys to the app
|
|
1812
|
-
*
|
|
1813
|
-
* @param value: the array of keys to send
|
|
1814
|
-
*
|
|
1815
|
-
* @deprecated Use the W3C send keys method instead
|
|
1816
|
-
*/
|
|
1817
|
-
keys?(value: string[]): Promise<void>;
|
|
1818
|
-
|
|
1819
1642
|
/**
|
|
1820
1643
|
* Get the list of IME engines
|
|
1821
1644
|
*
|
|
1822
1645
|
* @returns The list of IME engines
|
|
1823
1646
|
*
|
|
1824
1647
|
* @deprecated
|
|
1648
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1825
1649
|
*/
|
|
1826
1650
|
availableIMEEngines?(): Promise<string[]>;
|
|
1827
1651
|
|
|
@@ -1831,6 +1655,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1831
1655
|
* @returns The name of the active engine
|
|
1832
1656
|
*
|
|
1833
1657
|
* @deprecated
|
|
1658
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1834
1659
|
*/
|
|
1835
1660
|
getActiveIMEEngine?(): Promise<string>;
|
|
1836
1661
|
|
|
@@ -1840,6 +1665,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1840
1665
|
* @returns True if the IME is activated
|
|
1841
1666
|
*
|
|
1842
1667
|
* @deprecated
|
|
1668
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1843
1669
|
*/
|
|
1844
1670
|
isIMEActivated?(): Promise<boolean>;
|
|
1845
1671
|
|
|
@@ -1847,6 +1673,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1847
1673
|
* Deactivate an IME engine
|
|
1848
1674
|
*
|
|
1849
1675
|
* @deprecated
|
|
1676
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1850
1677
|
*/
|
|
1851
1678
|
deactivateIMEEngine?(): Promise<void>;
|
|
1852
1679
|
|
|
@@ -1856,6 +1683,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1856
1683
|
* @param engine - the name of the engine
|
|
1857
1684
|
*
|
|
1858
1685
|
* @deprecated
|
|
1686
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1859
1687
|
*/
|
|
1860
1688
|
activateIMEEngine?(engine: string): Promise<void>;
|
|
1861
1689
|
|
|
@@ -1873,23 +1701,13 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1873
1701
|
*/
|
|
1874
1702
|
setOrientation?(orientation: string): Promise<void>;
|
|
1875
1703
|
|
|
1876
|
-
/**
|
|
1877
|
-
* Move the mouse pointer to a particular screen location
|
|
1878
|
-
*
|
|
1879
|
-
* @param element - the element ID if the move is relative to an element
|
|
1880
|
-
* @param xOffset - the x offset
|
|
1881
|
-
* @param yOffset - the y offset
|
|
1882
|
-
*
|
|
1883
|
-
* @deprecated Use the Actions API instead
|
|
1884
|
-
*/
|
|
1885
|
-
moveTo?(element?: null | string, xOffset?: number, yOffset?: number): Promise<void>;
|
|
1886
|
-
|
|
1887
1704
|
/**
|
|
1888
1705
|
* Trigger a mouse button down
|
|
1889
1706
|
*
|
|
1890
1707
|
* @param button - the button ID
|
|
1891
1708
|
*
|
|
1892
1709
|
* @deprecated Use the Actions API instead
|
|
1710
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1893
1711
|
*/
|
|
1894
1712
|
buttonDown?(button?: number): Promise<void>;
|
|
1895
1713
|
|
|
@@ -1899,6 +1717,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1899
1717
|
* @param button - the button ID
|
|
1900
1718
|
*
|
|
1901
1719
|
* @deprecated Use the Actions API instead
|
|
1720
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1902
1721
|
*/
|
|
1903
1722
|
buttonUp?(button?: number): Promise<void>;
|
|
1904
1723
|
|
|
@@ -1908,6 +1727,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1908
1727
|
* @param button - the button ID
|
|
1909
1728
|
*
|
|
1910
1729
|
* @deprecated Use the Actions API instead
|
|
1730
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1911
1731
|
*/
|
|
1912
1732
|
clickCurrent?(button?: number): Promise<void>;
|
|
1913
1733
|
|
|
@@ -1915,6 +1735,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1915
1735
|
* Double-click the current mouse location
|
|
1916
1736
|
*
|
|
1917
1737
|
* @deprecated Use the Actions API instead
|
|
1738
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1918
1739
|
*/
|
|
1919
1740
|
doubleClick?(): Promise<void>;
|
|
1920
1741
|
|
|
@@ -1925,6 +1746,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1925
1746
|
* @param y - the y coordinate
|
|
1926
1747
|
*
|
|
1927
1748
|
* @deprecated Use the Actions API instead
|
|
1749
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1928
1750
|
*/
|
|
1929
1751
|
touchDown?(x: number, y: number): Promise<void>;
|
|
1930
1752
|
|
|
@@ -1935,6 +1757,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1935
1757
|
* @param y - the y coordinate
|
|
1936
1758
|
*
|
|
1937
1759
|
* @deprecated Use the Actions API instead
|
|
1760
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1938
1761
|
*/
|
|
1939
1762
|
touchUp?(x: number, y: number): Promise<void>;
|
|
1940
1763
|
|
|
@@ -1945,6 +1768,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1945
1768
|
* @param y - the y coordinate
|
|
1946
1769
|
*
|
|
1947
1770
|
* @deprecated Use the Actions API instead
|
|
1771
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1948
1772
|
*/
|
|
1949
1773
|
touchMove?(x: number, y: number): Promise<void>;
|
|
1950
1774
|
|
|
@@ -1954,6 +1778,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1954
1778
|
* @param elementId - the id of the element to long touch
|
|
1955
1779
|
*
|
|
1956
1780
|
* @deprecated Use the Actions API instead
|
|
1781
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1957
1782
|
*/
|
|
1958
1783
|
touchLongClick?(elementId: string): Promise<void>;
|
|
1959
1784
|
|
|
@@ -1968,6 +1793,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1968
1793
|
* @param speed - the speed (unclear how this relates to xSpeed and ySpeed)
|
|
1969
1794
|
*
|
|
1970
1795
|
* @deprecated Use the Actions API instead
|
|
1796
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1971
1797
|
*/
|
|
1972
1798
|
flick?(
|
|
1973
1799
|
element?: string,
|
|
@@ -2008,7 +1834,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
2008
1834
|
*
|
|
2009
1835
|
* @param name - the context name
|
|
2010
1836
|
*/
|
|
2011
|
-
setContext?(name: string): Promise<void>;
|
|
1837
|
+
setContext?(name: string, ...args: any[]): Promise<void>;
|
|
2012
1838
|
|
|
2013
1839
|
/**
|
|
2014
1840
|
* Get the list of available contexts
|
|
@@ -2026,6 +1852,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
2026
1852
|
* @returns The page index
|
|
2027
1853
|
*
|
|
2028
1854
|
* @deprecated
|
|
1855
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
2029
1856
|
*/
|
|
2030
1857
|
getPageIndex?(elementId: string): Promise<string>;
|
|
2031
1858
|
|
|
@@ -2046,25 +1873,6 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
2046
1873
|
*/
|
|
2047
1874
|
setNetworkConnection?(type: number): Promise<void>;
|
|
2048
1875
|
|
|
2049
|
-
/**
|
|
2050
|
-
* Perform a set of touch actions
|
|
2051
|
-
*
|
|
2052
|
-
* @param actions - the old MJSONWP style touch action objects
|
|
2053
|
-
*
|
|
2054
|
-
* @deprecated Use the W3C Actions API instead
|
|
2055
|
-
*/
|
|
2056
|
-
performTouch?(actions: unknown): Promise<void>;
|
|
2057
|
-
|
|
2058
|
-
/**
|
|
2059
|
-
* Perform a set of touch actions
|
|
2060
|
-
*
|
|
2061
|
-
* @param actions - the old MJSONWP style touch action objects
|
|
2062
|
-
* @param elementId - the id of an element if actions are restricted to one element
|
|
2063
|
-
*
|
|
2064
|
-
* @deprecated Use the W3C Actions API instead
|
|
2065
|
-
*/
|
|
2066
|
-
performMultiAction?(actions: unknown, elementId: string): Promise<void>;
|
|
2067
|
-
|
|
2068
1876
|
/**
|
|
2069
1877
|
* Get the current rotation state of the device
|
|
2070
1878
|
* @see {@link https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-rotation}
|
|
@@ -2225,23 +2033,109 @@ export interface ExtraDriverOpts {
|
|
|
2225
2033
|
*
|
|
2226
2034
|
* The combination happens within Appium prior to calling the constructor.
|
|
2227
2035
|
*/
|
|
2228
|
-
export type DriverOpts<C extends Constraints
|
|
2229
|
-
ExtraDriverOpts &
|
|
2230
|
-
Partial<ConstraintsToCaps<C>>;
|
|
2036
|
+
export type DriverOpts<C extends Constraints> = ServerArgs & ExtraDriverOpts & DriverCaps<C>;
|
|
2231
2037
|
|
|
2232
2038
|
/**
|
|
2233
2039
|
* An instance method of a driver class, whose name may be referenced by {@linkcode MethodDef.command}, and serves as an Appium command.
|
|
2234
2040
|
*
|
|
2235
2041
|
* Note that this signature differs from a `PluginCommand`.
|
|
2236
2042
|
*/
|
|
2237
|
-
export type DriverCommand<TArgs = any, TRetval = unknown> = (
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
string,
|
|
2241
|
-
DriverCommand<TArgs, TReturn>
|
|
2242
|
-
>;
|
|
2043
|
+
export type DriverCommand<TArgs extends readonly any[] = any[], TRetval = unknown> = (
|
|
2044
|
+
...args: TArgs
|
|
2045
|
+
) => Promise<TRetval>;
|
|
2243
2046
|
|
|
2244
2047
|
/**
|
|
2245
2048
|
* Tuple of an HTTP method with a regex matching a request path
|
|
2246
2049
|
*/
|
|
2247
2050
|
export type RouteMatcher = [HTTPMethod, RegExp];
|
|
2051
|
+
|
|
2052
|
+
/**
|
|
2053
|
+
* Result of the {@linkcode onPostProcess ConfigureAppOptions.onPostProcess} callback.
|
|
2054
|
+
*/
|
|
2055
|
+
export interface PostProcessResult {
|
|
2056
|
+
/**
|
|
2057
|
+
* The full past to the post-processed application package on the local file system .
|
|
2058
|
+
*
|
|
2059
|
+
* This might be a file or a folder path.
|
|
2060
|
+
*/
|
|
2061
|
+
appPath: string;
|
|
2062
|
+
}
|
|
2063
|
+
|
|
2064
|
+
/**
|
|
2065
|
+
* Information about a cached app instance.
|
|
2066
|
+
*/
|
|
2067
|
+
export interface CachedAppInfo {
|
|
2068
|
+
/**
|
|
2069
|
+
* SHA1 hash of the package if it is a file (and not a folder)
|
|
2070
|
+
*/
|
|
2071
|
+
packageHash: string;
|
|
2072
|
+
/**
|
|
2073
|
+
* Date instance; the value of the file's `Last-Modified` header
|
|
2074
|
+
*/
|
|
2075
|
+
lastModified?: Date;
|
|
2076
|
+
/**
|
|
2077
|
+
* `true` if the file contains an `immutable` mark in `Cache-control` header
|
|
2078
|
+
*/
|
|
2079
|
+
immutable?: boolean;
|
|
2080
|
+
/**
|
|
2081
|
+
* Integer representation of `maxAge` parameter in `Cache-control` header
|
|
2082
|
+
*/
|
|
2083
|
+
maxAge?: number;
|
|
2084
|
+
/**
|
|
2085
|
+
* The timestamp this item has been added to the cache (measured in Unix epoch milliseconds)
|
|
2086
|
+
*/
|
|
2087
|
+
timestamp?: number;
|
|
2088
|
+
/**
|
|
2089
|
+
* An object containing either `file` property with SHA1 hash of the file or `folder` property
|
|
2090
|
+
* with total amount of cached files and subfolders
|
|
2091
|
+
*/
|
|
2092
|
+
integrity?: {file?: string} | {folder?: number};
|
|
2093
|
+
/**
|
|
2094
|
+
* The full path to the cached app
|
|
2095
|
+
*/
|
|
2096
|
+
fullPath?: string;
|
|
2097
|
+
}
|
|
2098
|
+
|
|
2099
|
+
/**
|
|
2100
|
+
* Options for the post-processing step
|
|
2101
|
+
*
|
|
2102
|
+
* The generic can be supplied if using `axios`, where `headers` is a fancy object.
|
|
2103
|
+
*/
|
|
2104
|
+
export interface PostProcessOptions<Headers = HTTPHeaders> {
|
|
2105
|
+
/**
|
|
2106
|
+
* The information about the previously cached app instance (if exists)
|
|
2107
|
+
*/
|
|
2108
|
+
cachedAppInfo?: CachedAppInfo;
|
|
2109
|
+
/**
|
|
2110
|
+
* Whether the app has been downloaded from a remote URL
|
|
2111
|
+
*/
|
|
2112
|
+
isUrl?: boolean;
|
|
2113
|
+
/**
|
|
2114
|
+
* Optional headers object.
|
|
2115
|
+
*
|
|
2116
|
+
* Only present if `isUrl` is `true` and if the server responds to `HEAD` requests. All header names are normalized to lowercase.
|
|
2117
|
+
*/
|
|
2118
|
+
headers?: Headers;
|
|
2119
|
+
/**
|
|
2120
|
+
* A string containing full path to the preprocessed application package (either downloaded or a local one)
|
|
2121
|
+
*/
|
|
2122
|
+
appPath?: string;
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2125
|
+
export interface ConfigureAppOptions {
|
|
2126
|
+
/**
|
|
2127
|
+
*
|
|
2128
|
+
* Optional function, which should be applied to the application after it is
|
|
2129
|
+
* downloaded/preprocessed.
|
|
2130
|
+
*
|
|
2131
|
+
* This function may be async and is expected to accept single object parameter. The function is
|
|
2132
|
+
* expected to either return a falsy value, which means the app must not be cached and a fresh
|
|
2133
|
+
* copy of it is downloaded each time, _or_ if this function returns an object containing an
|
|
2134
|
+
* `appPath` property, then the integrity of it will be verified and stored into the cache.
|
|
2135
|
+
* @returns
|
|
2136
|
+
*/
|
|
2137
|
+
onPostProcess?: (
|
|
2138
|
+
obj: PostProcessOptions
|
|
2139
|
+
) => Promise<PostProcessResult | undefined> | PostProcessResult | undefined;
|
|
2140
|
+
supportedExtensions: string[];
|
|
2141
|
+
}
|