@appium/types 0.10.1 → 0.10.3
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/action.d.ts +1 -7
- package/build/lib/action.d.ts.map +1 -1
- package/build/lib/action.js.map +1 -1
- 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 +206 -281
- 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 +67 -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/action.ts +1 -7
- 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 +240 -345
- 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 +91 -0
- package/package.json +5 -4
package/build/lib/driver.d.ts
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { EventEmitter } from 'events';
|
|
3
|
-
import { Element, ActionSequence } from './action';
|
|
4
|
-
import { HTTPMethod, AppiumServer, UpdateServerCallback, Class, AppiumLogger, StringRecord, ConstraintsToCaps, BaseDriverCapConstraints, W3CCapabilities, Capabilities } from '.';
|
|
5
|
-
import { ServerArgs } from './config';
|
|
6
3
|
import { Entries } from 'type-fest';
|
|
7
|
-
import {
|
|
4
|
+
import { ActionSequence } from './action';
|
|
5
|
+
import { Capabilities, DriverCaps, W3CCapabilities, W3CDriverCaps } from './capabilities';
|
|
6
|
+
import { ExecuteMethodMap, MethodMap } from './command';
|
|
7
|
+
import { ServerArgs } from './config';
|
|
8
|
+
import { HTTPHeaders, HTTPMethod } from './http';
|
|
9
|
+
import { AppiumLogger } from './logger';
|
|
10
|
+
import { AppiumServer, UpdateServerCallback } from './server';
|
|
11
|
+
import { Class, StringRecord, Element } from './util';
|
|
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
|
+
}
|
|
8
19
|
export interface ITimeoutCommands {
|
|
9
20
|
/**
|
|
10
21
|
* Set the various timeouts associated with a session
|
|
@@ -29,6 +40,7 @@ export interface ITimeoutCommands {
|
|
|
29
40
|
* @param ms - the timeout in ms
|
|
30
41
|
*
|
|
31
42
|
* @deprecated Use `timeouts` instead
|
|
43
|
+
*
|
|
32
44
|
*/
|
|
33
45
|
implicitWait(ms: number | string): Promise<void>;
|
|
34
46
|
/**
|
|
@@ -135,7 +147,7 @@ export interface ISessionCommands {
|
|
|
135
147
|
*
|
|
136
148
|
* @returns A session data object
|
|
137
149
|
*/
|
|
138
|
-
getSession(): Promise<SingularSessionData
|
|
150
|
+
getSession<C extends Constraints>(): Promise<SingularSessionData<C>>;
|
|
139
151
|
}
|
|
140
152
|
export interface IExecuteCommands {
|
|
141
153
|
/**
|
|
@@ -147,13 +159,13 @@ export interface IExecuteCommands {
|
|
|
147
159
|
*
|
|
148
160
|
* @returns The result of calling the Execute Method
|
|
149
161
|
*/
|
|
150
|
-
executeMethod<TReturn =
|
|
162
|
+
executeMethod<TArgs extends readonly any[] | readonly [StringRecord<unknown>] = unknown[], TReturn = unknown>(script: string, args: TArgs): Promise<TReturn>;
|
|
151
163
|
}
|
|
152
|
-
export interface MultiSessionData<C extends Constraints =
|
|
164
|
+
export interface MultiSessionData<C extends Constraints = Constraints> {
|
|
153
165
|
id: string;
|
|
154
|
-
capabilities:
|
|
166
|
+
capabilities: DriverCaps<C>;
|
|
155
167
|
}
|
|
156
|
-
export type SingularSessionData<C extends Constraints =
|
|
168
|
+
export type SingularSessionData<C extends Constraints = Constraints> = DriverCaps<C> & {
|
|
157
169
|
events?: EventHistory;
|
|
158
170
|
error?: string;
|
|
159
171
|
};
|
|
@@ -269,7 +281,7 @@ export interface ILogCommands {
|
|
|
269
281
|
*
|
|
270
282
|
* @param logType - Name/key of log type as defined in {@linkcode ILogCommands.supportedLogTypes}.
|
|
271
283
|
*/
|
|
272
|
-
getLog(logType: string): Promise<
|
|
284
|
+
getLog(logType: string): Promise<unknown[]>;
|
|
273
285
|
}
|
|
274
286
|
/**
|
|
275
287
|
* A record of {@linkcode LogDef} objects, keyed by the log type name.
|
|
@@ -292,9 +304,9 @@ export interface LogDef {
|
|
|
292
304
|
*
|
|
293
305
|
* This implementation *should* drain, truncate or otherwise reset the log buffer.
|
|
294
306
|
*/
|
|
295
|
-
getter:
|
|
307
|
+
getter: (driver: any) => Promise<unknown[]> | unknown[];
|
|
296
308
|
}
|
|
297
|
-
export interface ISettingsCommands {
|
|
309
|
+
export interface ISettingsCommands<T extends StringRecord = StringRecord> {
|
|
298
310
|
/**
|
|
299
311
|
* Update the session's settings dictionary with a new settings object
|
|
300
312
|
*
|
|
@@ -307,9 +319,23 @@ export interface ISettingsCommands {
|
|
|
307
319
|
*
|
|
308
320
|
* @returns The settings object
|
|
309
321
|
*/
|
|
310
|
-
getSettings(): Promise<
|
|
322
|
+
getSettings(): Promise<T>;
|
|
311
323
|
}
|
|
312
|
-
|
|
324
|
+
/**
|
|
325
|
+
* @see {@linkcode ISessionHandler}
|
|
326
|
+
*/
|
|
327
|
+
export type DefaultCreateSessionResult<C extends Constraints> = [
|
|
328
|
+
sessionId: string,
|
|
329
|
+
capabilities: DriverCaps<C>
|
|
330
|
+
];
|
|
331
|
+
/**
|
|
332
|
+
* @see {@linkcode ISessionHandler}
|
|
333
|
+
*/
|
|
334
|
+
export type DefaultDeleteSessionResult = void;
|
|
335
|
+
/**
|
|
336
|
+
* An interface which creates and deletes sessions.
|
|
337
|
+
*/
|
|
338
|
+
export interface ISessionHandler<C extends Constraints = Constraints, CreateResult = DefaultCreateSessionResult<C>, DeleteResult = DefaultDeleteSessionResult> {
|
|
313
339
|
/**
|
|
314
340
|
* Start a new automation session
|
|
315
341
|
* @see {@link https://w3c.github.io/webdriver/#new-session}
|
|
@@ -327,7 +353,7 @@ export interface SessionHandler<CreateResult, DeleteResult, C extends Constraint
|
|
|
327
353
|
*
|
|
328
354
|
* @returns The capabilities object representing the created session
|
|
329
355
|
*/
|
|
330
|
-
createSession(w3cCaps1:
|
|
356
|
+
createSession(w3cCaps1: W3CDriverCaps<C>, w3cCaps2?: W3CDriverCaps<C>, w3cCaps3?: W3CDriverCaps<C>, driverData?: DriverData[]): Promise<CreateResult>;
|
|
331
357
|
/**
|
|
332
358
|
* Stop an automation session
|
|
333
359
|
* @see {@link https://w3c.github.io/webdriver/#delete-session}
|
|
@@ -341,19 +367,6 @@ export interface SessionHandler<CreateResult, DeleteResult, C extends Constraint
|
|
|
341
367
|
* Custom session data for a driver.
|
|
342
368
|
*/
|
|
343
369
|
export type DriverData = Record<string, unknown>;
|
|
344
|
-
/**
|
|
345
|
-
* Extensions can define new methods for the Appium server to map to command names, of the same
|
|
346
|
-
* format as used in Appium's `routes.js`.
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
* @example
|
|
350
|
-
* {
|
|
351
|
-
* '/session/:sessionId/new_method': {
|
|
352
|
-
* GET: {command: 'getNewThing'},
|
|
353
|
-
* POST: {command: 'setNewThing', payloadParams: {required: ['someParam']}}
|
|
354
|
-
* }
|
|
355
|
-
* }
|
|
356
|
-
*/
|
|
357
370
|
export interface Constraint {
|
|
358
371
|
readonly presence?: boolean | Readonly<{
|
|
359
372
|
allowEmpty: boolean;
|
|
@@ -364,22 +377,23 @@ export interface Constraint {
|
|
|
364
377
|
readonly isObject?: boolean;
|
|
365
378
|
readonly isArray?: boolean;
|
|
366
379
|
readonly deprecated?: boolean;
|
|
367
|
-
readonly inclusion?: Readonly<[
|
|
368
|
-
readonly inclusionCaseInsensitive?: Readonly<[
|
|
380
|
+
readonly inclusion?: Readonly<[string, ...string[]]>;
|
|
381
|
+
readonly inclusionCaseInsensitive?: Readonly<[string, ...string[]]>;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* A collection of constraints describing the allowed capabilities for a driver.
|
|
385
|
+
*/
|
|
386
|
+
export interface Constraints {
|
|
387
|
+
[name: string]: Constraint;
|
|
369
388
|
}
|
|
370
|
-
export
|
|
371
|
-
|
|
372
|
-
configureApp: (app: string, supportedAppExtensions: string[]) => Promise<string>;
|
|
389
|
+
export interface DriverHelpers {
|
|
390
|
+
configureApp: (app: string, supportedAppExtensions?: string | string[] | ConfigureAppOptions) => Promise<string>;
|
|
373
391
|
isPackageOrBundle: (app: string) => boolean;
|
|
374
392
|
duplicateKeys: <T>(input: T, firstKey: string, secondKey: string) => T;
|
|
375
393
|
parseCapsArray: (cap: string | string[]) => string[];
|
|
376
|
-
generateDriverLogPrefix: (obj: Core<C>, sessionId?: string) => string;
|
|
394
|
+
generateDriverLogPrefix: <C extends Constraints>(obj: Core<C>, sessionId?: string) => string;
|
|
377
395
|
}
|
|
378
396
|
export type SettingsUpdateListener<T extends Record<string, unknown> = Record<string, unknown>> = (prop: keyof T, newValue: unknown, curValue: unknown) => Promise<void>;
|
|
379
|
-
export interface DeviceSettings<T = any> {
|
|
380
|
-
update(newSettings: Record<string, T>): Promise<void>;
|
|
381
|
-
getSettings(): Record<string, T>;
|
|
382
|
-
}
|
|
383
397
|
export interface Rect {
|
|
384
398
|
x: number;
|
|
385
399
|
y: number;
|
|
@@ -461,13 +475,13 @@ export interface EventHistoryCommand {
|
|
|
461
475
|
*
|
|
462
476
|
* This should not be used directly by external code.
|
|
463
477
|
*/
|
|
464
|
-
export interface Core<C extends Constraints =
|
|
478
|
+
export interface Core<C extends Constraints, Settings extends StringRecord = StringRecord> {
|
|
465
479
|
shouldValidateCaps: boolean;
|
|
466
480
|
sessionId: string | null;
|
|
467
481
|
opts: DriverOpts<C>;
|
|
468
|
-
initialOpts:
|
|
482
|
+
initialOpts: Partial<DriverOpts<C>>;
|
|
469
483
|
protocol?: string;
|
|
470
|
-
helpers: DriverHelpers
|
|
484
|
+
helpers: DriverHelpers;
|
|
471
485
|
basePath: string;
|
|
472
486
|
relaxedSecurityEnabled: boolean;
|
|
473
487
|
allowInsecure: string[];
|
|
@@ -477,9 +491,9 @@ export interface Core<C extends Constraints = BaseDriverCapConstraints> {
|
|
|
477
491
|
locatorStrategies: string[];
|
|
478
492
|
webLocatorStrategies: string[];
|
|
479
493
|
eventEmitter: EventEmitter;
|
|
480
|
-
settings:
|
|
494
|
+
settings: IDeviceSettings<Settings>;
|
|
481
495
|
log: AppiumLogger;
|
|
482
|
-
driverData
|
|
496
|
+
driverData: DriverData;
|
|
483
497
|
isCommandsQueueEnabled: boolean;
|
|
484
498
|
eventHistory: EventHistory;
|
|
485
499
|
onUnexpectedShutdown(handler: () => any): void;
|
|
@@ -515,7 +529,7 @@ export interface Core<C extends Constraints = BaseDriverCapConstraints> {
|
|
|
515
529
|
* ```
|
|
516
530
|
*/
|
|
517
531
|
getStatus(): Promise<any>;
|
|
518
|
-
sessionExists(sessionId
|
|
532
|
+
sessionExists(sessionId?: string): boolean;
|
|
519
533
|
isW3CProtocol(): boolean;
|
|
520
534
|
isMjsonwpProtocol(): boolean;
|
|
521
535
|
isFeatureEnabled(name: string): boolean;
|
|
@@ -537,13 +551,17 @@ export interface Core<C extends Constraints = BaseDriverCapConstraints> {
|
|
|
537
551
|
*
|
|
538
552
|
* `C` should be the constraints of the driver.
|
|
539
553
|
* `CArgs` would be the shape of `cliArgs`.
|
|
540
|
-
* `
|
|
554
|
+
* `Settings` is the shape of the raw device settings object (see {@linkcode IDeviceSettings})
|
|
541
555
|
*/
|
|
542
|
-
export interface Driver<C extends Constraints = Constraints, CArgs extends StringRecord = StringRecord> extends ISessionCommands, ILogCommands, IFindCommands, ISettingsCommands
|
|
556
|
+
export interface Driver<C extends Constraints = Constraints, CArgs extends StringRecord = StringRecord, Settings extends StringRecord = StringRecord, CreateResult = DefaultCreateSessionResult<C>, DeleteResult = DefaultDeleteSessionResult> extends ISessionCommands, ILogCommands, IFindCommands, ISettingsCommands<Settings>, ITimeoutCommands, IEventCommands, IExecuteCommands, ISessionHandler<C, CreateResult, DeleteResult>, Core<C, Settings> {
|
|
543
557
|
/**
|
|
544
558
|
* The set of command line arguments set for this driver
|
|
545
559
|
*/
|
|
546
560
|
cliArgs: CArgs;
|
|
561
|
+
server?: AppiumServer;
|
|
562
|
+
serverHost?: string;
|
|
563
|
+
serverPort?: number;
|
|
564
|
+
serverPath?: string;
|
|
547
565
|
/**
|
|
548
566
|
* Execute a driver (WebDriver-protocol) command by its name as defined in the routes file
|
|
549
567
|
*
|
|
@@ -569,6 +587,7 @@ export interface Driver<C extends Constraints = Constraints, CArgs extends Strin
|
|
|
569
587
|
* Reset the current session (run the delete session and create session subroutines)
|
|
570
588
|
*
|
|
571
589
|
* @deprecated Use explicit session management commands instead
|
|
590
|
+
* @privateRemarks This is implemented by `BaseDriver` and is used within `@appium/driver-test-support`
|
|
572
591
|
*/
|
|
573
592
|
reset(): Promise<void>;
|
|
574
593
|
/**
|
|
@@ -598,11 +617,7 @@ export interface Driver<C extends Constraints = Constraints, CArgs extends Strin
|
|
|
598
617
|
* External drivers must subclass `BaseDriver`, and can implement any of these methods.
|
|
599
618
|
* None of these are implemented within Appium itself.
|
|
600
619
|
*/
|
|
601
|
-
export interface ExternalDriver<C extends Constraints = Constraints> extends Driver<C> {
|
|
602
|
-
server?: AppiumServer;
|
|
603
|
-
serverHost?: string;
|
|
604
|
-
serverPort?: number;
|
|
605
|
-
serverPath?: string;
|
|
620
|
+
export interface ExternalDriver<C extends Constraints = Constraints, Ctx = string> extends Driver<C> {
|
|
606
621
|
/**
|
|
607
622
|
* Navigate to a given url
|
|
608
623
|
* @see {@link https://w3c.github.io/webdriver/#navigate-to}
|
|
@@ -990,12 +1005,6 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
990
1005
|
* @returns A base64-encoded string representing the PNG image data for the element rect
|
|
991
1006
|
*/
|
|
992
1007
|
getElementScreenshot?(elementId: string): Promise<string>;
|
|
993
|
-
/**
|
|
994
|
-
* Shake the device
|
|
995
|
-
*
|
|
996
|
-
* @deprecated
|
|
997
|
-
*/
|
|
998
|
-
mobileShake?(): Promise<void>;
|
|
999
1008
|
/**
|
|
1000
1009
|
* Get the current time on the device under timeouts
|
|
1001
1010
|
*
|
|
@@ -1004,47 +1013,6 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1004
1013
|
* @returns The formatted time
|
|
1005
1014
|
*/
|
|
1006
1015
|
getDeviceTime?(format?: string): Promise<string>;
|
|
1007
|
-
/**
|
|
1008
|
-
* Lock the device, and optionally unlock the device after a certain amount of time
|
|
1009
|
-
*
|
|
1010
|
-
* @param seconds - the number of seconds after which to unlock the device. Set to zero or leave
|
|
1011
|
-
* empty to not unlock the device automatically
|
|
1012
|
-
*
|
|
1013
|
-
* @deprecated
|
|
1014
|
-
*/
|
|
1015
|
-
lock?(seconds?: number): Promise<void>;
|
|
1016
|
-
/**
|
|
1017
|
-
* Unlock the device
|
|
1018
|
-
*
|
|
1019
|
-
* @deprecated
|
|
1020
|
-
*/
|
|
1021
|
-
unlock?(): Promise<void>;
|
|
1022
|
-
/**
|
|
1023
|
-
* Determine whether the device is locked
|
|
1024
|
-
*
|
|
1025
|
-
* @returns True if the device is locked, false otherwise
|
|
1026
|
-
*
|
|
1027
|
-
* @deprecated
|
|
1028
|
-
*/
|
|
1029
|
-
isLocked?(): Promise<boolean>;
|
|
1030
|
-
/**
|
|
1031
|
-
* Direct Appium to start recording the device screen
|
|
1032
|
-
*
|
|
1033
|
-
* @param options - parameters for screen recording
|
|
1034
|
-
*
|
|
1035
|
-
* @deprecated
|
|
1036
|
-
*/
|
|
1037
|
-
startRecordingScreen?(options?: StartScreenRecordOptions): Promise<void>;
|
|
1038
|
-
/**
|
|
1039
|
-
* Direct Appium to stop screen recording and return the video
|
|
1040
|
-
*
|
|
1041
|
-
* @param options - parameters for stopping like video Uploading
|
|
1042
|
-
*
|
|
1043
|
-
* @returns The base64-encoded video data
|
|
1044
|
-
*
|
|
1045
|
-
* @deprecated
|
|
1046
|
-
*/
|
|
1047
|
-
stopRecordingScreen?(options?: StopScreenRecordOptions): Promise<string>;
|
|
1048
1016
|
/**
|
|
1049
1017
|
* List the performance data types supported by this driver, which can be used in a call to get
|
|
1050
1018
|
* the performance data by type.
|
|
@@ -1052,6 +1020,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1052
1020
|
* @returns The list of types
|
|
1053
1021
|
*
|
|
1054
1022
|
* @deprecated
|
|
1023
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1055
1024
|
*/
|
|
1056
1025
|
getPerformanceDataTypes?(): Promise<string[]>;
|
|
1057
1026
|
/**
|
|
@@ -1065,6 +1034,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1065
1034
|
* @returns A list of performance data strings
|
|
1066
1035
|
*
|
|
1067
1036
|
* @deprecated
|
|
1037
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1068
1038
|
*/
|
|
1069
1039
|
getPerformanceData?(packageName: string, dataType: string, dataReadTimeout?: number): Promise<string[]>;
|
|
1070
1040
|
/**
|
|
@@ -1075,6 +1045,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1075
1045
|
* @param flags - the code denoting the combination of extra flags
|
|
1076
1046
|
*
|
|
1077
1047
|
* @deprecated
|
|
1048
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1078
1049
|
*/
|
|
1079
1050
|
pressKeyCode?(keycode: number, metastate?: number, flags?: number): Promise<void>;
|
|
1080
1051
|
/**
|
|
@@ -1085,6 +1056,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1085
1056
|
* @param flags - the code denoting the combination of extra flags
|
|
1086
1057
|
*
|
|
1087
1058
|
* @deprecated
|
|
1059
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1088
1060
|
*/
|
|
1089
1061
|
longPressKeyCode?(keycode: number, metastate?: number, flags?: number): Promise<void>;
|
|
1090
1062
|
/**
|
|
@@ -1093,6 +1065,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1093
1065
|
* @param fingerprintId - the numeric ID of the fingerprint to use
|
|
1094
1066
|
*
|
|
1095
1067
|
* @deprecated
|
|
1068
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1096
1069
|
*/
|
|
1097
1070
|
fingerprint?(fingerprintId: number): Promise<void>;
|
|
1098
1071
|
/**
|
|
@@ -1102,6 +1075,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1102
1075
|
* @param message - the SMS text
|
|
1103
1076
|
*
|
|
1104
1077
|
* @deprecated
|
|
1078
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1105
1079
|
*/
|
|
1106
1080
|
sendSMS?(phoneNumber: string, message: string): Promise<void>;
|
|
1107
1081
|
/**
|
|
@@ -1112,6 +1086,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1112
1086
|
* @param action - the action to take in response (accept, reject, etc...)
|
|
1113
1087
|
*
|
|
1114
1088
|
* @deprecated
|
|
1089
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1115
1090
|
*/
|
|
1116
1091
|
gsmCall?(phoneNumber: string, action: string): Promise<void>;
|
|
1117
1092
|
/**
|
|
@@ -1120,6 +1095,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1120
1095
|
* @param singalStrength - the strength in a driver-appropriate string
|
|
1121
1096
|
*
|
|
1122
1097
|
* @deprecated
|
|
1098
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1123
1099
|
*/
|
|
1124
1100
|
gsmSignal?(signalStrength: string): Promise<void>;
|
|
1125
1101
|
/**
|
|
@@ -1128,6 +1104,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1128
1104
|
* @param state - the state
|
|
1129
1105
|
*
|
|
1130
1106
|
* @deprecated
|
|
1107
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1131
1108
|
*/
|
|
1132
1109
|
gsmVoice?(state: string): Promise<void>;
|
|
1133
1110
|
/**
|
|
@@ -1136,6 +1113,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1136
1113
|
* @param percent - how full the battery should become
|
|
1137
1114
|
*
|
|
1138
1115
|
* @deprecated
|
|
1116
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1139
1117
|
*/
|
|
1140
1118
|
powerCapacity?(percent: number): Promise<void>;
|
|
1141
1119
|
/**
|
|
@@ -1144,6 +1122,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1144
1122
|
* @param state - whether the device is connected to power or not
|
|
1145
1123
|
*
|
|
1146
1124
|
* @deprecated
|
|
1125
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1147
1126
|
*/
|
|
1148
1127
|
powerAC?(state: string): Promise<void>;
|
|
1149
1128
|
/**
|
|
@@ -1152,6 +1131,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1152
1131
|
* @param netspeed - the speed as a string, like '3G'
|
|
1153
1132
|
*
|
|
1154
1133
|
* @deprecated
|
|
1134
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1155
1135
|
*/
|
|
1156
1136
|
networkSpeed?(netspeed: string): Promise<void>;
|
|
1157
1137
|
/**
|
|
@@ -1161,6 +1141,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1161
1141
|
* @param metastate - the combination of meta startUnexpectedShutdown
|
|
1162
1142
|
*
|
|
1163
1143
|
* @deprecated
|
|
1144
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1164
1145
|
*/
|
|
1165
1146
|
keyevent?(keycode: string, metastate?: string): Promise<void>;
|
|
1166
1147
|
/**
|
|
@@ -1174,6 +1155,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1174
1155
|
* @param elementId - if we're rotating around an element
|
|
1175
1156
|
*
|
|
1176
1157
|
* @deprecated Use setRotation instead
|
|
1158
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1177
1159
|
*/
|
|
1178
1160
|
mobileRotation?(x: number, y: number, radius: number, rotation: number, touchCount: number, duration: string, elementId?: string): Promise<void>;
|
|
1179
1161
|
/**
|
|
@@ -1182,6 +1164,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1182
1164
|
* @returns The activity name
|
|
1183
1165
|
*
|
|
1184
1166
|
* @deprecated
|
|
1167
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1185
1168
|
*/
|
|
1186
1169
|
getCurrentActivity?(): Promise<string>;
|
|
1187
1170
|
/**
|
|
@@ -1190,6 +1173,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1190
1173
|
* @returns The package name
|
|
1191
1174
|
*
|
|
1192
1175
|
* @deprecated
|
|
1176
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1193
1177
|
*/
|
|
1194
1178
|
getCurrentPackage?(): Promise<string>;
|
|
1195
1179
|
/**
|
|
@@ -1231,10 +1215,11 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1231
1215
|
*
|
|
1232
1216
|
* @param appId - the package or bundle ID of the application
|
|
1233
1217
|
*
|
|
1234
|
-
* @returns A number representing the state. 0 means not installed, 1 means not running,
|
|
1235
|
-
* running in
|
|
1218
|
+
* @returns A number representing the state. `0` means not installed, `1` means not running, `2`
|
|
1219
|
+
* means running in background but suspended, `3` means running in the background, and `4` means
|
|
1220
|
+
* running in the foreground
|
|
1236
1221
|
*/
|
|
1237
|
-
queryAppState?(appId: string): Promise<0 | 1 | 3 | 4>;
|
|
1222
|
+
queryAppState?(appId: string): Promise<0 | 1 | 2 | 3 | 4>;
|
|
1238
1223
|
/**
|
|
1239
1224
|
* Attempt to hide a virtual keyboard
|
|
1240
1225
|
*
|
|
@@ -1277,30 +1262,35 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1277
1262
|
* Toggle airplane/flight mode for the device
|
|
1278
1263
|
*
|
|
1279
1264
|
* @deprecated
|
|
1265
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1280
1266
|
*/
|
|
1281
1267
|
toggleFlightMode?(): Promise<void>;
|
|
1282
1268
|
/**
|
|
1283
1269
|
* Toggle cell network data
|
|
1284
1270
|
*
|
|
1285
1271
|
* @deprecated
|
|
1272
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1286
1273
|
*/
|
|
1287
1274
|
toggleData?(): Promise<void>;
|
|
1288
1275
|
/**
|
|
1289
1276
|
* Toggle WiFi radio status
|
|
1290
1277
|
*
|
|
1291
1278
|
* @deprecated
|
|
1279
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1292
1280
|
*/
|
|
1293
1281
|
toggleWiFi?(): Promise<void>;
|
|
1294
1282
|
/**
|
|
1295
1283
|
* Toggle location services for the device
|
|
1296
1284
|
*
|
|
1297
1285
|
* @deprecated
|
|
1286
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1298
1287
|
*/
|
|
1299
1288
|
toggleLocationServices?(): Promise<void>;
|
|
1300
1289
|
/**
|
|
1301
1290
|
* Open the notifications shade/screen
|
|
1302
1291
|
*
|
|
1303
1292
|
* @deprecated
|
|
1293
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1304
1294
|
*/
|
|
1305
1295
|
openNotifications?(): Promise<void>;
|
|
1306
1296
|
/**
|
|
@@ -1319,6 +1309,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1319
1309
|
* activity
|
|
1320
1310
|
*
|
|
1321
1311
|
* @deprecated
|
|
1312
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1322
1313
|
*/
|
|
1323
1314
|
startActivity?(appPackage: string, appActivity: string, appWaitPackage?: string, appWaitActivity?: string, intentAction?: string, intentCategory?: string, intentFlags?: string, optionalIntentArguments?: string, dontStopAppOnReset?: boolean): Promise<void>;
|
|
1324
1315
|
/**
|
|
@@ -1327,6 +1318,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1327
1318
|
* @returns An array of information objects of driver-specific shape
|
|
1328
1319
|
*
|
|
1329
1320
|
* @deprecated
|
|
1321
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1330
1322
|
*/
|
|
1331
1323
|
getSystemBars?(): Promise<unknown[]>;
|
|
1332
1324
|
/**
|
|
@@ -1335,44 +1327,9 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1335
1327
|
* @returns The density
|
|
1336
1328
|
*
|
|
1337
1329
|
* @deprecated
|
|
1330
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1338
1331
|
*/
|
|
1339
1332
|
getDisplayDensity?(): Promise<number>;
|
|
1340
|
-
/**
|
|
1341
|
-
* Trigger a touch/fingerprint match or match failure
|
|
1342
|
-
*
|
|
1343
|
-
* @param match - whether the match should be a success or failure
|
|
1344
|
-
*
|
|
1345
|
-
* @deprecated
|
|
1346
|
-
*/
|
|
1347
|
-
touchId?(match: boolean): Promise<void>;
|
|
1348
|
-
/**
|
|
1349
|
-
* Toggle whether the device is enrolled in the touch ID program
|
|
1350
|
-
*
|
|
1351
|
-
* @param enabled - whether to enable or disable the touch ID program
|
|
1352
|
-
*
|
|
1353
|
-
* @deprecated
|
|
1354
|
-
*/
|
|
1355
|
-
toggleEnrollTouchId?(enabled: boolean): Promise<void>;
|
|
1356
|
-
/**
|
|
1357
|
-
* Start the session after it has been started.
|
|
1358
|
-
*
|
|
1359
|
-
* @deprecated Don't use this, it never made sense.
|
|
1360
|
-
*/
|
|
1361
|
-
launchApp?(): Promise<void>;
|
|
1362
|
-
/**
|
|
1363
|
-
* Stop the session without stopping the session
|
|
1364
|
-
*
|
|
1365
|
-
* @deprecated Don't use this, it never made sense.
|
|
1366
|
-
*/
|
|
1367
|
-
closeApp?(): Promise<void>;
|
|
1368
|
-
/**
|
|
1369
|
-
* Background (close) the app either permanently or for a certain amount of time
|
|
1370
|
-
*
|
|
1371
|
-
* @param seconds - the number of seconds to background the app for, or `null` for permanently
|
|
1372
|
-
*
|
|
1373
|
-
* @deprecated
|
|
1374
|
-
*/
|
|
1375
|
-
background?(seconds: null | number): Promise<void>;
|
|
1376
1333
|
/**
|
|
1377
1334
|
* End platform-specific code coverage tracing
|
|
1378
1335
|
*
|
|
@@ -1380,28 +1337,9 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1380
1337
|
* @param path - the path to place the results
|
|
1381
1338
|
*
|
|
1382
1339
|
* @deprecated
|
|
1340
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1383
1341
|
*/
|
|
1384
1342
|
endCoverage?(intent: string, path: string): Promise<void>;
|
|
1385
|
-
/**
|
|
1386
|
-
* Return the language-specific strings for an app
|
|
1387
|
-
*
|
|
1388
|
-
* @param language - the language to retrieve strings for
|
|
1389
|
-
* @param stringFile - the path to the localized strings file if not in the default location
|
|
1390
|
-
*
|
|
1391
|
-
* @returns A record of localized keys to localized text
|
|
1392
|
-
*
|
|
1393
|
-
* @deprecated
|
|
1394
|
-
*/
|
|
1395
|
-
getStrings?(language?: string, stringFile?: string): Promise<Record<string, unknown>>;
|
|
1396
|
-
/**
|
|
1397
|
-
* Set the value, but like, now? Don't use this.
|
|
1398
|
-
*
|
|
1399
|
-
* @param value - the value to set
|
|
1400
|
-
* @param elementId - the element to set the value of
|
|
1401
|
-
*
|
|
1402
|
-
* @deprecated
|
|
1403
|
-
*/
|
|
1404
|
-
setValueImmediate?(value: string, elementId: string): Promise<void>;
|
|
1405
1343
|
/**
|
|
1406
1344
|
* Set the value of a text field but ensure the current value is replace and not appended
|
|
1407
1345
|
*
|
|
@@ -1409,83 +1347,9 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1409
1347
|
* @param elementId - the element to set it in
|
|
1410
1348
|
*
|
|
1411
1349
|
* @deprecated
|
|
1350
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1412
1351
|
*/
|
|
1413
1352
|
replaceValue?(value: string, elementId: string): Promise<void>;
|
|
1414
|
-
/**
|
|
1415
|
-
* Collect the response of an async script execution? It's unclear what this is for. Don't use
|
|
1416
|
-
* it.
|
|
1417
|
-
*
|
|
1418
|
-
* @param response - idk
|
|
1419
|
-
*
|
|
1420
|
-
* @deprecated
|
|
1421
|
-
*/
|
|
1422
|
-
receiveAsyncResponse?(response: unknown): Promise<void>;
|
|
1423
|
-
/**
|
|
1424
|
-
* Set the contents of the device clipboard
|
|
1425
|
-
*
|
|
1426
|
-
* @param content - the text to set
|
|
1427
|
-
* @param contentType - the media type if not text
|
|
1428
|
-
* @param label - the label if not text
|
|
1429
|
-
*
|
|
1430
|
-
* @deprecated
|
|
1431
|
-
*/
|
|
1432
|
-
setClipboard?(content: string, contentType?: string, label?: string): Promise<void>;
|
|
1433
|
-
/**
|
|
1434
|
-
* Get the contents of the device clipboard, converted into an appropriate media type
|
|
1435
|
-
*
|
|
1436
|
-
* @param contentType - the media type if not text
|
|
1437
|
-
*
|
|
1438
|
-
* @returns The text or media content (base64-encoded) of the clipboard
|
|
1439
|
-
*
|
|
1440
|
-
* @deprecated
|
|
1441
|
-
*/
|
|
1442
|
-
getClipboard?(contentType?: string): Promise<string>;
|
|
1443
|
-
/**
|
|
1444
|
-
* Set the async execute script timeout
|
|
1445
|
-
*
|
|
1446
|
-
* @param ms - the timeout
|
|
1447
|
-
*
|
|
1448
|
-
* @deprecated Use the W3C timeouts command instead
|
|
1449
|
-
*/
|
|
1450
|
-
asyncScriptTimeout?(ms: number): Promise<void>;
|
|
1451
|
-
/**
|
|
1452
|
-
* Get the window size
|
|
1453
|
-
*
|
|
1454
|
-
* @returns The size (width and height)
|
|
1455
|
-
*
|
|
1456
|
-
* @deprecated Use getWindowRect instead
|
|
1457
|
-
*/
|
|
1458
|
-
getWindowSize?(): Promise<Size>;
|
|
1459
|
-
/**
|
|
1460
|
-
* Get the position of an element on screen
|
|
1461
|
-
*
|
|
1462
|
-
* @param elementId - the element ID
|
|
1463
|
-
*
|
|
1464
|
-
* @returns The position of the element
|
|
1465
|
-
*
|
|
1466
|
-
* @deprecated Use getElementRect instead
|
|
1467
|
-
*/
|
|
1468
|
-
getLocation?(elementId: string): Promise<Position>;
|
|
1469
|
-
/**
|
|
1470
|
-
* Get the position of an element on screen within a certain other view
|
|
1471
|
-
*
|
|
1472
|
-
* @param elementId - the element ID
|
|
1473
|
-
*
|
|
1474
|
-
* @returns The position of the element
|
|
1475
|
-
*
|
|
1476
|
-
* @deprecated Use getElementRect instead
|
|
1477
|
-
*/
|
|
1478
|
-
getLocationInView?(elementId: string): Promise<Position>;
|
|
1479
|
-
/**
|
|
1480
|
-
* Get the size of an element
|
|
1481
|
-
*
|
|
1482
|
-
* @param elementId - the element ID
|
|
1483
|
-
*
|
|
1484
|
-
* @returns The size of the element
|
|
1485
|
-
*
|
|
1486
|
-
* @deprecated Use getElementRect instead
|
|
1487
|
-
*/
|
|
1488
|
-
getSize?(elementId: string): Promise<Size>;
|
|
1489
1353
|
/**
|
|
1490
1354
|
* Check whether two elements are identical
|
|
1491
1355
|
*
|
|
@@ -1495,30 +1359,16 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1495
1359
|
* @returns True if the elements are equal, false otherwise
|
|
1496
1360
|
*
|
|
1497
1361
|
* @deprecated
|
|
1362
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1498
1363
|
*/
|
|
1499
1364
|
equalsElement?(elementId: string, otherElementId: string): Promise<boolean>;
|
|
1500
|
-
/**
|
|
1501
|
-
* Submit the form an element is in
|
|
1502
|
-
*
|
|
1503
|
-
* @param elementId - the element ID
|
|
1504
|
-
*
|
|
1505
|
-
* @deprecated
|
|
1506
|
-
*/
|
|
1507
|
-
submit?(elementId: string): Promise<void>;
|
|
1508
|
-
/**
|
|
1509
|
-
* Send keys to the app
|
|
1510
|
-
*
|
|
1511
|
-
* @param value: the array of keys to send
|
|
1512
|
-
*
|
|
1513
|
-
* @deprecated Use the W3C send keys method instead
|
|
1514
|
-
*/
|
|
1515
|
-
keys?(value: string[]): Promise<void>;
|
|
1516
1365
|
/**
|
|
1517
1366
|
* Get the list of IME engines
|
|
1518
1367
|
*
|
|
1519
1368
|
* @returns The list of IME engines
|
|
1520
1369
|
*
|
|
1521
1370
|
* @deprecated
|
|
1371
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1522
1372
|
*/
|
|
1523
1373
|
availableIMEEngines?(): Promise<string[]>;
|
|
1524
1374
|
/**
|
|
@@ -1527,6 +1377,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1527
1377
|
* @returns The name of the active engine
|
|
1528
1378
|
*
|
|
1529
1379
|
* @deprecated
|
|
1380
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1530
1381
|
*/
|
|
1531
1382
|
getActiveIMEEngine?(): Promise<string>;
|
|
1532
1383
|
/**
|
|
@@ -1535,12 +1386,14 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1535
1386
|
* @returns True if the IME is activated
|
|
1536
1387
|
*
|
|
1537
1388
|
* @deprecated
|
|
1389
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1538
1390
|
*/
|
|
1539
1391
|
isIMEActivated?(): Promise<boolean>;
|
|
1540
1392
|
/**
|
|
1541
1393
|
* Deactivate an IME engine
|
|
1542
1394
|
*
|
|
1543
1395
|
* @deprecated
|
|
1396
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1544
1397
|
*/
|
|
1545
1398
|
deactivateIMEEngine?(): Promise<void>;
|
|
1546
1399
|
/**
|
|
@@ -1549,6 +1402,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1549
1402
|
* @param engine - the name of the engine
|
|
1550
1403
|
*
|
|
1551
1404
|
* @deprecated
|
|
1405
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1552
1406
|
*/
|
|
1553
1407
|
activateIMEEngine?(engine: string): Promise<void>;
|
|
1554
1408
|
/**
|
|
@@ -1563,22 +1417,13 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1563
1417
|
* @param orientation - the orientation string
|
|
1564
1418
|
*/
|
|
1565
1419
|
setOrientation?(orientation: string): Promise<void>;
|
|
1566
|
-
/**
|
|
1567
|
-
* Move the mouse pointer to a particular screen location
|
|
1568
|
-
*
|
|
1569
|
-
* @param element - the element ID if the move is relative to an element
|
|
1570
|
-
* @param xOffset - the x offset
|
|
1571
|
-
* @param yOffset - the y offset
|
|
1572
|
-
*
|
|
1573
|
-
* @deprecated Use the Actions API instead
|
|
1574
|
-
*/
|
|
1575
|
-
moveTo?(element?: null | string, xOffset?: number, yOffset?: number): Promise<void>;
|
|
1576
1420
|
/**
|
|
1577
1421
|
* Trigger a mouse button down
|
|
1578
1422
|
*
|
|
1579
1423
|
* @param button - the button ID
|
|
1580
1424
|
*
|
|
1581
1425
|
* @deprecated Use the Actions API instead
|
|
1426
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1582
1427
|
*/
|
|
1583
1428
|
buttonDown?(button?: number): Promise<void>;
|
|
1584
1429
|
/**
|
|
@@ -1587,6 +1432,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1587
1432
|
* @param button - the button ID
|
|
1588
1433
|
*
|
|
1589
1434
|
* @deprecated Use the Actions API instead
|
|
1435
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1590
1436
|
*/
|
|
1591
1437
|
buttonUp?(button?: number): Promise<void>;
|
|
1592
1438
|
/**
|
|
@@ -1595,12 +1441,14 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1595
1441
|
* @param button - the button ID
|
|
1596
1442
|
*
|
|
1597
1443
|
* @deprecated Use the Actions API instead
|
|
1444
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1598
1445
|
*/
|
|
1599
1446
|
clickCurrent?(button?: number): Promise<void>;
|
|
1600
1447
|
/**
|
|
1601
1448
|
* Double-click the current mouse location
|
|
1602
1449
|
*
|
|
1603
1450
|
* @deprecated Use the Actions API instead
|
|
1451
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1604
1452
|
*/
|
|
1605
1453
|
doubleClick?(): Promise<void>;
|
|
1606
1454
|
/**
|
|
@@ -1610,6 +1458,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1610
1458
|
* @param y - the y coordinate
|
|
1611
1459
|
*
|
|
1612
1460
|
* @deprecated Use the Actions API instead
|
|
1461
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1613
1462
|
*/
|
|
1614
1463
|
touchDown?(x: number, y: number): Promise<void>;
|
|
1615
1464
|
/**
|
|
@@ -1619,6 +1468,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1619
1468
|
* @param y - the y coordinate
|
|
1620
1469
|
*
|
|
1621
1470
|
* @deprecated Use the Actions API instead
|
|
1471
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1622
1472
|
*/
|
|
1623
1473
|
touchUp?(x: number, y: number): Promise<void>;
|
|
1624
1474
|
/**
|
|
@@ -1628,6 +1478,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1628
1478
|
* @param y - the y coordinate
|
|
1629
1479
|
*
|
|
1630
1480
|
* @deprecated Use the Actions API instead
|
|
1481
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1631
1482
|
*/
|
|
1632
1483
|
touchMove?(x: number, y: number): Promise<void>;
|
|
1633
1484
|
/**
|
|
@@ -1636,6 +1487,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1636
1487
|
* @param elementId - the id of the element to long touch
|
|
1637
1488
|
*
|
|
1638
1489
|
* @deprecated Use the Actions API instead
|
|
1490
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1639
1491
|
*/
|
|
1640
1492
|
touchLongClick?(elementId: string): Promise<void>;
|
|
1641
1493
|
/**
|
|
@@ -1649,6 +1501,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1649
1501
|
* @param speed - the speed (unclear how this relates to xSpeed and ySpeed)
|
|
1650
1502
|
*
|
|
1651
1503
|
* @deprecated Use the Actions API instead
|
|
1504
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1652
1505
|
*/
|
|
1653
1506
|
flick?(element?: string, xSpeed?: number, ySpeed?: number, xOffset?: number, yOffset?: number, speed?: number): Promise<void>;
|
|
1654
1507
|
/**
|
|
@@ -1669,21 +1522,21 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1669
1522
|
*
|
|
1670
1523
|
* @returns The context name
|
|
1671
1524
|
*/
|
|
1672
|
-
getCurrentContext?(): Promise<
|
|
1525
|
+
getCurrentContext?(): Promise<Ctx | null>;
|
|
1673
1526
|
/**
|
|
1674
1527
|
* Switch to a context by name
|
|
1675
1528
|
* @see {@link https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#webviews-and-other-contexts}
|
|
1676
1529
|
*
|
|
1677
1530
|
* @param name - the context name
|
|
1678
1531
|
*/
|
|
1679
|
-
setContext?(name: string): Promise<void>;
|
|
1532
|
+
setContext?(name: string, ...args: any[]): Promise<void>;
|
|
1680
1533
|
/**
|
|
1681
1534
|
* Get the list of available contexts
|
|
1682
1535
|
* @see {@link https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#webviews-and-other-contexts}
|
|
1683
1536
|
*
|
|
1684
1537
|
* @returns The list of context names
|
|
1685
1538
|
*/
|
|
1686
|
-
getContexts?(): Promise<
|
|
1539
|
+
getContexts?(): Promise<Ctx[]>;
|
|
1687
1540
|
/**
|
|
1688
1541
|
* Get the index of an element on the page
|
|
1689
1542
|
*
|
|
@@ -1692,6 +1545,7 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1692
1545
|
* @returns The page index
|
|
1693
1546
|
*
|
|
1694
1547
|
* @deprecated
|
|
1548
|
+
* @privateRemarks Not implemented in `appium-xcuitest-driver`
|
|
1695
1549
|
*/
|
|
1696
1550
|
getPageIndex?(elementId: string): Promise<string>;
|
|
1697
1551
|
/**
|
|
@@ -1709,23 +1563,6 @@ export interface ExternalDriver<C extends Constraints = Constraints> extends Dri
|
|
|
1709
1563
|
* @param type - the bitmask representing network state
|
|
1710
1564
|
*/
|
|
1711
1565
|
setNetworkConnection?(type: number): Promise<void>;
|
|
1712
|
-
/**
|
|
1713
|
-
* Perform a set of touch actions
|
|
1714
|
-
*
|
|
1715
|
-
* @param actions - the old MJSONWP style touch action objects
|
|
1716
|
-
*
|
|
1717
|
-
* @deprecated Use the W3C Actions API instead
|
|
1718
|
-
*/
|
|
1719
|
-
performTouch?(actions: unknown): Promise<void>;
|
|
1720
|
-
/**
|
|
1721
|
-
* Perform a set of touch actions
|
|
1722
|
-
*
|
|
1723
|
-
* @param actions - the old MJSONWP style touch action objects
|
|
1724
|
-
* @param elementId - the id of an element if actions are restricted to one element
|
|
1725
|
-
*
|
|
1726
|
-
* @deprecated Use the W3C Actions API instead
|
|
1727
|
-
*/
|
|
1728
|
-
performMultiAction?(actions: unknown, elementId: string): Promise<void>;
|
|
1729
1566
|
/**
|
|
1730
1567
|
* Get the current rotation state of the device
|
|
1731
1568
|
* @see {@link https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-rotation}
|
|
@@ -1851,16 +1688,104 @@ export interface ExtraDriverOpts {
|
|
|
1851
1688
|
*
|
|
1852
1689
|
* The combination happens within Appium prior to calling the constructor.
|
|
1853
1690
|
*/
|
|
1854
|
-
export type DriverOpts<C extends Constraints
|
|
1691
|
+
export type DriverOpts<C extends Constraints> = ServerArgs & ExtraDriverOpts & DriverCaps<C>;
|
|
1855
1692
|
/**
|
|
1856
1693
|
* An instance method of a driver class, whose name may be referenced by {@linkcode MethodDef.command}, and serves as an Appium command.
|
|
1857
1694
|
*
|
|
1858
1695
|
* Note that this signature differs from a `PluginCommand`.
|
|
1859
1696
|
*/
|
|
1860
|
-
export type DriverCommand<TArgs = any, TRetval = unknown> = (...args: TArgs
|
|
1861
|
-
export type DriverCommands<TArgs = any, TReturn = unknown> = Record<string, DriverCommand<TArgs, TReturn>>;
|
|
1697
|
+
export type DriverCommand<TArgs extends readonly any[] = any[], TRetval = unknown> = (...args: TArgs) => Promise<TRetval>;
|
|
1862
1698
|
/**
|
|
1863
1699
|
* Tuple of an HTTP method with a regex matching a request path
|
|
1864
1700
|
*/
|
|
1865
1701
|
export type RouteMatcher = [HTTPMethod, RegExp];
|
|
1702
|
+
/**
|
|
1703
|
+
* Result of the {@linkcode onPostProcess ConfigureAppOptions.onPostProcess} callback.
|
|
1704
|
+
*/
|
|
1705
|
+
export interface PostProcessResult {
|
|
1706
|
+
/**
|
|
1707
|
+
* The full past to the post-processed application package on the local file system .
|
|
1708
|
+
*
|
|
1709
|
+
* This might be a file or a folder path.
|
|
1710
|
+
*/
|
|
1711
|
+
appPath: string;
|
|
1712
|
+
}
|
|
1713
|
+
/**
|
|
1714
|
+
* Information about a cached app instance.
|
|
1715
|
+
*/
|
|
1716
|
+
export interface CachedAppInfo {
|
|
1717
|
+
/**
|
|
1718
|
+
* SHA1 hash of the package if it is a file (and not a folder)
|
|
1719
|
+
*/
|
|
1720
|
+
packageHash: string;
|
|
1721
|
+
/**
|
|
1722
|
+
* Date instance; the value of the file's `Last-Modified` header
|
|
1723
|
+
*/
|
|
1724
|
+
lastModified?: Date;
|
|
1725
|
+
/**
|
|
1726
|
+
* `true` if the file contains an `immutable` mark in `Cache-control` header
|
|
1727
|
+
*/
|
|
1728
|
+
immutable?: boolean;
|
|
1729
|
+
/**
|
|
1730
|
+
* Integer representation of `maxAge` parameter in `Cache-control` header
|
|
1731
|
+
*/
|
|
1732
|
+
maxAge?: number;
|
|
1733
|
+
/**
|
|
1734
|
+
* The timestamp this item has been added to the cache (measured in Unix epoch milliseconds)
|
|
1735
|
+
*/
|
|
1736
|
+
timestamp?: number;
|
|
1737
|
+
/**
|
|
1738
|
+
* An object containing either `file` property with SHA1 hash of the file or `folder` property
|
|
1739
|
+
* with total amount of cached files and subfolders
|
|
1740
|
+
*/
|
|
1741
|
+
integrity?: {
|
|
1742
|
+
file?: string;
|
|
1743
|
+
} | {
|
|
1744
|
+
folder?: number;
|
|
1745
|
+
};
|
|
1746
|
+
/**
|
|
1747
|
+
* The full path to the cached app
|
|
1748
|
+
*/
|
|
1749
|
+
fullPath?: string;
|
|
1750
|
+
}
|
|
1751
|
+
/**
|
|
1752
|
+
* Options for the post-processing step
|
|
1753
|
+
*
|
|
1754
|
+
* The generic can be supplied if using `axios`, where `headers` is a fancy object.
|
|
1755
|
+
*/
|
|
1756
|
+
export interface PostProcessOptions<Headers = HTTPHeaders> {
|
|
1757
|
+
/**
|
|
1758
|
+
* The information about the previously cached app instance (if exists)
|
|
1759
|
+
*/
|
|
1760
|
+
cachedAppInfo?: CachedAppInfo;
|
|
1761
|
+
/**
|
|
1762
|
+
* Whether the app has been downloaded from a remote URL
|
|
1763
|
+
*/
|
|
1764
|
+
isUrl?: boolean;
|
|
1765
|
+
/**
|
|
1766
|
+
* Optional headers object.
|
|
1767
|
+
*
|
|
1768
|
+
* Only present if `isUrl` is `true` and if the server responds to `HEAD` requests. All header names are normalized to lowercase.
|
|
1769
|
+
*/
|
|
1770
|
+
headers?: Headers;
|
|
1771
|
+
/**
|
|
1772
|
+
* A string containing full path to the preprocessed application package (either downloaded or a local one)
|
|
1773
|
+
*/
|
|
1774
|
+
appPath?: string;
|
|
1775
|
+
}
|
|
1776
|
+
export interface ConfigureAppOptions {
|
|
1777
|
+
/**
|
|
1778
|
+
*
|
|
1779
|
+
* Optional function, which should be applied to the application after it is
|
|
1780
|
+
* downloaded/preprocessed.
|
|
1781
|
+
*
|
|
1782
|
+
* This function may be async and is expected to accept single object parameter. The function is
|
|
1783
|
+
* expected to either return a falsy value, which means the app must not be cached and a fresh
|
|
1784
|
+
* copy of it is downloaded each time, _or_ if this function returns an object containing an
|
|
1785
|
+
* `appPath` property, then the integrity of it will be verified and stored into the cache.
|
|
1786
|
+
* @returns
|
|
1787
|
+
*/
|
|
1788
|
+
onPostProcess?: (obj: PostProcessOptions) => Promise<PostProcessResult | undefined> | PostProcessResult | undefined;
|
|
1789
|
+
supportedExtensions: string[];
|
|
1790
|
+
}
|
|
1866
1791
|
//# sourceMappingURL=driver.d.ts.map
|