appium-geckodriver 1.2.10 → 1.3.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.
- package/CHANGELOG.md +14 -0
- package/README.md +13 -8
- package/build/lib/doctor/optional-checks.d.ts +47 -0
- package/build/lib/doctor/optional-checks.d.ts.map +1 -0
- package/build/lib/doctor/optional-checks.js +101 -0
- package/build/lib/doctor/optional-checks.js.map +1 -0
- package/build/lib/doctor/required-checks.d.ts +9 -0
- package/build/lib/doctor/required-checks.d.ts.map +1 -0
- package/build/lib/doctor/required-checks.js +32 -0
- package/build/lib/doctor/required-checks.js.map +1 -0
- package/build/lib/doctor/utils.d.ts +8 -0
- package/build/lib/doctor/utils.d.ts.map +1 -0
- package/build/lib/doctor/utils.js +22 -0
- package/build/lib/doctor/utils.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/lib/doctor/optional-checks.js +123 -0
- package/lib/doctor/required-checks.js +34 -0
- package/lib/doctor/utils.js +17 -0
- package/npm-shrinkwrap.json +1033 -648
- package/package.json +11 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.3.0](https://github.com/appium/appium-geckodriver/compare/v1.2.11...v1.3.0) (2024-02-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Add doctor checks ([#97](https://github.com/appium/appium-geckodriver/issues/97)) ([c256614](https://github.com/appium/appium-geckodriver/commit/c2566146fab45a9057eb10eedc91c9b8a7597126))
|
|
7
|
+
|
|
8
|
+
## [1.2.11](https://github.com/appium/appium-geckodriver/compare/v1.2.10...v1.2.11) (2024-01-16)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Miscellaneous Chores
|
|
12
|
+
|
|
13
|
+
* **deps-dev:** bump semantic-release from 22.0.12 to 23.0.0 ([#95](https://github.com/appium/appium-geckodriver/issues/95)) ([3c9a332](https://github.com/appium/appium-geckodriver/commit/3c9a33222b2f66bc452fe6c0481a91186deba8ff))
|
|
14
|
+
|
|
1
15
|
## [1.2.10](https://github.com/appium/appium-geckodriver/compare/v1.2.9...v1.2.10) (2023-12-02)
|
|
2
16
|
|
|
3
17
|
|
package/README.md
CHANGED
|
@@ -12,13 +12,12 @@ Under the hood this driver is a wrapper/proxy over `geckodriver` binary. Check t
|
|
|
12
12
|
|
|
13
13
|
> **Note**
|
|
14
14
|
>
|
|
15
|
-
> Since version 1.0.0 Gecko driver has dropped the support of Appium 1, and is only compatible to Appium 2. Use the `appium driver install gecko`
|
|
15
|
+
> Since version 1.0.0 Gecko driver has dropped the support of Appium 1, and is only compatible to Appium 2. Use the `appium driver install gecko`
|
|
16
16
|
> command to add it to your Appium 2 dist.
|
|
17
17
|
|
|
18
|
+
## Requirements
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
It is mandatory to have both Firefox browser installed and the geckodriver binary downloaded on the platform where automated tests are going to be executed. Firefox could be downloaded from the [official download site](https://www.mozilla.org/en-GB/firefox/all/) and the driver binary could be retrieved from the GitHub [releases page](https://github.com/mozilla/geckodriver/releases). The binary must be put into one of the folders included to PATH environment variable. On macOS it also might be necessary to run `xcattr -cr "<binary_path>"` to avoid [notarization](https://firefox-source-docs.mozilla.org/testing/geckodriver/Notarization.html) issues.
|
|
20
|
+
It is mandatory to have both Firefox browser installed and the geckodriver binary downloaded on the platform where automated tests are going to be executed. Firefox could be downloaded from the [official download site](https://www.mozilla.org/en-GB/firefox/all/) and the driver binary could be retrieved from the GitHub [releases page](https://github.com/mozilla/geckodriver/releases). The binary must be put into one of the folders included to PATH environment variable. On macOS it also might be necessary to run `xattr -cr "<binary_path>"` to avoid [notarization](https://firefox-source-docs.mozilla.org/testing/geckodriver/Notarization.html) issues.
|
|
22
21
|
|
|
23
22
|
Then you need to decide where the automated test is going to be executed. Gecko driver supports the following target platforms:
|
|
24
23
|
- macOS
|
|
@@ -26,9 +25,17 @@ Then you need to decide where the automated test is going to be executed. Gecko
|
|
|
26
25
|
- Linux
|
|
27
26
|
- Android (note that `android` *cannot* be passed as a value to `platformName` capability; it should always equal to the *host* platform name)
|
|
28
27
|
|
|
29
|
-
In order to run your automated tests on Android it is necessary to have [Android SDK](https://developer.android.com/studio) installed, so the destination device is marked as `online` in the `adb devices -l` command output.
|
|
28
|
+
In order to run your automated tests on an Android device it is necessary to have [Android SDK](https://developer.android.com/studio) installed, so the destination device is marked as `online` in the `adb devices -l` command output.
|
|
29
|
+
|
|
30
|
+
### Doctor
|
|
31
|
+
|
|
32
|
+
Since driver version 1.3.0 you can automate the validation for the most of the above
|
|
33
|
+
requirements as well as various optional ones needed by driver extensions by running the
|
|
34
|
+
`appium driver doctor gecko` server command.
|
|
30
35
|
|
|
31
|
-
|
|
36
|
+
## Capabilities
|
|
37
|
+
|
|
38
|
+
Gecko driver allows defining of multiple criterions for platform selection and also to fine-tune your automation session properties. This could be done via the following session capabilities:
|
|
32
39
|
|
|
33
40
|
Capability Name | Description
|
|
34
41
|
--- | ---
|
|
@@ -49,7 +56,6 @@ setWindowRect | See https://www.w3.org/TR/webdriver/#capabilities
|
|
|
49
56
|
timeouts | See https://www.w3.org/TR/webdriver/#capabilities
|
|
50
57
|
unhandledPromptBehavior | See https://www.w3.org/TR/webdriver/#capabilities
|
|
51
58
|
|
|
52
|
-
|
|
53
59
|
## Example
|
|
54
60
|
|
|
55
61
|
```python
|
|
@@ -146,7 +152,6 @@ def test_feature_status_page_filters(driver):
|
|
|
146
152
|
filt.click()
|
|
147
153
|
```
|
|
148
154
|
|
|
149
|
-
|
|
150
155
|
## Development
|
|
151
156
|
|
|
152
157
|
```bash
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export const androidHomeCheck: EnvVarAndPathCheck;
|
|
2
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
3
|
+
export class AndroidSdkCheck {
|
|
4
|
+
/** @type {import('@appium/types').AppiumLogger} */
|
|
5
|
+
log: import('@appium/types').AppiumLogger;
|
|
6
|
+
TOOL_NAMES: string[];
|
|
7
|
+
diagnose(): Promise<import("@appium/types").DoctorCheckResult>;
|
|
8
|
+
fix(): Promise<string>;
|
|
9
|
+
hasAutofix(): boolean;
|
|
10
|
+
isOptional(): boolean;
|
|
11
|
+
}
|
|
12
|
+
export const androidSdkCheck: AndroidSdkCheck;
|
|
13
|
+
export type EnvVarCheckOptions = {
|
|
14
|
+
/**
|
|
15
|
+
* If set to true then
|
|
16
|
+
* the path is expected to be a valid folder
|
|
17
|
+
*/
|
|
18
|
+
expectDir?: boolean | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* If set to true then
|
|
21
|
+
* the path is expected to be a valid file
|
|
22
|
+
*/
|
|
23
|
+
expectFile?: boolean | undefined;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* @typedef EnvVarCheckOptions
|
|
27
|
+
* @property {boolean} [expectDir] If set to true then
|
|
28
|
+
* the path is expected to be a valid folder
|
|
29
|
+
* @property {boolean} [expectFile] If set to true then
|
|
30
|
+
* the path is expected to be a valid file
|
|
31
|
+
*/
|
|
32
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
33
|
+
declare class EnvVarAndPathCheck {
|
|
34
|
+
/**
|
|
35
|
+
* @param {string} varName
|
|
36
|
+
* @param {EnvVarCheckOptions} [opts={}]
|
|
37
|
+
*/
|
|
38
|
+
constructor(varName: string, opts?: EnvVarCheckOptions | undefined);
|
|
39
|
+
varName: string;
|
|
40
|
+
opts: EnvVarCheckOptions;
|
|
41
|
+
diagnose(): Promise<import("@appium/types").DoctorCheckResult>;
|
|
42
|
+
fix(): Promise<string>;
|
|
43
|
+
hasAutofix(): boolean;
|
|
44
|
+
isOptional(): boolean;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=optional-checks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optional-checks.d.ts","sourceRoot":"","sources":["../../../lib/doctor/optional-checks.js"],"names":[],"mappings":"AAyEA,kDAA0F;AAE1F,wDAAwD;AACxD;IACE,mDAAmD;IACnD,KADW,OAAO,eAAe,EAAE,YAAY,CAC3C;IAEJ,qBAAiC;IAEjC,+DAsBC;IAED,uBAMC;IAED,sBAEC;IAED,sBAEC;CACF;AACD,8CAAqD;;;;;;;;;;;;;AAjHrD;;;;;;GAMG;AAEH,wDAAwD;AACxD;IACE;;;OAGG;IACH,qBAHW,MAAM,yCAMhB;IAFC,gBAAsB;IACtB,yBAAgB;IAGlB,+DA2BC;IAED,uBAMC;IAED,sBAEC;IAED,sBAEC;CACF"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.androidSdkCheck = exports.AndroidSdkCheck = exports.androidHomeCheck = void 0;
|
|
4
|
+
/* eslint-disable require-await */
|
|
5
|
+
const support_1 = require("@appium/support");
|
|
6
|
+
const appium_adb_1 = require("appium-adb");
|
|
7
|
+
const ENVIRONMENT_VARS_TUTORIAL_URL = 'https://github.com/appium/java-client/blob/master/docs/environment.md';
|
|
8
|
+
const ANDROID_SDK_LINK1 = 'https://developer.android.com/studio#cmdline-tools';
|
|
9
|
+
const ANDROID_SDK_LINK2 = 'https://developer.android.com/studio/intro/update#sdk-manager';
|
|
10
|
+
/**
|
|
11
|
+
* @typedef EnvVarCheckOptions
|
|
12
|
+
* @property {boolean} [expectDir] If set to true then
|
|
13
|
+
* the path is expected to be a valid folder
|
|
14
|
+
* @property {boolean} [expectFile] If set to true then
|
|
15
|
+
* the path is expected to be a valid file
|
|
16
|
+
*/
|
|
17
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
18
|
+
class EnvVarAndPathCheck {
|
|
19
|
+
/**
|
|
20
|
+
* @param {string} varName
|
|
21
|
+
* @param {EnvVarCheckOptions} [opts={}]
|
|
22
|
+
*/
|
|
23
|
+
constructor(varName, opts = {}) {
|
|
24
|
+
this.varName = varName;
|
|
25
|
+
this.opts = opts;
|
|
26
|
+
}
|
|
27
|
+
async diagnose() {
|
|
28
|
+
const varValue = process.env[this.varName];
|
|
29
|
+
if (!varValue) {
|
|
30
|
+
return support_1.doctor.nokOptional(`${this.varName} environment variable is NOT set!`);
|
|
31
|
+
}
|
|
32
|
+
if (!(await support_1.fs.exists(varValue))) {
|
|
33
|
+
let errMsg = `${this.varName} is set to '${varValue}' but this path does not exist!`;
|
|
34
|
+
if (support_1.system.isWindows() && varValue.includes('%')) {
|
|
35
|
+
errMsg += ` Consider replacing all references to other environment variables with absolute paths.`;
|
|
36
|
+
}
|
|
37
|
+
return support_1.doctor.nokOptional(errMsg);
|
|
38
|
+
}
|
|
39
|
+
const stat = await support_1.fs.stat(varValue);
|
|
40
|
+
if (this.opts.expectDir && !stat.isDirectory()) {
|
|
41
|
+
return support_1.doctor.nokOptional(`${this.varName} is expected to be a valid folder, got a file path instead`);
|
|
42
|
+
}
|
|
43
|
+
if (this.opts.expectFile && stat.isDirectory()) {
|
|
44
|
+
return support_1.doctor.nokOptional(`${this.varName} is expected to be a valid file, got a folder path instead`);
|
|
45
|
+
}
|
|
46
|
+
return support_1.doctor.okOptional(`${this.varName} is set to: ${varValue}`);
|
|
47
|
+
}
|
|
48
|
+
async fix() {
|
|
49
|
+
return (`Make sure the environment variable ${this.varName} is properly configured for the Appium process. ` +
|
|
50
|
+
`Android SDK is required if you want to run your tests on an Android device. ` +
|
|
51
|
+
`Refer ${ENVIRONMENT_VARS_TUTORIAL_URL} for more details.`);
|
|
52
|
+
}
|
|
53
|
+
hasAutofix() {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
isOptional() {
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.androidHomeCheck = new EnvVarAndPathCheck('ANDROID_HOME', { expectDir: true });
|
|
61
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
62
|
+
class AndroidSdkCheck {
|
|
63
|
+
constructor() {
|
|
64
|
+
this.TOOL_NAMES = ['adb', 'emulator'];
|
|
65
|
+
}
|
|
66
|
+
async diagnose() {
|
|
67
|
+
const listOfTools = this.TOOL_NAMES.join(', ');
|
|
68
|
+
const sdkRoot = (0, appium_adb_1.getSdkRootFromEnv)();
|
|
69
|
+
if (!sdkRoot) {
|
|
70
|
+
return support_1.doctor.nokOptional(`${listOfTools} could not be found because ANDROID_HOME is NOT set!`);
|
|
71
|
+
}
|
|
72
|
+
this.log.info(` Checking ${listOfTools}`);
|
|
73
|
+
const missingBinaries = [];
|
|
74
|
+
for (const binary of this.TOOL_NAMES) {
|
|
75
|
+
try {
|
|
76
|
+
this.log.info(` '${binary}' exists in ${await (0, appium_adb_1.getAndroidBinaryPath)(binary)}`);
|
|
77
|
+
}
|
|
78
|
+
catch (e) {
|
|
79
|
+
missingBinaries.push(binary);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (missingBinaries.length > 0) {
|
|
83
|
+
return support_1.doctor.nokOptional(`${missingBinaries.join(', ')} could NOT be found in '${sdkRoot}'!`);
|
|
84
|
+
}
|
|
85
|
+
return support_1.doctor.okOptional(`${listOfTools} exist in '${sdkRoot}'`);
|
|
86
|
+
}
|
|
87
|
+
async fix() {
|
|
88
|
+
return (`Manually install Android SDK and set ANDROID_HOME enviornment variable. ` +
|
|
89
|
+
`Android SDK is required if you want to run your tests on an Android device. ` +
|
|
90
|
+
`Read ${[ANDROID_SDK_LINK1, ANDROID_SDK_LINK2].join(' and ')}.`);
|
|
91
|
+
}
|
|
92
|
+
hasAutofix() {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
isOptional() {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.AndroidSdkCheck = AndroidSdkCheck;
|
|
100
|
+
exports.androidSdkCheck = new AndroidSdkCheck();
|
|
101
|
+
//# sourceMappingURL=optional-checks.js.map
|
|
@@ -0,0 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AAC,IAAI,CAAC,SAAS,MAAM,eAAe,MAAM,IAAA,iCAAoB,EAAC,MAAM,CAAC,EAAE,CAAC,CAAC;aACnF;YAAC,OAAO,CAAC,EAAE;gBACV,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aAC9B;SACF;QAED,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE;YAC9B,OAAO,gBAAM,CAAC,WAAW,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,2BAA2B,OAAO,IAAI,CAAC,CAAC;SAChG;QAED,OAAO,gBAAM,CAAC,UAAU,CAAC,GAAG,WAAW,cAAc,OAAO,GAAG,CAAC,CAAC;IACnE,CAAC;IAED,KAAK,CAAC,GAAG;QACP,OAAO,CACL,0EAA0E;YAC1E,8EAA8E;YAC9E,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAChE,CAAC;IACJ,CAAC;IAED,UAAU;QACR,OAAO,KAAK,CAAC;IACf,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA7CD,0CA6CC;AACY,QAAA,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
2
|
+
export class GeckodriverCheck {
|
|
3
|
+
diagnose(): Promise<import("@appium/types").DoctorCheckResult>;
|
|
4
|
+
fix(): Promise<string>;
|
|
5
|
+
hasAutofix(): boolean;
|
|
6
|
+
isOptional(): boolean;
|
|
7
|
+
}
|
|
8
|
+
export const geckodriverCheck: GeckodriverCheck;
|
|
9
|
+
//# sourceMappingURL=required-checks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"required-checks.d.ts","sourceRoot":"","sources":["../../../lib/doctor/required-checks.js"],"names":[],"mappings":"AAOA,wDAAwD;AACxD;IACE,+DAKC;IAED,uBAOC;IAED,sBAEC;IAED,sBAEC;CACF;AACD,gDAAuD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.geckodriverCheck = exports.GeckodriverCheck = void 0;
|
|
4
|
+
/* eslint-disable require-await */
|
|
5
|
+
const utils_1 = require("./utils");
|
|
6
|
+
const support_1 = require("@appium/support");
|
|
7
|
+
const GD_DOWNLOAD_LINK = 'https://github.com/mozilla/geckodriver/releases';
|
|
8
|
+
const GD_BINARY = `geckodriver${support_1.system.isWindows() ? '.exe' : ''}`;
|
|
9
|
+
/** @satisfies {import('@appium/types').IDoctorCheck} */
|
|
10
|
+
class GeckodriverCheck {
|
|
11
|
+
async diagnose() {
|
|
12
|
+
const gdPath = await (0, utils_1.resolveExecutablePath)(GD_BINARY);
|
|
13
|
+
return gdPath
|
|
14
|
+
? support_1.doctor.ok(`${GD_BINARY} is installed at: ${gdPath}`)
|
|
15
|
+
: support_1.doctor.nok(`${GD_BINARY} cannot be found`);
|
|
16
|
+
}
|
|
17
|
+
async fix() {
|
|
18
|
+
return (`${GD_BINARY} is required to pass W3C commands to the remote browser. ` +
|
|
19
|
+
`Please download the binary from ${GD_DOWNLOAD_LINK} and store it ` +
|
|
20
|
+
`to any folder listed in the PATH environment variable. Folders that ` +
|
|
21
|
+
`are currently present in PATH: ${process.env.PATH}`);
|
|
22
|
+
}
|
|
23
|
+
hasAutofix() {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
isOptional() {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.GeckodriverCheck = GeckodriverCheck;
|
|
31
|
+
exports.geckodriverCheck = new GeckodriverCheck();
|
|
32
|
+
//# sourceMappingURL=required-checks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"required-checks.js","sourceRoot":"","sources":["../../../lib/doctor/required-checks.js"],"names":[],"mappings":";;;AAAA,kCAAkC;AAClC,mCAA8C;AAC9C,6CAA+C;AAE/C,MAAM,gBAAgB,GAAG,iDAAiD,CAAC;AAC3E,MAAM,SAAS,GAAG,cAAc,gBAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAEnE,wDAAwD;AACxD,MAAa,gBAAgB;IAC3B,KAAK,CAAC,QAAQ;QACZ,MAAM,MAAM,GAAG,MAAM,IAAA,6BAAqB,EAAC,SAAS,CAAC,CAAC;QACtD,OAAO,MAAM;YACX,CAAC,CAAC,gBAAM,CAAC,EAAE,CAAC,GAAG,SAAS,qBAAqB,MAAM,EAAE,CAAC;YACtD,CAAC,CAAC,gBAAM,CAAC,GAAG,CAAC,GAAG,SAAS,kBAAkB,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,GAAG;QACP,OAAO,CACL,GAAG,SAAS,2DAA2D;YACvE,mCAAmC,gBAAgB,gBAAgB;YACnE,sEAAsE;YACtE,kCAAkC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CACrD,CAAC;IACJ,CAAC;IAED,UAAU;QACR,OAAO,KAAK,CAAC;IACf,CAAC;IAED,UAAU;QACR,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAxBD,4CAwBC;AACY,QAAA,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return an executable path of cmd
|
|
3
|
+
*
|
|
4
|
+
* @param {string} cmd Standard output by command
|
|
5
|
+
* @return {Promise<string?>} The full path of cmd. `null` if the cmd is not found.
|
|
6
|
+
*/
|
|
7
|
+
export function resolveExecutablePath(cmd: string): Promise<string | null>;
|
|
8
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../lib/doctor/utils.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,2CAHW,MAAM,GACL,QAAQ,MAAM,QAAE,CAU3B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveExecutablePath = void 0;
|
|
4
|
+
const support_1 = require("@appium/support");
|
|
5
|
+
/**
|
|
6
|
+
* Return an executable path of cmd
|
|
7
|
+
*
|
|
8
|
+
* @param {string} cmd Standard output by command
|
|
9
|
+
* @return {Promise<string?>} The full path of cmd. `null` if the cmd is not found.
|
|
10
|
+
*/
|
|
11
|
+
async function resolveExecutablePath(cmd) {
|
|
12
|
+
try {
|
|
13
|
+
const executablePath = await support_1.fs.which(cmd);
|
|
14
|
+
if (executablePath && (await support_1.fs.exists(executablePath))) {
|
|
15
|
+
return executablePath;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
catch (err) { }
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
exports.resolveExecutablePath = resolveExecutablePath;
|
|
22
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../lib/doctor/utils.js"],"names":[],"mappings":";;;AAAA,6CAAmC;AAEnC;;;;;GAKG;AACI,KAAK,UAAU,qBAAqB,CAAC,GAAG;IAC7C,IAAI;QACF,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;YACvD,OAAO,cAAc,CAAC;SACvB;KACF;IAAC,OAAO,GAAG,EAAE,GAAE;IAChB,OAAO,IAAI,CAAC;AACd,CAAC;AARD,sDAQC"}
|