appium-android-driver 5.14.0-alpha.0 → 5.14.0-alpha2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/build/index.d.ts +282 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +34 -20
- package/build/index.js.map +1 -0
- package/build/lib/android-helpers.d.ts +136 -0
- package/build/lib/android-helpers.d.ts.map +1 -0
- package/build/lib/android-helpers.js +855 -0
- package/build/lib/android-helpers.js.map +1 -0
- package/build/lib/bootstrap.d.ts +2 -2
- package/build/lib/commands/actions.d.ts.map +1 -1
- package/build/lib/commands/actions.js +4 -0
- package/build/lib/commands/actions.js.map +1 -1
- package/build/lib/commands/context.js +1 -1
- package/build/lib/commands/context.js.map +1 -1
- package/build/lib/commands/coverage.d.ts +5 -0
- package/build/lib/commands/coverage.d.ts.map +1 -0
- package/build/lib/commands/coverage.js +19 -0
- package/build/lib/commands/coverage.js.map +1 -0
- package/build/lib/commands/execute.d.ts.map +1 -1
- package/build/lib/commands/execute.js +4 -3
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/find.d.ts +4 -1
- package/build/lib/commands/find.d.ts.map +1 -1
- package/build/lib/commands/find.js +1 -0
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/index.d.ts +27 -47
- package/build/lib/commands/index.d.ts.map +1 -1
- package/build/lib/commands/index.js.map +1 -1
- package/build/lib/commands/log.d.ts.map +1 -1
- package/build/lib/commands/log.js +2 -2
- package/build/lib/commands/log.js.map +1 -1
- package/build/lib/commands/mixins.d.ts +11 -6
- package/build/lib/commands/mixins.d.ts.map +1 -1
- package/build/lib/commands/mixins.js.map +1 -1
- package/build/lib/commands/performance.d.ts +4 -4
- package/build/lib/commands/performance.d.ts.map +1 -1
- package/build/lib/commands/types.d.ts +8 -1
- package/build/lib/commands/types.d.ts.map +1 -1
- package/build/lib/constraints.d.ts +289 -384
- package/build/lib/constraints.d.ts.map +1 -1
- package/build/lib/constraints.js +2 -9
- package/build/lib/constraints.js.map +1 -1
- package/build/lib/desired-caps.d.ts +353 -0
- package/build/lib/desired-caps.d.ts.map +1 -0
- package/build/lib/desired-caps.js +299 -0
- package/build/lib/desired-caps.js.map +1 -0
- package/build/lib/driver.d.ts +50 -403
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +67 -127
- package/build/lib/driver.js.map +1 -1
- package/build/lib/helpers/android.d.ts +11 -11
- package/build/lib/helpers/android.d.ts.map +1 -1
- package/build/lib/helpers/android.js.map +1 -1
- package/build/lib/helpers/unlock.d.ts +2 -1
- package/build/lib/helpers/unlock.d.ts.map +1 -1
- package/build/lib/helpers/unlock.js.map +1 -1
- package/build/lib/index.d.ts +9 -0
- package/build/lib/index.d.ts.map +1 -0
- package/build/lib/index.js +37 -0
- package/build/lib/index.js.map +1 -0
- package/build/lib/uiautomator.d.ts +6 -6
- package/build/lib/unlock-helpers.d.ts +38 -0
- package/build/lib/unlock-helpers.d.ts.map +1 -0
- package/build/lib/unlock-helpers.js +266 -0
- package/build/lib/unlock-helpers.js.map +1 -0
- package/build/lib/webview-helpers.d.ts +223 -0
- package/build/lib/webview-helpers.d.ts.map +1 -0
- package/build/lib/webview-helpers.js +530 -0
- package/build/lib/webview-helpers.js.map +1 -0
- package/lib/commands/actions.js +5 -0
- package/lib/commands/context.js +1 -1
- package/lib/commands/execute.js +7 -3
- package/lib/commands/find.ts +2 -0
- package/lib/commands/{index.js → index.ts} +2 -0
- package/lib/commands/log.js +6 -4
- package/lib/commands/mixins.ts +11 -7
- package/lib/commands/types.ts +9 -1
- package/lib/{constraints.js → constraints.ts} +6 -9
- package/lib/{driver.js → driver.ts} +143 -183
- package/lib/helpers/android.ts +31 -14
- package/lib/helpers/unlock.ts +2 -1
- package/lib/index.ts +18 -0
- package/package.json +14 -14
- package/build/lib/commands/mixin.d.ts +0 -3
- package/build/lib/commands/mixin.d.ts.map +0 -1
- package/build/lib/commands/mixin.js +0 -6
- package/build/lib/commands/mixin.js.map +0 -1
package/lib/commands/mixins.ts
CHANGED
|
@@ -18,14 +18,13 @@ import type {
|
|
|
18
18
|
UninstallOptions,
|
|
19
19
|
} from 'appium-adb';
|
|
20
20
|
import type Chromedriver from 'appium-chromedriver';
|
|
21
|
-
import type {Sharp} from 'sharp';
|
|
22
21
|
import {AndroidDriverOpts, AndroidDriver} from '../driver';
|
|
23
22
|
import type * as types from './types';
|
|
24
23
|
|
|
25
24
|
export interface ActionsMixin {
|
|
26
25
|
keyevent(keycode: string | number, metastate?: number): Promise<void>;
|
|
27
|
-
pressKeyCode(keycode: string | number, metastate?: number): Promise<void>;
|
|
28
|
-
longPressKeyCode(keycode: string | number, metastate?: number): Promise<void>;
|
|
26
|
+
pressKeyCode(keycode: string | number, metastate?: number, flags?: any): Promise<void>;
|
|
27
|
+
longPressKeyCode(keycode: string | number, metastate?: number, flags?: any): Promise<void>;
|
|
29
28
|
getOrientation(): Promise<Orientation>;
|
|
30
29
|
setOrientation(orientation: Orientation): Promise<void>;
|
|
31
30
|
fakeFlick(xSpeed: number, ySpeed: number): Promise<void>;
|
|
@@ -84,7 +83,12 @@ export interface ActionsMixin {
|
|
|
84
83
|
destElId?: string | number
|
|
85
84
|
): Promise<void>;
|
|
86
85
|
doDrag(opts: types.DragOpts): Promise<void>;
|
|
87
|
-
lock(seconds
|
|
86
|
+
lock(seconds?: number): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Lock the device (and optionally unlock it after a certain amount of time).
|
|
89
|
+
* @throws {Error} if lock or unlock operation fails
|
|
90
|
+
*/
|
|
91
|
+
mobileLock(opts: types.LockOpts): Promise<void>;
|
|
88
92
|
unlock(): Promise<void>;
|
|
89
93
|
isLocked(): Promise<boolean>;
|
|
90
94
|
openNotifications(): Promise<void>;
|
|
@@ -408,8 +412,8 @@ export interface EmulatorConsoleMixin {
|
|
|
408
412
|
}
|
|
409
413
|
|
|
410
414
|
export interface ExecuteMixin {
|
|
411
|
-
execute(script: string, args?:
|
|
412
|
-
executeMobile(mobileCommand: string, opts?: StringRecord): Promise<
|
|
415
|
+
execute(script: string, args?: unknown[]): Promise<unknown>;
|
|
416
|
+
executeMobile(mobileCommand: string, opts?: StringRecord): Promise<unknown>;
|
|
413
417
|
}
|
|
414
418
|
|
|
415
419
|
export interface FileActionsMixin {
|
|
@@ -532,7 +536,7 @@ export interface GeneralMixin {
|
|
|
532
536
|
|
|
533
537
|
background(seconds: number): Promise<string | true>;
|
|
534
538
|
|
|
535
|
-
getStrings(language
|
|
539
|
+
getStrings(language?: string | null): Promise<StringRecord>;
|
|
536
540
|
|
|
537
541
|
launchApp(): Promise<void>;
|
|
538
542
|
|
package/lib/commands/types.ts
CHANGED
|
@@ -350,7 +350,7 @@ export interface ListSmsOpts {
|
|
|
350
350
|
* Maximum count of recent SMS messages
|
|
351
351
|
* @defaultValue 100
|
|
352
352
|
*/
|
|
353
|
-
max
|
|
353
|
+
max?: number;
|
|
354
354
|
}
|
|
355
355
|
|
|
356
356
|
export type UnlockType = 'pin' | 'pinWithKeyEvent' | 'password' | 'pattern';
|
|
@@ -1087,3 +1087,11 @@ export type SwipeAction = [
|
|
|
1087
1087
|
];
|
|
1088
1088
|
|
|
1089
1089
|
export type TouchDragAction = [NonReleaseTouchAction, NonReleaseTouchAction, ReleaseTouchAction];
|
|
1090
|
+
|
|
1091
|
+
export interface LockOpts {
|
|
1092
|
+
/**
|
|
1093
|
+
* The number to keep the locked.
|
|
1094
|
+
* 0 or empty value will keep the device locked.
|
|
1095
|
+
*/
|
|
1096
|
+
seconds?: number;
|
|
1097
|
+
}
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import {type Constraints} from '@appium/types';
|
|
2
|
+
|
|
3
|
+
export const ANDROID_DRIVER_CONSTRAINTS = {
|
|
2
4
|
platformName: {
|
|
3
5
|
isString: true,
|
|
4
6
|
inclusionCaseInsensitive: ['Android'],
|
|
5
7
|
presence: true,
|
|
6
8
|
},
|
|
7
|
-
/**
|
|
8
|
-
* XXX: this overrides BaseDriver's constraint, since this driver seems to require the deviceName cap
|
|
9
|
-
*/
|
|
10
9
|
deviceName: {
|
|
11
10
|
isString: true,
|
|
12
|
-
presence: true,
|
|
13
|
-
},
|
|
14
|
-
app: {
|
|
15
|
-
isString: true,
|
|
16
11
|
},
|
|
17
12
|
appActivity: {
|
|
18
13
|
isString: true,
|
|
@@ -301,6 +296,8 @@ export const ANDROID_DRIVER_CONSTRAINTS = /** @type {const} */ ({
|
|
|
301
296
|
appWaitForLaunch: {
|
|
302
297
|
isBoolean: true,
|
|
303
298
|
},
|
|
304
|
-
}
|
|
299
|
+
} as const satisfies Constraints;
|
|
305
300
|
|
|
306
301
|
export default ANDROID_DRIVER_CONSTRAINTS;
|
|
302
|
+
|
|
303
|
+
export type AndroidDriverConstraints = typeof ANDROID_DRIVER_CONSTRAINTS;
|