@appium/fake-driver 4.2.2 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/build/lib/commands/alert.d.ts +330 -13
  2. package/build/lib/commands/alert.d.ts.map +1 -1
  3. package/build/lib/commands/alert.js +80 -53
  4. package/build/lib/commands/alert.js.map +1 -1
  5. package/build/lib/commands/contexts.d.ts +330 -14
  6. package/build/lib/commands/contexts.d.ts.map +1 -1
  7. package/build/lib/commands/contexts.js +101 -86
  8. package/build/lib/commands/contexts.js.map +1 -1
  9. package/build/lib/commands/element.d.ts +315 -22
  10. package/build/lib/commands/element.d.ts.map +1 -1
  11. package/build/lib/commands/element.js +112 -123
  12. package/build/lib/commands/element.js.map +1 -1
  13. package/build/lib/commands/find.d.ts +328 -18
  14. package/build/lib/commands/find.d.ts.map +1 -1
  15. package/build/lib/commands/find.js +118 -107
  16. package/build/lib/commands/find.js.map +1 -1
  17. package/build/lib/commands/general.d.ts +332 -28
  18. package/build/lib/commands/general.d.ts.map +1 -1
  19. package/build/lib/commands/general.js +101 -106
  20. package/build/lib/commands/general.js.map +1 -1
  21. package/build/lib/commands/index.d.ts +1523 -2
  22. package/build/lib/commands/index.d.ts.map +1 -1
  23. package/build/lib/commands/index.js +96 -18
  24. package/build/lib/commands/index.js.map +1 -1
  25. package/build/lib/driver.d.ts +145 -33
  26. package/build/lib/driver.d.ts.map +1 -1
  27. package/build/lib/driver.js +200 -145
  28. package/build/lib/driver.js.map +1 -1
  29. package/build/lib/fake-app.d.ts +15 -6
  30. package/build/lib/fake-app.d.ts.map +1 -1
  31. package/build/lib/fake-app.js +155 -194
  32. package/build/lib/fake-app.js.map +1 -1
  33. package/build/lib/fake-driver-schema.js +34 -26
  34. package/build/lib/fake-driver-schema.js.map +1 -1
  35. package/build/lib/fake-element.js +87 -121
  36. package/build/lib/fake-element.js.map +1 -1
  37. package/build/lib/index.d.ts +6 -5
  38. package/build/lib/index.d.ts.map +1 -1
  39. package/build/lib/index.js +19 -36
  40. package/build/lib/index.js.map +1 -1
  41. package/build/lib/logger.d.ts +1 -1
  42. package/build/lib/logger.d.ts.map +1 -1
  43. package/build/lib/logger.js +5 -15
  44. package/build/lib/logger.js.map +1 -1
  45. package/build/lib/scripts/fake-error.js +1 -5
  46. package/build/lib/scripts/fake-error.js.map +1 -1
  47. package/build/lib/scripts/fake-success.js +8 -11
  48. package/build/lib/scripts/fake-success.js.map +1 -1
  49. package/build/lib/server.d.ts +1 -1
  50. package/build/lib/server.d.ts.map +1 -1
  51. package/build/lib/server.js +18 -27
  52. package/build/lib/server.js.map +1 -1
  53. package/build/lib/types.d.ts +36 -0
  54. package/build/lib/types.d.ts.map +1 -0
  55. package/build/lib/types.js +3 -0
  56. package/build/lib/types.js.map +1 -0
  57. package/build/tsconfig.tsbuildinfo +1 -1
  58. package/lib/commands/alert.js +74 -34
  59. package/lib/commands/contexts.js +89 -52
  60. package/lib/commands/element.js +115 -98
  61. package/lib/commands/find.js +106 -77
  62. package/lib/commands/general.js +112 -75
  63. package/lib/commands/index.js +12 -17
  64. package/lib/driver.js +132 -39
  65. package/lib/fake-app.js +20 -6
  66. package/lib/index.js +9 -7
  67. package/lib/types.ts +42 -0
  68. package/package.json +13 -12
  69. package/tsconfig.json +20 -0
@@ -1,16 +1,332 @@
1
- export default extensions;
2
- export namespace commands {
3
- function getCurrentContext(): Promise<any>;
4
- function getContexts(): Promise<string[]>;
5
- function setContext(context: any): Promise<void>;
6
- function setFrame(frameId: any): Promise<void>;
7
- }
8
- export namespace helpers {
9
- function getRawContexts(): {
10
- NATIVE_APP: null;
11
- PROXY: null;
1
+ /// <reference types="node" />
2
+ /**
3
+ *
4
+ * @template {Class<import('../types').IFakeDriver>} T
5
+ * @param {T} Base
6
+ */
7
+ export function ContextsMixin<T extends Class<import("../types").IFakeDriver, {}, any[]>>(Base: T): {
8
+ new (...arguments_: any[]): {
9
+ getRawContexts(): {
10
+ NATIVE_APP: null;
11
+ PROXY: null;
12
+ };
13
+ assertWebviewContext(): void;
14
+ getCurrentContext(): Promise<string>;
15
+ /**
16
+ * Get the list of available contexts
17
+ *
18
+ * @returns {Promise<string[]>}
19
+ */
20
+ getContexts(): Promise<string[]>;
21
+ /**
22
+ * Set the current context
23
+ *
24
+ * @param {string} context - name of the context
25
+ * @returns {Promise<void>}
26
+ */
27
+ setContext(context: string): Promise<void>;
28
+ curContext: string;
29
+ _proxyActive: boolean | undefined;
30
+ /**
31
+ * Set the active frame
32
+ *
33
+ * @param {number} frameId
34
+ * @returns {Promise<void>}
35
+ */
36
+ setFrame(frameId: number): Promise<void>;
37
+ elMap: Record<string, import("../fake-element").FakeElement>;
38
+ maxElId: number;
39
+ appModel: import("../fake-app").FakeApp;
40
+ focusedElId: string;
41
+ server?: import("@appium/types").AppiumServer | undefined;
42
+ serverHost?: string | undefined;
43
+ serverPort?: number | undefined;
44
+ serverPath?: string | undefined;
45
+ setUrl?(url: string): Promise<void>;
46
+ getUrl?(): Promise<string>;
47
+ back?(): Promise<void>;
48
+ forward?(): Promise<void>;
49
+ refresh?(): Promise<void>;
50
+ title?(): Promise<string>;
51
+ getWindowHandle?(): Promise<string>;
52
+ closeWindow?(): Promise<string[]>;
53
+ setWindow?(handle: string): Promise<void>;
54
+ getWindowHandles?(): Promise<string[]>;
55
+ createNewWindow?(type?: import("@appium/types").NewWindowType | undefined): Promise<import("@appium/types").NewWindow>;
56
+ switchToParentFrame?(): Promise<void>;
57
+ getWindowRect?(): Promise<import("@appium/types").Rect>;
58
+ setWindowRect?(x: number, y: number, width: number, height: number): Promise<import("@appium/types").Rect>;
59
+ maximizeWindow?(): Promise<import("@appium/types").Rect>;
60
+ minimizeWindow?(): Promise<import("@appium/types").Rect>;
61
+ fullScreenWindow?(): Promise<import("@appium/types").Rect>;
62
+ active?(): Promise<import("@appium/types").Element>;
63
+ elementShadowRoot?(elementId: string): Promise<import("@appium/types").Element>;
64
+ elementSelected?(elementId: string): Promise<boolean>;
65
+ getAttribute?(name: string, elementId: string): Promise<string | null>;
66
+ getProperty?(name: string, elementId: string): Promise<string | null>;
67
+ getCssProperty?(name: string, elementId: string): Promise<string>;
68
+ getText?(elementId: string): Promise<string>;
69
+ getName?(elementId: string): Promise<string>;
70
+ getElementRect?(elementId: string): Promise<import("@appium/types").Rect>;
71
+ elementEnabled?(elementId: string): Promise<boolean>;
72
+ getComputedRole?(elementId: string): Promise<string | null>;
73
+ getComputedLabel?(elementId: string): Promise<string | null>;
74
+ elementDisplayed?(elementId: string): Promise<boolean>;
75
+ click?(elementId: string): Promise<void>;
76
+ clear?(elementId: string): Promise<void>;
77
+ setValue?(text: string, elementId: string): Promise<void>;
78
+ execute?(script: string, args: unknown[]): Promise<unknown>;
79
+ executeAsync?(script: string, args: unknown[]): Promise<unknown>;
80
+ getCookies?(): Promise<import("@appium/types").Cookie[]>;
81
+ getCookie?(name: string): Promise<import("@appium/types").Cookie>;
82
+ setCookie?(cookie: import("@appium/types").Cookie): Promise<void>;
83
+ deleteCookie?(name: string): Promise<void>;
84
+ deleteCookies?(): Promise<void>;
85
+ performActions?(actions: import("@appium/types").ActionSequence[]): Promise<void>;
86
+ releaseActions?(): Promise<void>;
87
+ postDismissAlert?(): Promise<void>;
88
+ postAcceptAlert?(): Promise<void>;
89
+ getAlertText?(): Promise<string | null>;
90
+ setAlertText?(text: string): Promise<void>;
91
+ getScreenshot?(): Promise<string>;
92
+ getElementScreenshot?(elementId: string): Promise<string>;
93
+ mobileShake?(): Promise<void>;
94
+ getDeviceTime?(format?: string | undefined): Promise<string>;
95
+ lock?(seconds?: number | undefined): Promise<void>;
96
+ unlock?(): Promise<void>;
97
+ isLocked?(): Promise<boolean>;
98
+ startRecordingScreen?(options?: import("@appium/types").StartScreenRecordOptions | undefined): Promise<void>;
99
+ stopRecordingScreen?(options?: import("@appium/types").StopScreenRecordOptions | undefined): Promise<string>;
100
+ getPerformanceDataTypes?(): Promise<string[]>;
101
+ getPerformanceData?(packageName: string, dataType: string, dataReadTimeout?: number | undefined): Promise<string[]>;
102
+ pressKeyCode?(keycode: number, metastate?: number | undefined, flags?: number | undefined): Promise<void>;
103
+ longPressKeyCode?(keycode: number, metastate?: number | undefined, flags?: number | undefined): Promise<void>;
104
+ fingerprint?(fingerprintId: number): Promise<void>;
105
+ sendSMS?(phoneNumber: string, message: string): Promise<void>;
106
+ gsmCall?(phoneNumber: string, action: string): Promise<void>;
107
+ gsmSignal?(signalStrength: string): Promise<void>;
108
+ gsmVoice?(state: string): Promise<void>;
109
+ powerCapacity?(percent: number): Promise<void>;
110
+ powerAC?(state: string): Promise<void>;
111
+ networkSpeed?(netspeed: string): Promise<void>;
112
+ keyevent?(keycode: string, metastate?: string | undefined): Promise<void>;
113
+ mobileRotation?(x: number, y: number, radius: number, rotation: number, touchCount: number, duration: string, elementId?: string | undefined): Promise<void>;
114
+ getCurrentActivity?(): Promise<string>;
115
+ getCurrentPackage?(): Promise<string>;
116
+ installApp?(appPath: string, options?: unknown): Promise<void>;
117
+ activateApp?(appId: string, options?: unknown): Promise<void>;
118
+ removeApp?(appId: string, options?: unknown): Promise<void>;
119
+ terminateApp?(appId: string, options?: unknown): Promise<void>;
120
+ isAppInstalled?(appId: string): Promise<boolean>;
121
+ queryAppState?(appId: string): Promise<0 | 1 | 3 | 4>;
122
+ hideKeyboard?(strategy?: string | undefined, key?: string | undefined, keyCode?: string | undefined, keyName?: string | undefined): Promise<void>;
123
+ isKeyboardShown?(): Promise<boolean>;
124
+ pushFile?(path: string, data: string): Promise<void>;
125
+ pullFile?(path: string): Promise<string>;
126
+ pullFolder?(path: string): Promise<string>;
127
+ toggleFlightMode?(): Promise<void>;
128
+ toggleData?(): Promise<void>;
129
+ toggleWiFi?(): Promise<void>;
130
+ toggleLocationServices?(): Promise<void>;
131
+ openNotifications?(): Promise<void>;
132
+ startActivity?(appPackage: string, appActivity: string, appWaitPackage?: string | undefined, appWaitActivity?: string | undefined, intentAction?: string | undefined, intentCategory?: string | undefined, intentFlags?: string | undefined, optionalIntentArguments?: string | undefined, dontStopAppOnReset?: boolean | undefined): Promise<void>;
133
+ getSystemBars?(): Promise<unknown[]>;
134
+ getDisplayDensity?(): Promise<number>;
135
+ touchId?(match: boolean): Promise<void>;
136
+ toggleEnrollTouchId?(enabled: boolean): Promise<void>;
137
+ launchApp?(): Promise<void>;
138
+ closeApp?(): Promise<void>;
139
+ background?(seconds: number | null): Promise<void>;
140
+ endCoverage?(intent: string, path: string): Promise<void>;
141
+ getStrings?(language?: string | undefined, stringFile?: string | undefined): Promise<Record<string, unknown>>;
142
+ setValueImmediate?(value: string, elementId: string): Promise<void>;
143
+ replaceValue?(value: string, elementId: string): Promise<void>;
144
+ receiveAsyncResponse?(response: unknown): Promise<void>;
145
+ setClipboard?(content: string, contentType?: string | undefined, label?: string | undefined): Promise<void>;
146
+ getClipboard?(contentType?: string | undefined): Promise<string>;
147
+ asyncScriptTimeout?(ms: number): Promise<void>;
148
+ getWindowSize?(): Promise<import("@appium/types").Size>;
149
+ getLocation?(elementId: string): Promise<import("@appium/types").Position>;
150
+ getLocationInView?(elementId: string): Promise<import("@appium/types").Position>;
151
+ getSize?(elementId: string): Promise<import("@appium/types").Size>;
152
+ equalsElement?(elementId: string, otherElementId: string): Promise<boolean>;
153
+ submit?(elementId: string): Promise<void>;
154
+ keys?(value: string[]): Promise<void>;
155
+ availableIMEEngines?(): Promise<string[]>;
156
+ getActiveIMEEngine?(): Promise<string>;
157
+ isIMEActivated?(): Promise<boolean>;
158
+ deactivateIMEEngine?(): Promise<void>;
159
+ activateIMEEngine?(engine: string): Promise<void>;
160
+ getOrientation?(): Promise<string>;
161
+ setOrientation?(orientation: string): Promise<void>;
162
+ moveTo?(element?: string | null | undefined, xOffset?: number | undefined, yOffset?: number | undefined): Promise<void>;
163
+ buttonDown?(button?: number | undefined): Promise<void>;
164
+ buttonUp?(button?: number | undefined): Promise<void>;
165
+ clickCurrent?(button?: number | undefined): Promise<void>;
166
+ doubleClick?(): Promise<void>;
167
+ touchDown?(x: number, y: number): Promise<void>;
168
+ touchUp?(x: number, y: number): Promise<void>;
169
+ touchMove?(x: number, y: number): Promise<void>;
170
+ touchLongClick?(elementId: string): Promise<void>;
171
+ flick?(element?: string | undefined, xSpeed?: number | undefined, ySpeed?: number | undefined, xOffset?: number | undefined, yOffset?: number | undefined, speed?: number | undefined): Promise<void>;
172
+ getGeoLocation?(): Promise<import("@appium/types").Location>;
173
+ setGeoLocation?(location: Partial<import("@appium/types").Location>): Promise<void>;
174
+ getPageIndex?(elementId: string): Promise<string>;
175
+ getNetworkConnection?(): Promise<number>;
176
+ setNetworkConnection?(type: number): Promise<void>;
177
+ performTouch?(actions: unknown): Promise<void>;
178
+ performMultiAction?(actions: unknown, elementId: string): Promise<void>;
179
+ getRotation?(): Promise<import("@appium/types").Rotation>;
180
+ setRotation?(x: number, y: number, z: number): Promise<void>;
181
+ executeCdp?(cmd: string, params: unknown): Promise<unknown>;
182
+ addVirtualAuthenticator?(protocol: "ctap/u2f" | "ctap2" | "ctap2_1", transport: string, hasResidentKey?: boolean | undefined, hasUserVerification?: boolean | undefined, isUserConsenting?: boolean | undefined, isUserVerified?: boolean | undefined): Promise<string>;
183
+ removeVirtualAuthenticator?(authenticatorId: string): Promise<void>;
184
+ addAuthCredential?(credentialId: string, isResidentCredential: boolean, rpId: string, privateKey: string, userHandle: string, signCount: number, authenticatorId: string): Promise<void>;
185
+ getAuthCredential?(): Promise<import("@appium/types").Credential[]>;
186
+ removeAllAuthCredentials?(): Promise<void>;
187
+ removeAuthCredential?(credentialId: string, authenticatorId: string): Promise<void>;
188
+ setUserAuthVerified?(isUserVerified: boolean, authenticatorId: string): Promise<void>;
189
+ proxyCommand?<T_1 = any>(url: string, method: import("@appium/types").HTTPMethod, body?: string | undefined): Promise<T_1>;
190
+ cliArgs: import("@appium/types").StringRecord;
191
+ executeCommand(cmd: string, ...args: any[]): Promise<any>;
192
+ startUnexpectedShutdown(err?: Error | undefined): Promise<void>;
193
+ startNewCommandTimeout(): Promise<void>;
194
+ reset(): Promise<void>;
195
+ caps?: Partial<import("@appium/types").ConstraintsToCaps<{
196
+ readonly app: {
197
+ readonly presence: true;
198
+ readonly isString: true;
199
+ };
200
+ readonly uniqueApp: {
201
+ readonly isBoolean: true;
202
+ };
203
+ }> & void> | undefined;
204
+ originalCaps?: import("@appium/types").W3CCapabilities<{
205
+ readonly app: {
206
+ readonly presence: true;
207
+ readonly isString: true;
208
+ };
209
+ readonly uniqueApp: {
210
+ readonly isBoolean: true;
211
+ };
212
+ }, void> | undefined;
213
+ desiredCapConstraints: {
214
+ readonly app: {
215
+ readonly presence: true;
216
+ readonly isString: true;
217
+ };
218
+ readonly uniqueApp: {
219
+ readonly isBoolean: true;
220
+ };
221
+ };
222
+ assignServer?(server: import("@appium/types").AppiumServer, host: string, port: number, path: string): void;
223
+ getSessions(): Promise<import("@appium/types").MultiSessionData<typeof import("@appium/types").BASE_DESIRED_CAP_CONSTRAINTS, void>[]>;
224
+ getSession(): Promise<import("@appium/types").SingularSessionData<typeof import("@appium/types").BASE_DESIRED_CAP_CONSTRAINTS, void>>;
225
+ supportedLogTypes: Readonly<import("@appium/types").LogDefRecord<{
226
+ readonly app: {
227
+ readonly presence: true;
228
+ readonly isString: true;
229
+ };
230
+ readonly uniqueApp: {
231
+ readonly isBoolean: true;
232
+ };
233
+ }>>;
234
+ getLogTypes(): Promise<string[]>;
235
+ getLog(logType: string): Promise<unknown[]>;
236
+ findElement(strategy: string, selector: string): Promise<import("@appium/types").Element>;
237
+ findElements(strategy: string, selector: string): Promise<import("@appium/types").Element[]>;
238
+ findElementFromElement(strategy: string, selector: string, elementId: string): Promise<import("@appium/types").Element>;
239
+ findElementsFromElement(strategy: string, selector: string, elementId: string): Promise<import("@appium/types").Element[]>;
240
+ findElementFromShadowRoot?(strategy: string, selector: string, shadowId: string): Promise<import("@appium/types").Element>;
241
+ findElementsFromShadowRoot?(strategy: string, selector: string, shadowId: string): Promise<import("@appium/types").Element[]>;
242
+ findElOrEls<Mult extends boolean>(strategy: string, selector: string, mult: Mult, context?: any): Promise<Mult extends true ? import("@appium/types").Element[] : import("@appium/types").Element>;
243
+ findElOrElsWithProcessing<Mult_1 extends boolean>(strategy: string, selector: string, mult: Mult_1, context?: any): Promise<Mult_1 extends true ? import("@appium/types").Element[] : import("@appium/types").Element>;
244
+ getPageSource(): Promise<string>;
245
+ updateSettings: (settings: import("@appium/types").StringRecord) => Promise<void>;
246
+ getSettings(): Promise<import("@appium/types").StringRecord>;
247
+ timeouts(type: string, ms: string | number, script?: number | undefined, pageLoad?: number | undefined, implicit?: string | number | undefined): Promise<void>;
248
+ setNewCommandTimeout(ms: number): void;
249
+ implicitWait(ms: string | number): Promise<void>;
250
+ setImplicitWait(ms: number): void;
251
+ implicitWaitForCondition(condition: () => Promise<any>): Promise<unknown>;
252
+ getTimeouts(): Promise<Record<string, number>>;
253
+ implicitWaitW3C(ms: number): Promise<void>;
254
+ implicitWaitMJSONWP(ms: number): Promise<void>;
255
+ pageLoadTimeoutW3C(ms: number): Promise<void>;
256
+ pageLoadTimeoutMJSONWP(ms: number): Promise<void>;
257
+ scriptTimeoutW3C(ms: number): Promise<void>;
258
+ scriptTimeoutMJSONWP(ms: number): Promise<void>;
259
+ newCommandTimeout(ms: number): Promise<void>;
260
+ parseTimeoutArgument(ms: string | number): number;
261
+ logCustomEvent(vendor: string, event: string): Promise<void>;
262
+ getLogEvents(type?: string | string[] | undefined): Promise<import("@appium/types").EventHistory | Record<string, number>>;
263
+ executeMethod(script: string, args: [] | [import("@appium/types").StringRecord]): Promise<any>;
264
+ createSession(w3cCaps1: import("@appium/types").W3CCapabilities<{
265
+ readonly app: {
266
+ readonly presence: true;
267
+ readonly isString: true;
268
+ };
269
+ readonly uniqueApp: {
270
+ readonly isBoolean: true;
271
+ };
272
+ }, void>, w3cCaps2?: import("@appium/types").W3CCapabilities<{
273
+ readonly app: {
274
+ readonly presence: true;
275
+ readonly isString: true;
276
+ };
277
+ readonly uniqueApp: {
278
+ readonly isBoolean: true;
279
+ };
280
+ }, void> | undefined, w3cCaps3?: import("@appium/types").W3CCapabilities<{
281
+ readonly app: {
282
+ readonly presence: true;
283
+ readonly isString: true;
284
+ };
285
+ readonly uniqueApp: {
286
+ readonly isBoolean: true;
287
+ };
288
+ }, void> | undefined, driverData?: import("@appium/types").DriverData[] | undefined): Promise<[string, any]>;
289
+ deleteSession(sessionId?: string | undefined, driverData?: import("@appium/types").DriverData[] | undefined): Promise<void>;
290
+ shouldValidateCaps: boolean;
291
+ sessionId: string | null;
292
+ opts: import("@appium/types").DriverOpts<typeof import("@appium/types").BASE_DESIRED_CAP_CONSTRAINTS>;
293
+ initialOpts: import("@appium/types").ServerArgs;
294
+ protocol?: string | undefined;
295
+ helpers: import("@appium/types").DriverHelpers<typeof import("@appium/types").BASE_DESIRED_CAP_CONSTRAINTS>;
296
+ basePath: string;
297
+ relaxedSecurityEnabled: boolean;
298
+ allowInsecure: string[];
299
+ denyInsecure: string[];
300
+ newCommandTimeoutMs: number;
301
+ implicitWaitMs: number;
302
+ locatorStrategies: string[];
303
+ webLocatorStrategies: string[];
304
+ eventEmitter: import("events");
305
+ settings: import("@appium/types").DeviceSettings<any>;
306
+ log: import("@appium/types").AppiumLogger;
307
+ driverData?: import("@appium/types").DriverData | undefined;
308
+ isCommandsQueueEnabled: boolean;
309
+ eventHistory: import("@appium/types").EventHistory;
310
+ onUnexpectedShutdown(handler: () => any): void;
311
+ getStatus(): Promise<any>;
312
+ sessionExists(sessionId: string): boolean;
313
+ isW3CProtocol(): boolean;
314
+ isMjsonwpProtocol(): boolean;
315
+ isFeatureEnabled(name: string): boolean;
316
+ assertFeatureEnabled(name: string): void;
317
+ validateLocatorStrategy(strategy: string, webContext?: boolean | undefined): void;
318
+ proxyActive(sessionId?: string | undefined): boolean;
319
+ getProxyAvoidList(sessionId?: string | undefined): import("@appium/types").RouteMatcher[];
320
+ canProxy(sessionId?: string | undefined): boolean;
321
+ proxyRouteIsAvoided(sessionId: string, method: string, url: string): boolean;
322
+ addManagedDriver(driver: import("@appium/types").Driver<typeof import("@appium/types").BASE_DESIRED_CAP_CONSTRAINTS, import("@appium/types").StringRecord, any>): void;
323
+ getManagedDrivers(): import("@appium/types").Driver<typeof import("@appium/types").BASE_DESIRED_CAP_CONSTRAINTS, import("@appium/types").StringRecord, any>[];
324
+ clearNewCommandTimeout(): Promise<void>;
325
+ logEvent(eventName: string): void;
326
+ driverForSession(sessionId: string): import("@appium/types").Core<typeof import("@appium/types").BASE_DESIRED_CAP_CONSTRAINTS> | null;
12
327
  };
13
- function assertWebviewContext(): void;
14
- }
15
- declare let extensions: {};
328
+ } & T;
329
+ export type FakeDriverCore = import('../driver').FakeDriverCore;
330
+ export type IContextsCommands = import('../types').IContextsCommands;
331
+ export type Class<T, U = {}, V = any[]> = import('@appium/types').Class<T, U, V>;
16
332
  //# sourceMappingURL=contexts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contexts.d.ts","sourceRoot":"","sources":["../../../lib/commands/contexts.js"],"names":[],"mappings":";;IAsBA,2CAEC;IAED,0CAEC;IAED,iDAgBC;IAED,+CAWC;;;IApDD;;;MAOC;IAED,sCAIC;;AAfC,2BAAe"}
1
+ {"version":3,"file":"contexts.d.ts","sourceRoot":"","sources":["../../../lib/commands/contexts.js"],"names":[],"mappings":";AAGA;;;;GAIG;AACH;;;;;;;;QA4BI;;;;WAIG;uBADU,QAAQ,MAAM,EAAE,CAAC;QAM9B;;;;;WAKG;4BAFQ,MAAM,GACJ,QAAQ,IAAI,CAAC;;;QAoB1B;;;;;WAKG;0BAFQ,MAAM,GACJ,QAAQ,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiB7B;6BAGY,OAAO,WAAW,EAAE,cAAc;gCAClC,OAAO,UAAU,EAAE,iBAAiB;0CAKpC,OAAO,eAAe,EAAE,KAAK,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAC"}
@@ -1,89 +1,104 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.helpers = exports.default = exports.commands = void 0;
7
-
8
- require("source-map-support/register");
9
-
10
- var _lodash = _interopRequireDefault(require("lodash"));
11
-
12
- var _driver = require("appium/driver");
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- let commands = {},
17
- helpers = {},
18
- extensions = {};
19
- exports.helpers = helpers;
20
- exports.commands = commands;
21
-
22
- helpers.getRawContexts = function getRawContexts() {
23
- let contexts = {
24
- NATIVE_APP: null,
25
- PROXY: null
26
- };
27
- let wvs = this.appModel.getWebviews();
28
-
29
- for (let i = 1; i < wvs.length + 1; i++) {
30
- contexts[`WEBVIEW_${i}`] = wvs[i - 1];
31
- }
32
-
33
- return contexts;
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
34
4
  };
35
-
36
- helpers.assertWebviewContext = function assertWebviewContext() {
37
- if (this.curContext === 'NATIVE_APP') {
38
- throw new _driver.errors.InvalidContextError();
39
- }
40
- };
41
-
42
- commands.getCurrentContext = async function getCurrentContext() {
43
- return this.curContext;
44
- };
45
-
46
- commands.getContexts = async function getContexts() {
47
- return _lodash.default.keys(this.getRawContexts());
48
- };
49
-
50
- commands.setContext = async function setContext(context) {
51
- let contexts = this.getRawContexts();
52
-
53
- if (_lodash.default.includes(_lodash.default.keys(contexts), context)) {
54
- this.curContext = context;
55
-
56
- if (context === 'NATIVE_APP') {
57
- this.appModel.deactivateWebview();
58
- this._proxyActive = false;
59
- } else if (context === 'PROXY') {
60
- this._proxyActive = true;
61
- } else {
62
- this.appModel.activateWebview(contexts[context]);
63
- this._proxyActive = false;
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ContextsMixin = void 0;
7
+ const lodash_1 = __importDefault(require("lodash"));
8
+ const driver_1 = require("appium/driver");
9
+ /**
10
+ *
11
+ * @template {Class<import('../types').IFakeDriver>} T
12
+ * @param {T} Base
13
+ */
14
+ function ContextsMixin(Base) {
15
+ /**
16
+ * @implements {IContextsCommands}
17
+ */
18
+ class ContextsCommands extends Base {
19
+ getRawContexts() {
20
+ let contexts = { NATIVE_APP: null, PROXY: null };
21
+ let wvs = this.appModel?.getWebviews() ?? [];
22
+ for (let i = 1; i < wvs.length + 1; i++) {
23
+ contexts[`WEBVIEW_${i}`] = wvs[i - 1];
24
+ }
25
+ return contexts;
26
+ }
27
+ assertWebviewContext() {
28
+ if (this.curContext === 'NATIVE_APP') {
29
+ throw new driver_1.errors.InvalidContextError();
30
+ }
31
+ }
32
+ // do not add a description to this method's docstring
33
+ /*
34
+ * @returns {Promise<string>}
35
+ */
36
+ async getCurrentContext() {
37
+ return this.curContext;
38
+ }
39
+ /**
40
+ * Get the list of available contexts
41
+ *
42
+ * @returns {Promise<string[]>}
43
+ */
44
+ async getContexts() {
45
+ return lodash_1.default.keys(this.getRawContexts());
46
+ }
47
+ /**
48
+ * Set the current context
49
+ *
50
+ * @param {string} context - name of the context
51
+ * @returns {Promise<void>}
52
+ */
53
+ async setContext(context) {
54
+ let contexts = this.getRawContexts();
55
+ if (context in contexts) {
56
+ this.curContext = context;
57
+ if (context === 'NATIVE_APP') {
58
+ this.appModel.deactivateWebview();
59
+ this._proxyActive = false;
60
+ }
61
+ else if (context === 'PROXY') {
62
+ this._proxyActive = true;
63
+ }
64
+ else {
65
+ this.appModel.activateWebview(contexts[context]);
66
+ this._proxyActive = false;
67
+ }
68
+ }
69
+ else {
70
+ throw new driver_1.errors.NoSuchContextError();
71
+ }
72
+ }
73
+ /**
74
+ * Set the active frame
75
+ *
76
+ * @param {number} frameId
77
+ * @returns {Promise<void>}
78
+ */
79
+ async setFrame(frameId) {
80
+ this.assertWebviewContext();
81
+ if (frameId === null) {
82
+ this.appModel.deactivateFrame();
83
+ }
84
+ else {
85
+ let nodes = this.appModel.xpathQuery(`//iframe[@id="${frameId}"]`);
86
+ if (!nodes.length) {
87
+ throw new driver_1.errors.NoSuchFrameError();
88
+ }
89
+ this.appModel.activateFrame(nodes[0]);
90
+ }
91
+ }
64
92
  }
65
- } else {
66
- throw new _driver.errors.NoSuchContextError();
67
- }
68
- };
69
-
70
- commands.setFrame = async function setFrame(frameId) {
71
- this.assertWebviewContext();
72
-
73
- if (frameId === null) {
74
- this.appModel.deactivateFrame();
75
- } else {
76
- let nodes = this.appModel.xpathQuery(`//iframe[@id="${frameId}"]`);
77
-
78
- if (!nodes.length) {
79
- throw new _driver.errors.NoSuchFrameError();
80
- }
81
-
82
- this.appModel.activateFrame(nodes[0]);
83
- }
84
- };
85
-
86
- Object.assign(extensions, commands, helpers);
87
- var _default = extensions;
88
- exports.default = _default;
89
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJjb21tYW5kcyIsImhlbHBlcnMiLCJleHRlbnNpb25zIiwiZ2V0UmF3Q29udGV4dHMiLCJjb250ZXh0cyIsIk5BVElWRV9BUFAiLCJQUk9YWSIsInd2cyIsImFwcE1vZGVsIiwiZ2V0V2Vidmlld3MiLCJpIiwibGVuZ3RoIiwiYXNzZXJ0V2Vidmlld0NvbnRleHQiLCJjdXJDb250ZXh0IiwiZXJyb3JzIiwiSW52YWxpZENvbnRleHRFcnJvciIsImdldEN1cnJlbnRDb250ZXh0IiwiZ2V0Q29udGV4dHMiLCJfIiwia2V5cyIsInNldENvbnRleHQiLCJjb250ZXh0IiwiaW5j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QUFPLEtBQUssT0FBaEIsRUFBeUI7TUFDOUIsS0FBS0csWUFBTCxHQUFvQixJQUFwQjtJQUNELENBRk0sTUFFQTtNQUNMLEtBQUtoQixRQUFMLENBQWNpQixlQUFkLENBQThCckIsUUFBUSxDQUFDaUIsT0FBRCxDQUF0QztNQUNBLEtBQUtHLFlBQUwsR0FBb0IsS0FBcEI7SUFDRDtFQUNGLENBWEQsTUFXTztJQUNMLE1BQU0sSUFBSVYsY0FBQSxDQUFPWSxrQkFBWCxFQUFOO0VBQ0Q7QUFDRixDQWhCRDs7QUFrQkExQixRQUFRLENBQUMyQixRQUFULEdBQW9CLGVBQWVBLFFBQWYsQ0FBd0JDLE9BQXhCLEVBQWlDO0VBQ25ELEtBQUtoQixvQkFBTDs7RUFDQSxJQUFJZ0IsT0FBTyxLQUFLLElBQWhCLEVBQXNCO0lBQ3BCLEtBQUtwQixRQUFMLENBQWNxQixlQUFkO0VBQ0QsQ0FGRCxNQUVPO0lBQ0wsSUFBSUMsS0FBSyxHQUFHLEtBQUt0QixRQUFMLENBQWN1QixVQUFkLENBQTBCLGlCQUFnQkgsT0FBUSxJQUFsRCxDQUFaOztJQUNBLElBQUksQ0FBQ0UsS0FBSyxDQUFDbkIsTUFBWCxFQUFtQjtNQUNqQixNQUFNLElBQUlHLGNBQUEsQ0FBT2tCLGdCQUFYLEVBQU47SUFDRDs7SUFDRCxLQUFLeEIsUUFBTCxDQUFjeUIsYUFBZCxDQUE0QkgsS0FBSyxDQUFDLENBQUQsQ0FBakM7RUFDRDtBQUNGLENBWEQ7O0FBYUFJLE1BQU0sQ0FBQ0MsTUFBUCxDQUFjakMsVUFBZCxFQUEwQkYsUUFBMUIsRUFBb0NDLE9BQXBDO2VBRWVDLFUifQ==
93
+ return ContextsCommands;
94
+ }
95
+ exports.ContextsMixin = ContextsMixin;
96
+ /**
97
+ * @typedef {import('../driver').FakeDriverCore} FakeDriverCore
98
+ * @typedef {import('../types').IContextsCommands} IContextsCommands
99
+ */
100
+ /**
101
+ * @template T,[U={}],[V=Array<any>]
102
+ * @typedef {import('@appium/types').Class<T,U,V>} Class
103
+ */
104
+ //# sourceMappingURL=contexts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contexts.js","names":["commands","helpers","extensions","getRawContexts","contexts","NATIVE_APP","PROXY","wvs","appModel","getWebviews","i","length","assertWebviewContext","curContext","errors","InvalidContextError","getCurrentContext","getContexts","_","keys","setContext","context","includes","deactivateWebview","_proxyActive","activateWebview","NoSuchContextError","setFrame","frameId","deactivateFrame","nodes","xpathQuery","NoSuchFrameError","activateFrame","Object","assign"],"sources":["../../../lib/commands/contexts.js"],"sourcesContent":["import _ from 'lodash';\nimport {errors} from 'appium/driver';\n\nlet commands = {},\n helpers = {},\n extensions = {};\n\nhelpers.getRawContexts = function getRawContexts() {\n let contexts = {NATIVE_APP: null, PROXY: null};\n let wvs = this.appModel.getWebviews();\n for (let i = 1; i < wvs.length + 1; i++) {\n contexts[`WEBVIEW_${i}`] = wvs[i - 1];\n }\n return contexts;\n};\n\nhelpers.assertWebviewContext = function assertWebviewContext() {\n if (this.curContext === 'NATIVE_APP') {\n throw new errors.InvalidContextError();\n }\n};\n\ncommands.getCurrentContext = async function getCurrentContext() {\n return this.curContext;\n};\n\ncommands.getContexts = async function getContexts() {\n return _.keys(this.getRawContexts());\n};\n\ncommands.setContext = async function setContext(context) {\n let contexts = this.getRawContexts();\n if (_.includes(_.keys(contexts), context)) {\n this.curContext = context;\n if (context === 'NATIVE_APP') {\n this.appModel.deactivateWebview();\n this._proxyActive = false;\n } else if (context === 'PROXY') {\n this._proxyActive = true;\n } else {\n this.appModel.activateWebview(contexts[context]);\n this._proxyActive = false;\n }\n } else {\n throw new errors.NoSuchContextError();\n }\n};\n\ncommands.setFrame = async function setFrame(frameId) {\n this.assertWebviewContext();\n if (frameId === null) {\n this.appModel.deactivateFrame();\n } else {\n let nodes = this.appModel.xpathQuery(`//iframe[@id=\"${frameId}\"]`);\n if (!nodes.length) {\n throw new errors.NoSuchFrameError();\n }\n this.appModel.activateFrame(nodes[0]);\n }\n};\n\nObject.assign(extensions, commands, helpers);\nexport {commands, helpers};\nexport default extensions;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;;;AAEA,IAAIA,QAAQ,GAAG,EAAf;AAAA,IACEC,OAAO,GAAG,EADZ;AAAA,IAEEC,UAAU,GAAG,EAFf;;;;AAIAD,OAAO,CAACE,cAAR,GAAyB,SAASA,cAAT,GAA0B;EACjD,IAAIC,QAAQ,GAAG;IAACC,UAAU,EAAE,IAAb;IAAmBC,KAAK,EAAE;EAA1B,CAAf;EACA,IAAIC,GAAG,GAAG,KAAKC,QAAL,CAAcC,WAAd,EAAV;;EACA,KAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGH,GAAG,CAACI,MAAJ,GAAa,CAAjC,EAAoCD,CAAC,EAArC,EAAyC;IACvCN,QAAQ,CAAE,WAAUM,CAAE,EAAd,CAAR,GAA2BH,GAAG,CAACG,CAAC,GAAG,CAAL,CAA9B;EACD;;EACD,OAAON,QAAP;AACD,CAPD;;AASAH,OAAO,CAACW,oBAAR,GAA+B,SAASA,oBAAT,GAAgC;EAC7D,IAAI,KAAKC,UAAL,KAAoB,YAAxB,EAAsC;IACpC,MAAM,IAAIC,cAAA,CAAOC,mBAAX,EAAN;EACD;AACF,CAJD;;AAMAf,QAAQ,CAACgB,iBAAT,GAA6B,eAAeA,iBAAf,GAAmC;EAC9D,OAAO,KAAKH,UAAZ;AACD,CAFD;;AAIAb,QAAQ,CAACiB,WAAT,GAAuB,eAAeA,WAAf,GAA6B;EAClD,OAAOC,eAAA,CAAEC,IAAF,CAAO,KAAKhB,cAAL,EAAP,CAAP;AACD,CAFD;;AAIAH,QAAQ,CAACoB,UAAT,GAAsB,eAAeA,UAAf,CAA0BC,OAA1B,EAAmC;EACvD,IAAIjB,QAAQ,GAAG,KAAKD,cAAL,EAAf;;EACA,IAAIe,eAAA,CAAEI,QAAF,CAAWJ,eAAA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