appium-android-driver 12.4.1 → 12.4.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/CHANGELOG.md +6 -0
- package/build/lib/doctor/checks.d.ts +38 -57
- package/build/lib/doctor/checks.d.ts.map +1 -1
- package/build/lib/doctor/checks.js +7 -18
- package/build/lib/doctor/checks.js.map +1 -1
- package/build/lib/doctor/utils.d.ts +3 -3
- package/build/lib/doctor/utils.d.ts.map +1 -1
- package/build/lib/doctor/utils.js +2 -2
- package/build/lib/doctor/utils.js.map +1 -1
- package/build/lib/logger.d.ts +1 -2
- package/build/lib/logger.d.ts.map +1 -1
- package/build/lib/logger.js +2 -2
- package/build/lib/logger.js.map +1 -1
- package/build/lib/method-map.d.ts +1 -1
- package/build/lib/method-map.d.ts.map +1 -1
- package/build/lib/method-map.js +2 -2
- package/build/lib/method-map.js.map +1 -1
- package/build/lib/utils.d.ts +30 -23
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +15 -22
- package/build/lib/utils.js.map +1 -1
- package/lib/doctor/{checks.js → checks.ts} +51 -53
- package/lib/doctor/{utils.js → utils.ts} +4 -3
- package/lib/logger.ts +3 -0
- package/lib/{method-map.js → method-map.ts} +6 -2
- package/lib/{utils.js → utils.ts} +32 -27
- package/package.json +1 -1
- package/lib/logger.js +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [12.4.2](https://github.com/appium/appium-android-driver/compare/v12.4.1...v12.4.2) (2025-12-10)
|
|
2
|
+
|
|
3
|
+
### Miscellaneous Chores
|
|
4
|
+
|
|
5
|
+
* Migrate various modules to typescript ([#1034](https://github.com/appium/appium-android-driver/issues/1034)) ([c700f4b](https://github.com/appium/appium-android-driver/commit/c700f4bc799cb2506f5b91a68a134ba9653da0e8))
|
|
6
|
+
|
|
1
7
|
## [12.4.1](https://github.com/appium/appium-android-driver/compare/v12.4.0...v12.4.1) (2025-12-07)
|
|
2
8
|
|
|
3
9
|
### Miscellaneous Chores
|
|
@@ -1,83 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import '@colors/colors';
|
|
2
|
+
import type { IDoctorCheck, AppiumLogger, DoctorCheckResult } from '@appium/types';
|
|
3
|
+
interface EnvVarCheckOptions {
|
|
4
|
+
expectDir?: boolean;
|
|
5
|
+
expectFile?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare class EnvVarAndPathCheck implements IDoctorCheck {
|
|
8
|
+
log: AppiumLogger;
|
|
9
|
+
varName: string;
|
|
10
|
+
opts: EnvVarCheckOptions;
|
|
11
|
+
constructor(varName: string, opts?: EnvVarCheckOptions);
|
|
12
|
+
diagnose(): Promise<DoctorCheckResult>;
|
|
6
13
|
fix(): Promise<string>;
|
|
7
14
|
hasAutofix(): boolean;
|
|
8
15
|
isOptional(): boolean;
|
|
9
16
|
}
|
|
10
|
-
export const
|
|
11
|
-
|
|
12
|
-
export class
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
TOOL_NAMES: string[];
|
|
16
|
-
diagnose(): Promise<import("@appium/types").DoctorCheckResult>;
|
|
17
|
+
export declare const androidHomeCheck: EnvVarAndPathCheck;
|
|
18
|
+
export declare const javaHomeCheck: EnvVarAndPathCheck;
|
|
19
|
+
export declare class JavaHomeValueCheck implements IDoctorCheck {
|
|
20
|
+
log: AppiumLogger;
|
|
21
|
+
diagnose(): Promise<DoctorCheckResult>;
|
|
17
22
|
fix(): Promise<string>;
|
|
18
23
|
hasAutofix(): boolean;
|
|
19
24
|
isOptional(): boolean;
|
|
20
25
|
}
|
|
21
|
-
export const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
export declare const javaHomeValueCheck: JavaHomeValueCheck;
|
|
27
|
+
export declare class AndroidSdkCheck implements IDoctorCheck {
|
|
28
|
+
log: AppiumLogger;
|
|
29
|
+
TOOL_NAMES: readonly string[];
|
|
30
|
+
diagnose(): Promise<DoctorCheckResult>;
|
|
25
31
|
fix(): Promise<string>;
|
|
26
32
|
hasAutofix(): boolean;
|
|
27
33
|
isOptional(): boolean;
|
|
28
34
|
}
|
|
29
|
-
export const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
GST_INSPECT_BINARY: string;
|
|
34
|
-
diagnose(): Promise<import("@appium/types").DoctorCheckResult>;
|
|
35
|
+
export declare const androidSdkCheck: AndroidSdkCheck;
|
|
36
|
+
export declare class OptionalBundletoolCheck implements IDoctorCheck {
|
|
37
|
+
log: AppiumLogger;
|
|
38
|
+
diagnose(): Promise<DoctorCheckResult>;
|
|
35
39
|
fix(): Promise<string>;
|
|
36
40
|
hasAutofix(): boolean;
|
|
37
41
|
isOptional(): boolean;
|
|
38
42
|
}
|
|
39
|
-
export const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
export declare const optionalBundletoolCheck: OptionalBundletoolCheck;
|
|
44
|
+
export declare class OptionalGstreamerCheck implements IDoctorCheck {
|
|
45
|
+
log: AppiumLogger;
|
|
46
|
+
GSTREAMER_BINARY: string;
|
|
47
|
+
GST_INSPECT_BINARY: string;
|
|
48
|
+
diagnose(): Promise<DoctorCheckResult>;
|
|
44
49
|
fix(): Promise<string>;
|
|
45
50
|
hasAutofix(): boolean;
|
|
46
51
|
isOptional(): boolean;
|
|
47
52
|
}
|
|
48
|
-
export const
|
|
49
|
-
export
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
*/
|
|
54
|
-
expectDir?: boolean | undefined;
|
|
55
|
-
/**
|
|
56
|
-
* If set to true then
|
|
57
|
-
* the path is expected to be a valid file
|
|
58
|
-
*/
|
|
59
|
-
expectFile?: boolean | undefined;
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* @typedef EnvVarCheckOptions
|
|
63
|
-
* @property {boolean} [expectDir] If set to true then
|
|
64
|
-
* the path is expected to be a valid folder
|
|
65
|
-
* @property {boolean} [expectFile] If set to true then
|
|
66
|
-
* the path is expected to be a valid file
|
|
67
|
-
*/
|
|
68
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
69
|
-
declare class EnvVarAndPathCheck {
|
|
70
|
-
/**
|
|
71
|
-
* @param {string} varName
|
|
72
|
-
* @param {EnvVarCheckOptions} [opts={}]
|
|
73
|
-
*/
|
|
74
|
-
constructor(varName: string, opts?: EnvVarCheckOptions);
|
|
75
|
-
varName: string;
|
|
76
|
-
opts: EnvVarCheckOptions;
|
|
77
|
-
diagnose(): Promise<import("@appium/types").DoctorCheckResult>;
|
|
53
|
+
export declare const optionalGstreamerCheck: OptionalGstreamerCheck;
|
|
54
|
+
export declare class OptionalFfmpegCheck implements IDoctorCheck {
|
|
55
|
+
log: AppiumLogger;
|
|
56
|
+
FFMPEG_BINARY: string;
|
|
57
|
+
diagnose(): Promise<DoctorCheckResult>;
|
|
78
58
|
fix(): Promise<string>;
|
|
79
59
|
hasAutofix(): boolean;
|
|
80
60
|
isOptional(): boolean;
|
|
81
61
|
}
|
|
62
|
+
export declare const optionalFfmpegCheck: OptionalFfmpegCheck;
|
|
82
63
|
export {};
|
|
83
64
|
//# sourceMappingURL=checks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../../../lib/doctor/checks.
|
|
1
|
+
{"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../../../lib/doctor/checks.ts"],"names":[],"mappings":"AAGA,OAAO,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAC,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAcjF,UAAU,kBAAkB;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,cAAM,kBAAmB,YAAW,YAAY;IAC9C,GAAG,EAAG,YAAY,CAAC;IACn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AAkB,SAAwD;IAEpE,QAAQ,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAatC,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;IAS5B,UAAU,IAAI,OAAO;IAIrB,UAAU,IAAI,OAAO;CAGtB;AACD,eAAO,MAAM,sBAAsB,wBAA+B,CAAC;AAEnE,qBAAa,mBAAoB,YAAW,YAAY;IACtD,GAAG,EAAG,YAAY,CAAC;IACnB,aAAa,SAA+C;IAEtD,QAAQ,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAQtC,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;IAO5B,UAAU,IAAI,OAAO;IAIrB,UAAU,IAAI,OAAO;CAGtB;AACD,eAAO,MAAM,mBAAmB,qBAA4B,CAAC"}
|
|
@@ -17,19 +17,10 @@ const ANDROID_SDK_LINK2 = 'https://developer.android.com/studio/intro/update#sdk
|
|
|
17
17
|
const BUNDLETOOL_RELEASES_LINK = 'https://github.com/google/bundletool/releases/';
|
|
18
18
|
const GSTREAMER_INSTALL_LINK = 'https://gstreamer.freedesktop.org/documentation/installing/index.html?gi-language=c';
|
|
19
19
|
const FFMPEG_INSTALL_LINK = 'https://www.ffmpeg.org/download.html';
|
|
20
|
-
/**
|
|
21
|
-
* @typedef EnvVarCheckOptions
|
|
22
|
-
* @property {boolean} [expectDir] If set to true then
|
|
23
|
-
* the path is expected to be a valid folder
|
|
24
|
-
* @property {boolean} [expectFile] If set to true then
|
|
25
|
-
* the path is expected to be a valid file
|
|
26
|
-
*/
|
|
27
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
28
20
|
class EnvVarAndPathCheck {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*/
|
|
21
|
+
log;
|
|
22
|
+
varName;
|
|
23
|
+
opts;
|
|
33
24
|
constructor(varName, opts = {}) {
|
|
34
25
|
this.varName = varName;
|
|
35
26
|
this.opts = opts;
|
|
@@ -68,8 +59,8 @@ class EnvVarAndPathCheck {
|
|
|
68
59
|
}
|
|
69
60
|
exports.androidHomeCheck = new EnvVarAndPathCheck('ANDROID_HOME', { expectDir: true });
|
|
70
61
|
exports.javaHomeCheck = new EnvVarAndPathCheck('JAVA_HOME', { expectDir: true });
|
|
71
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
72
62
|
class JavaHomeValueCheck {
|
|
63
|
+
log;
|
|
73
64
|
async diagnose() {
|
|
74
65
|
const envVar = process.env.JAVA_HOME;
|
|
75
66
|
if (!envVar) {
|
|
@@ -96,9 +87,7 @@ class JavaHomeValueCheck {
|
|
|
96
87
|
}
|
|
97
88
|
exports.JavaHomeValueCheck = JavaHomeValueCheck;
|
|
98
89
|
exports.javaHomeValueCheck = new JavaHomeValueCheck();
|
|
99
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
100
90
|
class AndroidSdkCheck {
|
|
101
|
-
/** @type {import('@appium/types').AppiumLogger} */
|
|
102
91
|
log;
|
|
103
92
|
TOOL_NAMES = ['adb', 'emulator'];
|
|
104
93
|
async diagnose() {
|
|
@@ -135,8 +124,8 @@ class AndroidSdkCheck {
|
|
|
135
124
|
}
|
|
136
125
|
exports.AndroidSdkCheck = AndroidSdkCheck;
|
|
137
126
|
exports.androidSdkCheck = new AndroidSdkCheck();
|
|
138
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
139
127
|
class OptionalBundletoolCheck {
|
|
128
|
+
log;
|
|
140
129
|
async diagnose() {
|
|
141
130
|
const bundletoolPath = await (0, utils_1.resolveExecutablePath)('bundletool.jar');
|
|
142
131
|
return bundletoolPath
|
|
@@ -158,8 +147,8 @@ class OptionalBundletoolCheck {
|
|
|
158
147
|
}
|
|
159
148
|
exports.OptionalBundletoolCheck = OptionalBundletoolCheck;
|
|
160
149
|
exports.optionalBundletoolCheck = new OptionalBundletoolCheck();
|
|
161
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
162
150
|
class OptionalGstreamerCheck {
|
|
151
|
+
log;
|
|
163
152
|
GSTREAMER_BINARY = `gst-launch-1.0${support_1.system.isWindows() ? '.exe' : ''}`;
|
|
164
153
|
GST_INSPECT_BINARY = `gst-inspect-1.0${support_1.system.isWindows() ? '.exe' : ''}`;
|
|
165
154
|
async diagnose() {
|
|
@@ -182,8 +171,8 @@ class OptionalGstreamerCheck {
|
|
|
182
171
|
}
|
|
183
172
|
exports.OptionalGstreamerCheck = OptionalGstreamerCheck;
|
|
184
173
|
exports.optionalGstreamerCheck = new OptionalGstreamerCheck();
|
|
185
|
-
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
186
174
|
class OptionalFfmpegCheck {
|
|
175
|
+
log;
|
|
187
176
|
FFMPEG_BINARY = `ffmpeg${support_1.system.isWindows() ? '.exe' : ''}`;
|
|
188
177
|
async diagnose() {
|
|
189
178
|
const ffmpegPath = await (0, utils_1.resolveExecutablePath)(this.FFMPEG_BINARY);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checks.js","sourceRoot":"","sources":["../../../lib/doctor/checks.
|
|
1
|
+
{"version":3,"file":"checks.js","sourceRoot":"","sources":["../../../lib/doctor/checks.ts"],"names":[],"mappings":";;;;;;AAAA,mCAA8C;AAC9C,6CAAmD;AACnD,gDAAwB;AACxB,0BAAwB;AACxB,2CAAmE;AAGnE,MAAM,kBAAkB,GAAG,gBAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC;AAC7E,MAAM,6BAA6B,GACjC,uEAAuE,CAAC;AAC1E,MAAM,kBAAkB,GACtB,6EAA6E,CAAC;AAChF,MAAM,iBAAiB,GAAG,oDAAoD,CAAC;AAC/E,MAAM,iBAAiB,GAAG,+DAA+D,CAAC;AAC1F,MAAM,wBAAwB,GAAG,gDAAgD,CAAC;AAClF,MAAM,sBAAsB,GAC1B,qFAAqF,CAAC;AACxF,MAAM,mBAAmB,GAAG,sCAAsC,CAAC;AAOnE,MAAM,kBAAkB;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;QACZ,MAAM,UAAU,GAAG,MAAM,IAAA,6BAAqB,EAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAEnE,OAAO,UAAU;YACf,CAAC,CAAC,gBAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,aAAa,eAAe,UAAU,GAAG,CAAC;YACtE,CAAC,CAAC,gBAAM,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,aAAa,kBAAkB,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,GAAG;QACP,OAAO,CACL,GAAG,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,IAAI,oEAAoE;YACnG,eAAe,mBAAmB,GAAG,CACtC,CAAC;IACJ,CAAC;IAED,UAAU;QACR,OAAO,KAAK,CAAC;IACf,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA1BD,kDA0BC;AACY,QAAA,mBAAmB,GAAG,IAAI,mBAAmB,EAAE,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Return an executable path of cmd
|
|
3
3
|
*
|
|
4
|
-
* @param
|
|
5
|
-
* @return
|
|
4
|
+
* @param cmd Standard output by command
|
|
5
|
+
* @return The full path of cmd. `null` if the cmd is not found.
|
|
6
6
|
*/
|
|
7
|
-
export function resolveExecutablePath(cmd: string): Promise<string | null>;
|
|
7
|
+
export declare function resolveExecutablePath(cmd: string): Promise<string | null>;
|
|
8
8
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../lib/doctor/utils.
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../lib/doctor/utils.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQ/E"}
|
|
@@ -5,8 +5,8 @@ const support_1 = require("@appium/support");
|
|
|
5
5
|
/**
|
|
6
6
|
* Return an executable path of cmd
|
|
7
7
|
*
|
|
8
|
-
* @param
|
|
9
|
-
* @return
|
|
8
|
+
* @param cmd Standard output by command
|
|
9
|
+
* @return The full path of cmd. `null` if the cmd is not found.
|
|
10
10
|
*/
|
|
11
11
|
async function resolveExecutablePath(cmd) {
|
|
12
12
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../lib/doctor/utils.
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../lib/doctor/utils.ts"],"names":[],"mappings":";;AAQA,sDAQC;AAhBD,6CAAmC;AAEnC;;;;;GAKG;AACI,KAAK,UAAU,qBAAqB,CAAC,GAAW;IACrD,IAAI,CAAC;QACH,MAAM,cAAc,GAAG,MAAM,YAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC3C,IAAI,cAAc,IAAI,CAAC,MAAM,YAAE,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC;YACxD,OAAO,cAAc,CAAC;QACxB,CAAC;IACH,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/build/lib/logger.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../lib/logger.
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../lib/logger.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,sCAAoC,CAAC"}
|
package/build/lib/logger.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.log = void 0;
|
|
3
4
|
const support_1 = require("@appium/support");
|
|
4
|
-
|
|
5
|
-
exports.default = log;
|
|
5
|
+
exports.log = support_1.logger.getLogger('AndroidDriver');
|
|
6
6
|
//# sourceMappingURL=logger.js.map
|
package/build/lib/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../lib/logger.
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../lib/logger.ts"],"names":[],"mappings":";;;AAAA,6CAAuC;AAE1B,QAAA,GAAG,GAAG,gBAAM,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method-map.d.ts","sourceRoot":"","sources":["../../lib/method-map.
|
|
1
|
+
{"version":3,"file":"method-map.d.ts","sourceRoot":"","sources":["../../lib/method-map.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8SoB,CAAC"}
|
package/build/lib/method-map.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.newMethodMap = void 0;
|
|
4
|
-
exports.newMethodMap =
|
|
4
|
+
exports.newMethodMap = {
|
|
5
5
|
'/session/:sessionId/timeouts/implicit_wait': {
|
|
6
6
|
POST: {
|
|
7
7
|
command: 'implicitWait',
|
|
@@ -303,5 +303,5 @@ exports.newMethodMap = ({
|
|
|
303
303
|
deprecated: true,
|
|
304
304
|
},
|
|
305
305
|
},
|
|
306
|
-
}
|
|
306
|
+
};
|
|
307
307
|
//# sourceMappingURL=method-map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method-map.js","sourceRoot":"","sources":["../../lib/method-map.
|
|
1
|
+
{"version":3,"file":"method-map.js","sourceRoot":"","sources":["../../lib/method-map.ts"],"names":[],"mappings":";;;AAGa,QAAA,YAAY,GAAG;IAC1B,4CAA4C,EAAE;QAC5C,IAAI,EAAE;YACJ,OAAO,EAAE,cAAc;YACvB,aAAa,EAAE,EAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAC;YACjC,UAAU,EAAE,IAAI;SACjB;KACF;IACD,2CAA2C,EAAE,EAAC,GAAG,EAAE,EAAC,OAAO,EAAE,qBAAqB,EAAC,EAAC;IACpF,uCAAuC,EAAE,EAAC,GAAG,EAAE,EAAC,OAAO,EAAE,oBAAoB,EAAC,EAAC;IAC/E,mCAAmC,EAAE,EAAC,GAAG,EAAE,EAAC,OAAO,EAAE,gBAAgB,EAAC,EAAC;IACvE,oCAAoC,EAAE,EAAC,IAAI,EAAE,EAAC,OAAO,EAAE,qBAAqB,EAAC,EAAC;IAC9E,kCAAkC,EAAE;QAClC,IAAI,EAAE;YACJ,OAAO,EAAE,mBAAmB;YAC5B,aAAa,EAAE,EAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAC;SACtC;KACF;IACD,+CAA+C,EAAE;QAC/C,GAAG,EAAE;YACH,OAAO,EAAE,eAAe;YACxB,UAAU,EAAE,IAAI;SACjB;KACF;IACD,0BAA0B,EAAE;QAC1B,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM;YACf,aAAa,EAAE,EAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAC;YACpC,UAAU,EAAE,IAAI;SACjB;KACF;IACD,iDAAiD,EAAE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AAE,CAAC,MAAM,CAAC,EAAC;YACnC,UAAU,EAAE,IAAI;SACjB;KACF;IACD,6DAA6D,EAAE;QAC7D,IAAI,EAAE;YACJ,OAAO,EAAE,cAAc;YACvB,aAAa,EAAE,EAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAC;YACnC,UAAU,EAAE,IAAI;SACjB;KACF;IACD,wCAAwC,EAAE;QACxC,GAAG,EAAE;YACH,OAAO,EAAE,sBAAsB;YAC/B,UAAU,EAAE,IAAI;SACjB;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,sBAAsB;YAC/B,aAAa,EAAE,EAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAC;YACzD,UAAU,EAAE,IAAI;SACjB;KACF;IACD,8BAA8B,EAAE;QAC9B,GAAG,EAAE;YACH,OAAO,EAAE,gBAAgB;YACzB,UAAU,EAAE,IAAI;SACjB;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,gBAAgB;YACzB,aAAa,EAAE,EAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,EAAC;YACvC,UAAU,EAAE,IAAI;SACjB;KACF;CAC0C,CAAC"}
|
package/build/lib/utils.d.ts
CHANGED
|
@@ -1,40 +1,47 @@
|
|
|
1
|
+
import type { LogEntry } from 'appium-adb';
|
|
2
|
+
import type { AndroidDriver } from './driver';
|
|
3
|
+
export type { LogEntry };
|
|
4
|
+
export declare const ADB_SHELL_FEATURE = "adb_shell";
|
|
5
|
+
export declare const ADB_LISTEN_ALL_NETWORK_FEATURE = "adb_listen_all_network";
|
|
6
|
+
export declare const GET_SERVER_LOGS_FEATURE = "get_server_logs";
|
|
1
7
|
/**
|
|
2
8
|
* Assert the presence of particular keys in the given object
|
|
3
9
|
*
|
|
4
|
-
* @param
|
|
5
|
-
* @param
|
|
6
|
-
* @returns
|
|
10
|
+
* @param argNames one or more key names
|
|
11
|
+
* @param opts the object to check
|
|
12
|
+
* @returns the same given object
|
|
7
13
|
*/
|
|
8
|
-
export function requireArgs(argNames: string | string[], opts: any): Record<string, any>;
|
|
14
|
+
export declare function requireArgs(argNames: string | string[], opts: Record<string, any>): Record<string, any>;
|
|
9
15
|
/**
|
|
10
16
|
*
|
|
11
|
-
* @param
|
|
12
|
-
* @returns
|
|
17
|
+
* @param cap
|
|
18
|
+
* @returns
|
|
13
19
|
*/
|
|
14
|
-
export function parseArray(cap: string | string[]): string[];
|
|
20
|
+
export declare function parseArray(cap: string | string[]): string[];
|
|
15
21
|
/**
|
|
16
|
-
* @this
|
|
17
|
-
* @returns
|
|
22
|
+
* @this AndroidDriver
|
|
23
|
+
* @returns
|
|
18
24
|
*/
|
|
19
|
-
export function removeAllSessionWebSocketHandlers(this:
|
|
25
|
+
export declare function removeAllSessionWebSocketHandlers(this: AndroidDriver): Promise<void>;
|
|
26
|
+
interface LogEntryWithPrefix {
|
|
27
|
+
message: string;
|
|
28
|
+
prefix?: string;
|
|
29
|
+
timestamp?: number;
|
|
30
|
+
level?: string;
|
|
31
|
+
}
|
|
20
32
|
/**
|
|
21
33
|
*
|
|
22
|
-
* @param
|
|
23
|
-
* @returns
|
|
34
|
+
* @param x
|
|
35
|
+
* @returns
|
|
24
36
|
*/
|
|
25
|
-
export function nativeLogEntryToSeleniumEntry(x:
|
|
37
|
+
export declare function nativeLogEntryToSeleniumEntry(x: LogEntryWithPrefix): LogEntry;
|
|
26
38
|
/**
|
|
27
39
|
*
|
|
28
40
|
* @see {@link https://github.com/SeleniumHQ/selenium/blob/0d425676b3c9df261dd641917f867d4d5ce7774d/java/client/src/org/openqa/selenium/logging/LogEntry.java}
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
32
|
-
* @returns
|
|
41
|
+
* @param timestamp
|
|
42
|
+
* @param message
|
|
43
|
+
* @param level
|
|
44
|
+
* @returns
|
|
33
45
|
*/
|
|
34
|
-
export function toLogRecord(timestamp: number, message: string, level?: string): LogEntry;
|
|
35
|
-
export const ADB_SHELL_FEATURE: "adb_shell";
|
|
36
|
-
export const ADB_LISTEN_ALL_NETWORK_FEATURE: "adb_listen_all_network";
|
|
37
|
-
export const GET_SERVER_LOGS_FEATURE: "get_server_logs";
|
|
38
|
-
export type LogEntry = import("appium-adb").LogEntry;
|
|
39
|
-
export type AndroidDriver = import("./driver").AndroidDriver;
|
|
46
|
+
export declare function toLogRecord(timestamp: number, message: string, level?: string): LogEntry;
|
|
40
47
|
//# sourceMappingURL=utils.d.ts.map
|
package/build/lib/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../lib/utils.
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../lib/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AAE5C,YAAY,EAAC,QAAQ,EAAC,CAAC;AAEvB,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAC7C,eAAO,MAAM,8BAA8B,2BAA2B,CAAC;AACvE,eAAO,MAAM,uBAAuB,oBAAoB,CAAC;AAGzD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAOvG;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,CAa3D;AAED;;;GAGG;AACH,wBAAsB,iCAAiC,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAS1F;AAED,UAAU,kBAAkB;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,kBAAkB,GAAG,QAAQ,CAM7E;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,MAAc,GAAG,QAAQ,CAM/F"}
|
package/build/lib/utils.js
CHANGED
|
@@ -18,9 +18,9 @@ const COLOR_CODE_PATTERN = /\u001b\[(\d+(;\d+)*)?m/g; // eslint-disable-line no-
|
|
|
18
18
|
/**
|
|
19
19
|
* Assert the presence of particular keys in the given object
|
|
20
20
|
*
|
|
21
|
-
* @param
|
|
22
|
-
* @param
|
|
23
|
-
* @returns
|
|
21
|
+
* @param argNames one or more key names
|
|
22
|
+
* @param opts the object to check
|
|
23
|
+
* @returns the same given object
|
|
24
24
|
*/
|
|
25
25
|
function requireArgs(argNames, opts) {
|
|
26
26
|
for (const argName of lodash_1.default.isArray(argNames) ? argNames : [argNames]) {
|
|
@@ -32,13 +32,12 @@ function requireArgs(argNames, opts) {
|
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
*
|
|
35
|
-
* @param
|
|
36
|
-
* @returns
|
|
35
|
+
* @param cap
|
|
36
|
+
* @returns
|
|
37
37
|
*/
|
|
38
38
|
function parseArray(cap) {
|
|
39
39
|
let parsedCaps;
|
|
40
40
|
try {
|
|
41
|
-
// @ts-ignore this is fine
|
|
42
41
|
parsedCaps = JSON.parse(cap);
|
|
43
42
|
}
|
|
44
43
|
catch { }
|
|
@@ -51,8 +50,8 @@ function parseArray(cap) {
|
|
|
51
50
|
throw new Error(`must provide a string or JSON Array; received ${cap}`);
|
|
52
51
|
}
|
|
53
52
|
/**
|
|
54
|
-
* @this
|
|
55
|
-
* @returns
|
|
53
|
+
* @this AndroidDriver
|
|
54
|
+
* @returns
|
|
56
55
|
*/
|
|
57
56
|
async function removeAllSessionWebSocketHandlers() {
|
|
58
57
|
if (!this.sessionId || !lodash_1.default.isFunction(this.server?.getWebSocketHandlers)) {
|
|
@@ -65,32 +64,26 @@ async function removeAllSessionWebSocketHandlers() {
|
|
|
65
64
|
}
|
|
66
65
|
/**
|
|
67
66
|
*
|
|
68
|
-
* @param
|
|
69
|
-
* @returns
|
|
67
|
+
* @param x
|
|
68
|
+
* @returns
|
|
70
69
|
*/
|
|
71
70
|
function nativeLogEntryToSeleniumEntry(x) {
|
|
72
71
|
const msg = lodash_1.default.isEmpty(x.prefix) ? x.message : `[${x.prefix}] ${x.message}`;
|
|
73
|
-
return toLogRecord(
|
|
74
|
-
/** @type {any} */ (x).timestamp ?? Date.now(), lodash_1.default.replace(msg, COLOR_CODE_PATTERN, ''));
|
|
72
|
+
return toLogRecord(x.timestamp ?? Date.now(), lodash_1.default.replace(msg, COLOR_CODE_PATTERN, ''));
|
|
75
73
|
}
|
|
76
74
|
/**
|
|
77
75
|
*
|
|
78
76
|
* @see {@link https://github.com/SeleniumHQ/selenium/blob/0d425676b3c9df261dd641917f867d4d5ce7774d/java/client/src/org/openqa/selenium/logging/LogEntry.java}
|
|
79
|
-
* @param
|
|
80
|
-
* @param
|
|
81
|
-
* @param
|
|
82
|
-
* @returns
|
|
77
|
+
* @param timestamp
|
|
78
|
+
* @param message
|
|
79
|
+
* @param level
|
|
80
|
+
* @returns
|
|
83
81
|
*/
|
|
84
82
|
function toLogRecord(timestamp, message, level = 'ALL') {
|
|
85
83
|
return {
|
|
86
84
|
timestamp,
|
|
87
|
-
|
|
88
|
-
level,
|
|
85
|
+
level: level,
|
|
89
86
|
message,
|
|
90
87
|
};
|
|
91
88
|
}
|
|
92
|
-
/**
|
|
93
|
-
* @typedef {import('appium-adb').LogEntry} LogEntry
|
|
94
|
-
* @typedef {import('./driver').AndroidDriver} AndroidDriver
|
|
95
|
-
*/
|
|
96
89
|
//# sourceMappingURL=utils.js.map
|
package/build/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../lib/utils.
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../lib/utils.ts"],"names":[],"mappings":";;;;;;AAmBA,kCAOC;AAOD,gCAaC;AAMD,8EASC;AAcD,sEAMC;AAUD,kCAMC;AAjGD,oDAAuB;AACvB,0CAAqC;AAMxB,QAAA,iBAAiB,GAAG,WAAW,CAAC;AAChC,QAAA,8BAA8B,GAAG,wBAAwB,CAAC;AAC1D,QAAA,uBAAuB,GAAG,iBAAiB,CAAC;AACzD,MAAM,kBAAkB,GAAG,yBAAyB,CAAC,CAAC,uCAAuC;AAE7F;;;;;;GAMG;AACH,SAAgB,WAAW,CAAC,QAA2B,EAAE,IAAyB;IAChF,KAAK,MAAM,OAAO,IAAI,gBAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;QAClE,IAAI,CAAC,gBAAC,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,IAAI,OAAO,6BAA6B,CAAC,CAAC;QAClF,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,SAAgB,UAAU,CAAC,GAAsB;IAC/C,IAAI,UAAU,CAAC;IACf,IAAI,CAAC;QACH,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,GAAa,CAAC,CAAC;IACzC,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IAEV,IAAI,gBAAC,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QAC1B,OAAO,UAAU,CAAC;IACpB,CAAC;SAAM,IAAI,gBAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3B,OAAO,CAAC,GA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|
import {getAndroidBinaryPath, getSdkRootFromEnv} from 'appium-adb';
|
|
6
|
+
import type {IDoctorCheck, AppiumLogger, DoctorCheckResult} from '@appium/types';
|
|
6
7
|
|
|
7
8
|
const JAVA_HOME_VAR_NAME = system.isWindows() ? '%JAVA_HOME%' : '$JAVA_HOME';
|
|
8
9
|
const ENVIRONMENT_VARS_TUTORIAL_URL =
|
|
@@ -16,26 +17,22 @@ const GSTREAMER_INSTALL_LINK =
|
|
|
16
17
|
'https://gstreamer.freedesktop.org/documentation/installing/index.html?gi-language=c';
|
|
17
18
|
const FFMPEG_INSTALL_LINK = 'https://www.ffmpeg.org/download.html';
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
* @param {string} varName
|
|
31
|
-
* @param {EnvVarCheckOptions} [opts={}]
|
|
32
|
-
*/
|
|
33
|
-
constructor(varName, opts = {}) {
|
|
20
|
+
interface EnvVarCheckOptions {
|
|
21
|
+
expectDir?: boolean;
|
|
22
|
+
expectFile?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
class EnvVarAndPathCheck implements IDoctorCheck {
|
|
26
|
+
log!: AppiumLogger;
|
|
27
|
+
varName: string;
|
|
28
|
+
opts: EnvVarCheckOptions;
|
|
29
|
+
|
|
30
|
+
constructor(varName: string, opts: EnvVarCheckOptions = {}) {
|
|
34
31
|
this.varName = varName;
|
|
35
32
|
this.opts = opts;
|
|
36
33
|
}
|
|
37
34
|
|
|
38
|
-
async diagnose() {
|
|
35
|
+
async diagnose(): Promise<DoctorCheckResult> {
|
|
39
36
|
const varValue = process.env[this.varName];
|
|
40
37
|
if (!varValue) {
|
|
41
38
|
return doctor.nok(`${this.varName} environment variable is NOT set!`);
|
|
@@ -64,27 +61,28 @@ class EnvVarAndPathCheck {
|
|
|
64
61
|
return doctor.ok(`${this.varName} is set to: ${varValue}`);
|
|
65
62
|
}
|
|
66
63
|
|
|
67
|
-
async fix() {
|
|
64
|
+
async fix(): Promise<string> {
|
|
68
65
|
return (
|
|
69
66
|
`Make sure the environment variable ${this.varName.bold} is properly configured for the Appium process. ` +
|
|
70
67
|
`Refer ${ENVIRONMENT_VARS_TUTORIAL_URL} for more details.`
|
|
71
68
|
);
|
|
72
69
|
}
|
|
73
70
|
|
|
74
|
-
hasAutofix() {
|
|
71
|
+
hasAutofix(): boolean {
|
|
75
72
|
return false;
|
|
76
73
|
}
|
|
77
74
|
|
|
78
|
-
isOptional() {
|
|
75
|
+
isOptional(): boolean {
|
|
79
76
|
return false;
|
|
80
77
|
}
|
|
81
78
|
}
|
|
82
79
|
export const androidHomeCheck = new EnvVarAndPathCheck('ANDROID_HOME', {expectDir: true});
|
|
83
80
|
export const javaHomeCheck = new EnvVarAndPathCheck('JAVA_HOME', {expectDir: true});
|
|
84
81
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
export class JavaHomeValueCheck implements IDoctorCheck {
|
|
83
|
+
log!: AppiumLogger;
|
|
84
|
+
|
|
85
|
+
async diagnose(): Promise<DoctorCheckResult> {
|
|
88
86
|
const envVar = process.env.JAVA_HOME;
|
|
89
87
|
if (!envVar) {
|
|
90
88
|
return doctor.nok(`${JAVA_HOME_VAR_NAME} environment variable must be set`);
|
|
@@ -101,31 +99,29 @@ export class JavaHomeValueCheck {
|
|
|
101
99
|
return doctor.ok(`'${javaBinaryRelativePath}' exists under '${envVar}'`);
|
|
102
100
|
}
|
|
103
101
|
|
|
104
|
-
async fix() {
|
|
102
|
+
async fix(): Promise<string> {
|
|
105
103
|
return (
|
|
106
104
|
`Set ${JAVA_HOME_VAR_NAME} environment variable to the root folder path of your local JDK installation. ` +
|
|
107
105
|
`Read ${JAVA_HOME_TUTORIAL}`
|
|
108
106
|
);
|
|
109
107
|
}
|
|
110
108
|
|
|
111
|
-
hasAutofix() {
|
|
109
|
+
hasAutofix(): boolean {
|
|
112
110
|
return false;
|
|
113
111
|
}
|
|
114
112
|
|
|
115
|
-
isOptional() {
|
|
113
|
+
isOptional(): boolean {
|
|
116
114
|
return false;
|
|
117
115
|
}
|
|
118
116
|
}
|
|
119
117
|
export const javaHomeValueCheck = new JavaHomeValueCheck();
|
|
120
118
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
/** @type {import('@appium/types').AppiumLogger} */
|
|
124
|
-
log;
|
|
119
|
+
export class AndroidSdkCheck implements IDoctorCheck {
|
|
120
|
+
log!: AppiumLogger;
|
|
125
121
|
|
|
126
|
-
TOOL_NAMES = ['adb', 'emulator'];
|
|
122
|
+
TOOL_NAMES: readonly string[] = ['adb', 'emulator'];
|
|
127
123
|
|
|
128
|
-
async diagnose() {
|
|
124
|
+
async diagnose(): Promise<DoctorCheckResult> {
|
|
129
125
|
const listOfTools = this.TOOL_NAMES.join(', ');
|
|
130
126
|
const sdkRoot = getSdkRootFromEnv();
|
|
131
127
|
if (!sdkRoot) {
|
|
@@ -133,7 +129,7 @@ export class AndroidSdkCheck {
|
|
|
133
129
|
}
|
|
134
130
|
|
|
135
131
|
this.log.info(` Checking ${listOfTools}`);
|
|
136
|
-
const missingBinaries = [];
|
|
132
|
+
const missingBinaries: string[] = [];
|
|
137
133
|
for (const binary of this.TOOL_NAMES) {
|
|
138
134
|
try {
|
|
139
135
|
this.log.info(` '${binary}' exists in ${await getAndroidBinaryPath(binary)}`);
|
|
@@ -149,33 +145,34 @@ export class AndroidSdkCheck {
|
|
|
149
145
|
return doctor.ok(`${listOfTools} exist in '${sdkRoot}'`);
|
|
150
146
|
}
|
|
151
147
|
|
|
152
|
-
async fix() {
|
|
148
|
+
async fix(): Promise<string> {
|
|
153
149
|
return (
|
|
154
150
|
`Manually install ${'Android SDK'.bold} and set ${'ANDROID_HOME'.bold}. ` +
|
|
155
151
|
`Read ${[ANDROID_SDK_LINK1, ANDROID_SDK_LINK2].join(' and ')}.`
|
|
156
152
|
);
|
|
157
153
|
}
|
|
158
154
|
|
|
159
|
-
hasAutofix() {
|
|
155
|
+
hasAutofix(): boolean {
|
|
160
156
|
return false;
|
|
161
157
|
}
|
|
162
158
|
|
|
163
|
-
isOptional() {
|
|
159
|
+
isOptional(): boolean {
|
|
164
160
|
return false;
|
|
165
161
|
}
|
|
166
162
|
}
|
|
167
163
|
export const androidSdkCheck = new AndroidSdkCheck();
|
|
168
164
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
165
|
+
export class OptionalBundletoolCheck implements IDoctorCheck {
|
|
166
|
+
log!: AppiumLogger;
|
|
167
|
+
|
|
168
|
+
async diagnose(): Promise<DoctorCheckResult> {
|
|
172
169
|
const bundletoolPath = await resolveExecutablePath('bundletool.jar');
|
|
173
170
|
return bundletoolPath
|
|
174
171
|
? doctor.okOptional(`bundletool.jar is installed at: ${bundletoolPath}`)
|
|
175
172
|
: doctor.nokOptional('bundletool.jar cannot be found');
|
|
176
173
|
}
|
|
177
174
|
|
|
178
|
-
async fix() {
|
|
175
|
+
async fix(): Promise<string> {
|
|
179
176
|
return (
|
|
180
177
|
`${'bundletool.jar'.bold} is used to handle Android App bundles. ` +
|
|
181
178
|
`Please download the binary from ${BUNDLETOOL_RELEASES_LINK} and store it ` +
|
|
@@ -184,22 +181,22 @@ export class OptionalBundletoolCheck {
|
|
|
184
181
|
);
|
|
185
182
|
}
|
|
186
183
|
|
|
187
|
-
hasAutofix() {
|
|
184
|
+
hasAutofix(): boolean {
|
|
188
185
|
return false;
|
|
189
186
|
}
|
|
190
187
|
|
|
191
|
-
isOptional() {
|
|
188
|
+
isOptional(): boolean {
|
|
192
189
|
return true;
|
|
193
190
|
}
|
|
194
191
|
}
|
|
195
192
|
export const optionalBundletoolCheck = new OptionalBundletoolCheck();
|
|
196
193
|
|
|
197
|
-
|
|
198
|
-
|
|
194
|
+
export class OptionalGstreamerCheck implements IDoctorCheck {
|
|
195
|
+
log!: AppiumLogger;
|
|
199
196
|
GSTREAMER_BINARY = `gst-launch-1.0${system.isWindows() ? '.exe' : ''}`;
|
|
200
197
|
GST_INSPECT_BINARY = `gst-inspect-1.0${system.isWindows() ? '.exe' : ''}`;
|
|
201
198
|
|
|
202
|
-
async diagnose() {
|
|
199
|
+
async diagnose(): Promise<DoctorCheckResult> {
|
|
203
200
|
const gstreamerPath = await resolveExecutablePath(this.GSTREAMER_BINARY);
|
|
204
201
|
const gstInspectPath = await resolveExecutablePath(this.GST_INSPECT_BINARY);
|
|
205
202
|
|
|
@@ -212,7 +209,7 @@ export class OptionalGstreamerCheck {
|
|
|
212
209
|
);
|
|
213
210
|
}
|
|
214
211
|
|
|
215
|
-
async fix() {
|
|
212
|
+
async fix(): Promise<string> {
|
|
216
213
|
return (
|
|
217
214
|
`${
|
|
218
215
|
`${this.GSTREAMER_BINARY} and ${this.GST_INSPECT_BINARY}`.bold
|
|
@@ -221,21 +218,21 @@ export class OptionalGstreamerCheck {
|
|
|
221
218
|
);
|
|
222
219
|
}
|
|
223
220
|
|
|
224
|
-
hasAutofix() {
|
|
221
|
+
hasAutofix(): boolean {
|
|
225
222
|
return false;
|
|
226
223
|
}
|
|
227
224
|
|
|
228
|
-
isOptional() {
|
|
225
|
+
isOptional(): boolean {
|
|
229
226
|
return true;
|
|
230
227
|
}
|
|
231
228
|
}
|
|
232
229
|
export const optionalGstreamerCheck = new OptionalGstreamerCheck();
|
|
233
230
|
|
|
234
|
-
|
|
235
|
-
|
|
231
|
+
export class OptionalFfmpegCheck implements IDoctorCheck {
|
|
232
|
+
log!: AppiumLogger;
|
|
236
233
|
FFMPEG_BINARY = `ffmpeg${system.isWindows() ? '.exe' : ''}`;
|
|
237
234
|
|
|
238
|
-
async diagnose() {
|
|
235
|
+
async diagnose(): Promise<DoctorCheckResult> {
|
|
239
236
|
const ffmpegPath = await resolveExecutablePath(this.FFMPEG_BINARY);
|
|
240
237
|
|
|
241
238
|
return ffmpegPath
|
|
@@ -243,19 +240,20 @@ export class OptionalFfmpegCheck {
|
|
|
243
240
|
: doctor.nokOptional(`${this.FFMPEG_BINARY} cannot be found`);
|
|
244
241
|
}
|
|
245
242
|
|
|
246
|
-
async fix() {
|
|
243
|
+
async fix(): Promise<string> {
|
|
247
244
|
return (
|
|
248
245
|
`${`${this.FFMPEG_BINARY}`.bold} is used to capture screen recordings from the device under test. ` +
|
|
249
246
|
`Please read ${FFMPEG_INSTALL_LINK}.`
|
|
250
247
|
);
|
|
251
248
|
}
|
|
252
249
|
|
|
253
|
-
hasAutofix() {
|
|
250
|
+
hasAutofix(): boolean {
|
|
254
251
|
return false;
|
|
255
252
|
}
|
|
256
253
|
|
|
257
|
-
isOptional() {
|
|
254
|
+
isOptional(): boolean {
|
|
258
255
|
return true;
|
|
259
256
|
}
|
|
260
257
|
}
|
|
261
258
|
export const optionalFfmpegCheck = new OptionalFfmpegCheck();
|
|
259
|
+
|
|
@@ -3,10 +3,10 @@ import {fs} from '@appium/support';
|
|
|
3
3
|
/**
|
|
4
4
|
* Return an executable path of cmd
|
|
5
5
|
*
|
|
6
|
-
* @param
|
|
7
|
-
* @return
|
|
6
|
+
* @param cmd Standard output by command
|
|
7
|
+
* @return The full path of cmd. `null` if the cmd is not found.
|
|
8
8
|
*/
|
|
9
|
-
export async function resolveExecutablePath(cmd) {
|
|
9
|
+
export async function resolveExecutablePath(cmd: string): Promise<string | null> {
|
|
10
10
|
try {
|
|
11
11
|
const executablePath = await fs.which(cmd);
|
|
12
12
|
if (executablePath && (await fs.exists(executablePath))) {
|
|
@@ -15,3 +15,4 @@ export async function resolveExecutablePath(cmd) {
|
|
|
15
15
|
} catch {}
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
|
+
|
package/lib/logger.ts
ADDED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import type { MethodMap } from '@appium/types';
|
|
2
|
+
import type { AndroidDriver } from './driver';
|
|
3
|
+
|
|
4
|
+
export const newMethodMap = {
|
|
2
5
|
'/session/:sessionId/timeouts/implicit_wait': {
|
|
3
6
|
POST: {
|
|
4
7
|
command: 'implicitWait',
|
|
@@ -300,4 +303,5 @@ export const newMethodMap = /** @type {const} */ ({
|
|
|
300
303
|
deprecated: true,
|
|
301
304
|
},
|
|
302
305
|
},
|
|
303
|
-
}
|
|
306
|
+
} as const satisfies MethodMap<AndroidDriver>;
|
|
307
|
+
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import {errors} from 'appium/driver';
|
|
3
|
+
import type {LogEntry} from 'appium-adb';
|
|
4
|
+
import type {AndroidDriver} from './driver';
|
|
5
|
+
|
|
6
|
+
export type {LogEntry};
|
|
3
7
|
|
|
4
8
|
export const ADB_SHELL_FEATURE = 'adb_shell';
|
|
5
9
|
export const ADB_LISTEN_ALL_NETWORK_FEATURE = 'adb_listen_all_network';
|
|
@@ -9,11 +13,11 @@ const COLOR_CODE_PATTERN = /\u001b\[(\d+(;\d+)*)?m/g; // eslint-disable-line no-
|
|
|
9
13
|
/**
|
|
10
14
|
* Assert the presence of particular keys in the given object
|
|
11
15
|
*
|
|
12
|
-
* @param
|
|
13
|
-
* @param
|
|
14
|
-
* @returns
|
|
16
|
+
* @param argNames one or more key names
|
|
17
|
+
* @param opts the object to check
|
|
18
|
+
* @returns the same given object
|
|
15
19
|
*/
|
|
16
|
-
export function requireArgs(argNames, opts) {
|
|
20
|
+
export function requireArgs(argNames: string | string[], opts: Record<string, any>): Record<string, any> {
|
|
17
21
|
for (const argName of _.isArray(argNames) ? argNames : [argNames]) {
|
|
18
22
|
if (!_.has(opts, argName)) {
|
|
19
23
|
throw new errors.InvalidArgumentError(`'${argName}' argument must be provided`);
|
|
@@ -24,14 +28,13 @@ export function requireArgs(argNames, opts) {
|
|
|
24
28
|
|
|
25
29
|
/**
|
|
26
30
|
*
|
|
27
|
-
* @param
|
|
28
|
-
* @returns
|
|
31
|
+
* @param cap
|
|
32
|
+
* @returns
|
|
29
33
|
*/
|
|
30
|
-
export function parseArray(cap) {
|
|
34
|
+
export function parseArray(cap: string | string[]): string[] {
|
|
31
35
|
let parsedCaps;
|
|
32
36
|
try {
|
|
33
|
-
|
|
34
|
-
parsedCaps = JSON.parse(cap);
|
|
37
|
+
parsedCaps = JSON.parse(cap as string);
|
|
35
38
|
} catch {}
|
|
36
39
|
|
|
37
40
|
if (_.isArray(parsedCaps)) {
|
|
@@ -44,10 +47,10 @@ export function parseArray(cap) {
|
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
/**
|
|
47
|
-
* @this
|
|
48
|
-
* @returns
|
|
50
|
+
* @this AndroidDriver
|
|
51
|
+
* @returns
|
|
49
52
|
*/
|
|
50
|
-
export async function removeAllSessionWebSocketHandlers() {
|
|
53
|
+
export async function removeAllSessionWebSocketHandlers(this: AndroidDriver): Promise<void> {
|
|
51
54
|
if (!this.sessionId || !_.isFunction(this.server?.getWebSocketHandlers)) {
|
|
52
55
|
return;
|
|
53
56
|
}
|
|
@@ -58,15 +61,22 @@ export async function removeAllSessionWebSocketHandlers() {
|
|
|
58
61
|
}
|
|
59
62
|
}
|
|
60
63
|
|
|
64
|
+
interface LogEntryWithPrefix {
|
|
65
|
+
message: string;
|
|
66
|
+
prefix?: string;
|
|
67
|
+
timestamp?: number;
|
|
68
|
+
level?: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
61
71
|
/**
|
|
62
72
|
*
|
|
63
|
-
* @param
|
|
64
|
-
* @returns
|
|
73
|
+
* @param x
|
|
74
|
+
* @returns
|
|
65
75
|
*/
|
|
66
|
-
export function nativeLogEntryToSeleniumEntry
|
|
76
|
+
export function nativeLogEntryToSeleniumEntry(x: LogEntryWithPrefix): LogEntry {
|
|
67
77
|
const msg = _.isEmpty(x.prefix) ? x.message : `[${x.prefix}] ${x.message}`;
|
|
68
78
|
return toLogRecord(
|
|
69
|
-
|
|
79
|
+
x.timestamp ?? Date.now(),
|
|
70
80
|
_.replace(msg, COLOR_CODE_PATTERN, '')
|
|
71
81
|
);
|
|
72
82
|
}
|
|
@@ -74,21 +84,16 @@ export function nativeLogEntryToSeleniumEntry (x) {
|
|
|
74
84
|
/**
|
|
75
85
|
*
|
|
76
86
|
* @see {@link https://github.com/SeleniumHQ/selenium/blob/0d425676b3c9df261dd641917f867d4d5ce7774d/java/client/src/org/openqa/selenium/logging/LogEntry.java}
|
|
77
|
-
* @param
|
|
78
|
-
* @param
|
|
79
|
-
* @param
|
|
80
|
-
* @returns
|
|
87
|
+
* @param timestamp
|
|
88
|
+
* @param message
|
|
89
|
+
* @param level
|
|
90
|
+
* @returns
|
|
81
91
|
*/
|
|
82
|
-
export function toLogRecord(timestamp, message, level = 'ALL') {
|
|
92
|
+
export function toLogRecord(timestamp: number, message: string, level: string = 'ALL'): LogEntry {
|
|
83
93
|
return {
|
|
84
94
|
timestamp,
|
|
85
|
-
|
|
86
|
-
level,
|
|
95
|
+
level: level as any,
|
|
87
96
|
message,
|
|
88
97
|
};
|
|
89
98
|
}
|
|
90
99
|
|
|
91
|
-
/**
|
|
92
|
-
* @typedef {import('appium-adb').LogEntry} LogEntry
|
|
93
|
-
* @typedef {import('./driver').AndroidDriver} AndroidDriver
|
|
94
|
-
*/
|
package/package.json
CHANGED
package/lib/logger.js
DELETED