appium 3.2.2 → 3.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/build/lib/cli/args.d.ts +16 -12
- package/build/lib/cli/args.d.ts.map +1 -1
- package/build/lib/cli/args.js +15 -35
- package/build/lib/cli/args.js.map +1 -1
- package/build/lib/cli/driver-command.d.ts +51 -93
- package/build/lib/cli/driver-command.d.ts.map +1 -1
- package/build/lib/cli/driver-command.js +11 -66
- package/build/lib/cli/driver-command.js.map +1 -1
- package/build/lib/cli/extension-command.d.ts +211 -415
- package/build/lib/cli/extension-command.d.ts.map +1 -1
- package/build/lib/cli/extension-command.js +384 -653
- package/build/lib/cli/extension-command.js.map +1 -1
- package/build/lib/cli/extension.d.ts +11 -16
- package/build/lib/cli/extension.d.ts.map +1 -1
- package/build/lib/cli/extension.js +10 -28
- package/build/lib/cli/extension.js.map +1 -1
- package/build/lib/cli/parser.d.ts +40 -69
- package/build/lib/cli/parser.d.ts.map +1 -1
- package/build/lib/cli/parser.js +24 -59
- package/build/lib/cli/parser.js.map +1 -1
- package/build/lib/cli/plugin-command.d.ts +50 -90
- package/build/lib/cli/plugin-command.d.ts.map +1 -1
- package/build/lib/cli/plugin-command.js +11 -63
- package/build/lib/cli/plugin-command.js.map +1 -1
- package/build/lib/cli/setup-command.d.ts +21 -26
- package/build/lib/cli/setup-command.d.ts.map +1 -1
- package/build/lib/cli/setup-command.js +13 -55
- package/build/lib/cli/setup-command.js.map +1 -1
- package/build/lib/cli/utils.d.ts +27 -29
- package/build/lib/cli/utils.d.ts.map +1 -1
- package/build/lib/cli/utils.js +29 -31
- package/build/lib/cli/utils.js.map +1 -1
- package/build/lib/config-file.d.ts +24 -67
- package/build/lib/config-file.d.ts.map +1 -1
- package/build/lib/config-file.js +56 -115
- package/build/lib/config-file.js.map +1 -1
- package/build/lib/config.d.ts +42 -44
- package/build/lib/config.d.ts.map +1 -1
- package/build/lib/config.js +75 -107
- package/build/lib/config.js.map +1 -1
- package/build/lib/constants.d.ts +23 -23
- package/build/lib/constants.d.ts.map +1 -1
- package/build/lib/constants.js +10 -15
- package/build/lib/constants.js.map +1 -1
- package/build/lib/doctor/doctor.d.ts +40 -57
- package/build/lib/doctor/doctor.d.ts.map +1 -1
- package/build/lib/doctor/doctor.js +29 -60
- package/build/lib/doctor/doctor.js.map +1 -1
- package/build/lib/grid-register.d.ts +32 -7
- package/build/lib/grid-register.d.ts.map +1 -1
- package/build/lib/grid-register.js +84 -48
- package/build/lib/grid-register.js.map +1 -1
- package/build/lib/logsink.d.ts +13 -22
- package/build/lib/logsink.d.ts.map +1 -1
- package/build/lib/logsink.js +48 -103
- package/build/lib/logsink.js.map +1 -1
- package/build/lib/main.js +1 -1
- package/build/lib/main.js.map +1 -1
- package/build/lib/schema/arg-spec.d.ts +32 -107
- package/build/lib/schema/arg-spec.d.ts.map +1 -1
- package/build/lib/schema/arg-spec.js +11 -107
- package/build/lib/schema/arg-spec.js.map +1 -1
- package/build/lib/schema/cli-args.d.ts +3 -15
- package/build/lib/schema/cli-args.d.ts.map +1 -1
- package/build/lib/schema/cli-args.js +15 -105
- package/build/lib/schema/cli-args.js.map +1 -1
- package/build/lib/schema/cli-transformers.d.ts +15 -12
- package/build/lib/schema/cli-transformers.d.ts.map +1 -1
- package/build/lib/schema/cli-transformers.js +15 -45
- package/build/lib/schema/cli-transformers.js.map +1 -1
- package/build/lib/schema/index.d.ts +2 -2
- package/build/lib/schema/index.d.ts.map +1 -1
- package/build/lib/schema/index.js.map +1 -1
- package/build/lib/schema/keywords.d.ts +12 -20
- package/build/lib/schema/keywords.d.ts.map +1 -1
- package/build/lib/schema/keywords.js +6 -51
- package/build/lib/schema/keywords.js.map +1 -1
- package/build/lib/schema/schema.d.ts +106 -231
- package/build/lib/schema/schema.d.ts.map +1 -1
- package/build/lib/schema/schema.js +75 -345
- package/build/lib/schema/schema.js.map +1 -1
- package/build/lib/utils.d.ts +59 -238
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +55 -207
- package/build/lib/utils.js.map +1 -1
- package/lib/cli/{args.js → args.ts} +40 -51
- package/lib/cli/driver-command.ts +122 -0
- package/lib/cli/{extension-command.js → extension-command.ts} +610 -689
- package/lib/cli/extension.ts +65 -0
- package/lib/cli/{parser.js → parser.ts} +48 -71
- package/lib/cli/plugin-command.ts +117 -0
- package/lib/cli/{setup-command.js → setup-command.ts} +57 -72
- package/lib/cli/utils.ts +97 -0
- package/lib/config-file.ts +212 -0
- package/lib/{config.js → config.ts} +129 -141
- package/lib/{constants.js → constants.ts} +30 -41
- package/lib/doctor/{doctor.js → doctor.ts} +81 -91
- package/lib/grid-register.ts +250 -0
- package/lib/{logsink.js → logsink.ts} +91 -137
- package/lib/main.js +1 -1
- package/lib/schema/arg-spec.ts +131 -0
- package/lib/schema/cli-args.ts +171 -0
- package/lib/schema/cli-transformers.ts +83 -0
- package/lib/schema/keywords.ts +96 -0
- package/lib/schema/schema.ts +449 -0
- package/lib/utils.ts +404 -0
- package/package.json +16 -16
- package/lib/cli/driver-command.js +0 -174
- package/lib/cli/extension.js +0 -74
- package/lib/cli/plugin-command.js +0 -164
- package/lib/cli/utils.js +0 -91
- package/lib/config-file.js +0 -228
- package/lib/grid-register.js +0 -146
- package/lib/schema/arg-spec.js +0 -229
- package/lib/schema/cli-args.js +0 -254
- package/lib/schema/cli-transformers.js +0 -113
- package/lib/schema/keywords.js +0 -136
- package/lib/schema/schema.js +0 -725
- package/lib/utils.js +0 -512
- /package/lib/schema/{index.js → index.ts} +0 -0
package/build/lib/config.d.ts
CHANGED
|
@@ -1,70 +1,68 @@
|
|
|
1
|
+
import type { BuildInfo, Args } from 'appium/types';
|
|
2
|
+
import type { ReadConfigFileResult } from './config-file';
|
|
3
|
+
export declare const APPIUM_VER: string;
|
|
4
|
+
export declare const rootDir: string;
|
|
1
5
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @returns {Promise<void>}
|
|
6
|
+
* Update mutable build info metadata from local git or GitHub fallback.
|
|
4
7
|
*/
|
|
5
|
-
export function updateBuildInfo(useGithubApiFallback?: boolean): Promise<void>;
|
|
8
|
+
export declare function updateBuildInfo(useGithubApiFallback?: boolean): Promise<void>;
|
|
6
9
|
/**
|
|
7
|
-
* Prints server debug
|
|
8
|
-
*
|
|
9
|
-
* @param {{
|
|
10
|
-
* driverConfig: import('./extension/driver-config').DriverConfig,
|
|
11
|
-
* pluginConfig: import('./extension/plugin-config').PluginConfig,
|
|
12
|
-
* appiumHome: string
|
|
13
|
-
* }} info
|
|
14
|
-
* @returns {Promise<void>}
|
|
10
|
+
* Prints server debug info to stdout.
|
|
15
11
|
*/
|
|
16
|
-
export function showDebugInfo({ driverConfig, pluginConfig, appiumHome }:
|
|
17
|
-
driverConfig: import("./extension/driver-config").DriverConfig;
|
|
18
|
-
pluginConfig: import("./extension/plugin-config").PluginConfig;
|
|
19
|
-
appiumHome: string;
|
|
20
|
-
}): Promise<void>;
|
|
12
|
+
export declare function showDebugInfo({ driverConfig, pluginConfig, appiumHome }: DebugInfoInput): Promise<void>;
|
|
21
13
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
14
|
+
* Returns the current git commit SHA for this Appium checkout.
|
|
15
|
+
*
|
|
16
|
+
* Attempts to read from local git first; when unavailable and fallback is enabled,
|
|
17
|
+
* queries the GitHub API for the tag matching the current Appium version.
|
|
24
18
|
*/
|
|
25
|
-
export function getGitRev(useGithubApiFallback?: boolean): Promise<string | null>;
|
|
19
|
+
export declare function getGitRev(useGithubApiFallback?: boolean): Promise<string | null>;
|
|
26
20
|
/**
|
|
27
21
|
* Mutable object containing Appium build information. By default it
|
|
28
22
|
* only contains the Appium version, but is updated with the build timestamp
|
|
29
23
|
* and git commit hash asynchronously as soon as `updateBuildInfo` is called
|
|
30
24
|
* and succeeds.
|
|
31
|
-
* @returns {import('appium/types').BuildInfo}
|
|
32
25
|
*/
|
|
33
|
-
export function getBuildInfo():
|
|
26
|
+
export declare function getBuildInfo(): BuildInfo;
|
|
34
27
|
/**
|
|
35
|
-
* @returns {void}
|
|
36
28
|
* @throws {Error} If Node version is outside of the supported range
|
|
37
29
|
*/
|
|
38
|
-
export function checkNodeOk(): void;
|
|
39
|
-
|
|
30
|
+
export declare function checkNodeOk(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Prints the current build info JSON to stdout.
|
|
33
|
+
*
|
|
34
|
+
* This updates build metadata first (using GitHub fallback) and then logs the
|
|
35
|
+
* resulting {@link BuildInfo} object.
|
|
36
|
+
*/
|
|
37
|
+
export declare function showBuildInfo(): Promise<void>;
|
|
40
38
|
/**
|
|
41
39
|
* Returns k/v pairs of server arguments which are _not_ the defaults.
|
|
42
|
-
* @param {Args} parsedArgs
|
|
43
|
-
* @returns {Args}
|
|
44
40
|
*/
|
|
45
|
-
export function getNonDefaultServerArgs(parsedArgs: Args): Args;
|
|
41
|
+
export declare function getNonDefaultServerArgs(parsedArgs: Args): Args;
|
|
46
42
|
/**
|
|
47
43
|
* Shows a breakdown of the current config after CLI params, config file loaded & defaults applied.
|
|
48
44
|
*
|
|
49
|
-
* The actual shape of `preConfigParsedArgs` and `defaults` does not matter for the purposes of this
|
|
50
|
-
* but it's intended to be called with values of type {@link ParsedArgs} and
|
|
51
|
-
*
|
|
52
|
-
* @param {Partial<ParsedArgs>} nonDefaultPreConfigParsedArgs - Parsed CLI args (or param to `init()`) before config & defaults applied
|
|
53
|
-
* @param {import('./config-file').ReadConfigFileResult} configResult - Result of attempting to load a config file. _Must_ be normalized
|
|
54
|
-
* @param {Partial<ParsedArgs>} defaults - Configuration defaults from schemas
|
|
55
|
-
* @param {ParsedArgs} parsedArgs - Entire parsed args object
|
|
45
|
+
* The actual shape of `preConfigParsedArgs` and `defaults` does not matter for the purposes of this
|
|
46
|
+
* function, but it's intended to be called with values of type {@link ParsedArgs} and
|
|
47
|
+
* `DefaultValues<true>`, respectively.
|
|
56
48
|
*/
|
|
57
|
-
export function showConfig(nonDefaultPreConfigParsedArgs: Partial<
|
|
49
|
+
export declare function showConfig(nonDefaultPreConfigParsedArgs: Partial<Args>, configResult: ReadConfigFileResult, defaults: Partial<Args>, parsedArgs: Args): void;
|
|
58
50
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
51
|
+
* Ensures a directory exists and (optionally) is writeable.
|
|
52
|
+
*
|
|
53
|
+
* If the directory does not exist, this attempts to create it recursively.
|
|
54
|
+
*
|
|
62
55
|
* @throws {Error}
|
|
63
56
|
*/
|
|
64
|
-
export function requireDir(root: string, requireWriteable?: boolean, displayName?: string): Promise<void>;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
57
|
+
export declare function requireDir(root: string, requireWriteable?: boolean, displayName?: string): Promise<void>;
|
|
58
|
+
interface DebugInfoInput {
|
|
59
|
+
driverConfig: {
|
|
60
|
+
installedExtensions: unknown;
|
|
61
|
+
};
|
|
62
|
+
pluginConfig: {
|
|
63
|
+
installedExtensions: unknown;
|
|
64
|
+
};
|
|
65
|
+
appiumHome: string;
|
|
66
|
+
}
|
|
67
|
+
export {};
|
|
70
68
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../lib/config.
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../lib/config.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAC,SAAS,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAExD,eAAO,MAAM,UAAU,QAAqB,CAAC;AAG7C,eAAO,MAAM,OAAO,QAAyB,CAAC;AAS9C;;GAEG;AACH,wBAAsB,eAAe,CAAC,oBAAoB,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAUjF;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,EAAC,YAAY,EAAE,YAAY,EAAE,UAAU,EAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAyC3G;AAED;;;;;GAKG;AACH,wBAAsB,SAAS,CAAC,oBAAoB,UAAQ,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA2BpF;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAExC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAKlC;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAGnD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,IAAI,GAAG,IAAI,CA0E9D;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,6BAA6B,EAAE,OAAO,CAAC,IAAI,CAAC,EAC5C,YAAY,EAAE,oBAAoB,EAClC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,EACvB,UAAU,EAAE,IAAI,GACf,IAAI,CAmBN;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,MAAM,EACZ,gBAAgB,UAAO,EACvB,WAAW,SAAgB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAyBf;AAmED,UAAU,cAAc;IACtB,YAAY,EAAE;QAAC,mBAAmB,EAAE,OAAO,CAAA;KAAC,CAAC;IAC7C,YAAY,EAAE;QAAC,mBAAmB,EAAE,OAAO,CAAA;KAAC,CAAC;IAC7C,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
package/build/lib/config.js
CHANGED
|
@@ -57,23 +57,16 @@ const utils_1 = require("./utils");
|
|
|
57
57
|
const bluebird_1 = __importDefault(require("bluebird"));
|
|
58
58
|
const schema_1 = require("./schema/schema");
|
|
59
59
|
exports.APPIUM_VER = utils_1.npmPackage.version;
|
|
60
|
-
const ENGINES =
|
|
60
|
+
const ENGINES = utils_1.npmPackage.engines;
|
|
61
61
|
const MIN_NODE_VERSION = ENGINES.node;
|
|
62
62
|
exports.rootDir = support_1.fs.findRoot(__dirname);
|
|
63
63
|
const GIT_BINARY = `git${support_1.system.isWindows() ? '.exe' : ''}`;
|
|
64
64
|
const GITHUB_API = 'https://api.github.com/repos/appium/appium';
|
|
65
|
-
/**
|
|
66
|
-
* @type {import('appium/types').BuildInfo}
|
|
67
|
-
*/
|
|
68
65
|
const BUILD_INFO = {
|
|
69
66
|
version: exports.APPIUM_VER,
|
|
70
67
|
};
|
|
71
|
-
function getNodeVersion() {
|
|
72
|
-
return /** @type {import('semver').SemVer} */ (semver.coerce(process.version));
|
|
73
|
-
}
|
|
74
68
|
/**
|
|
75
|
-
*
|
|
76
|
-
* @returns {Promise<void>}
|
|
69
|
+
* Update mutable build info metadata from local git or GitHub fallback.
|
|
77
70
|
*/
|
|
78
71
|
async function updateBuildInfo(useGithubApiFallback = false) {
|
|
79
72
|
const sha = await getGitRev(useGithubApiFallback);
|
|
@@ -86,24 +79,8 @@ async function updateBuildInfo(useGithubApiFallback = false) {
|
|
|
86
79
|
BUILD_INFO.built = buildTimestamp;
|
|
87
80
|
}
|
|
88
81
|
}
|
|
89
|
-
/** @type {() => Promise<string?>} */
|
|
90
|
-
const getFullGitPath = lodash_1.default.memoize(async function getFullGitPath() {
|
|
91
|
-
try {
|
|
92
|
-
return await support_1.fs.which(GIT_BINARY);
|
|
93
|
-
}
|
|
94
|
-
catch {
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
82
|
/**
|
|
99
|
-
* Prints server debug
|
|
100
|
-
*
|
|
101
|
-
* @param {{
|
|
102
|
-
* driverConfig: import('./extension/driver-config').DriverConfig,
|
|
103
|
-
* pluginConfig: import('./extension/plugin-config').PluginConfig,
|
|
104
|
-
* appiumHome: string
|
|
105
|
-
* }} info
|
|
106
|
-
* @returns {Promise<void>}
|
|
83
|
+
* Prints server debug info to stdout.
|
|
107
84
|
*/
|
|
108
85
|
async function showDebugInfo({ driverConfig, pluginConfig, appiumHome }) {
|
|
109
86
|
const getNpmVersion = async () => {
|
|
@@ -112,8 +89,8 @@ async function showDebugInfo({ driverConfig, pluginConfig, appiumHome }) {
|
|
|
112
89
|
};
|
|
113
90
|
const findNpmLocation = async () => await support_1.fs.which(support_1.system.isWindows() ? 'npm.cmd' : 'npm');
|
|
114
91
|
const [npmVersion, npmLocation] = await bluebird_1.default.all([
|
|
115
|
-
...
|
|
116
|
-
|
|
92
|
+
...[getNpmVersion, findNpmLocation].map((f) => getSafeResult(f, 'unknown')),
|
|
93
|
+
updateBuildInfo(),
|
|
117
94
|
]);
|
|
118
95
|
const debugInfo = {
|
|
119
96
|
os: {
|
|
@@ -145,8 +122,10 @@ async function showDebugInfo({ driverConfig, pluginConfig, appiumHome }) {
|
|
|
145
122
|
console.log(JSON.stringify(debugInfo, null, 2));
|
|
146
123
|
}
|
|
147
124
|
/**
|
|
148
|
-
*
|
|
149
|
-
*
|
|
125
|
+
* Returns the current git commit SHA for this Appium checkout.
|
|
126
|
+
*
|
|
127
|
+
* Attempts to read from local git first; when unavailable and fallback is enabled,
|
|
128
|
+
* queries the GitHub API for the tag matching the current Appium version.
|
|
150
129
|
*/
|
|
151
130
|
async function getGitRev(useGithubApiFallback = false) {
|
|
152
131
|
const fullGitPath = await getFullGitPath();
|
|
@@ -174,47 +153,16 @@ async function getGitRev(useGithubApiFallback = false) {
|
|
|
174
153
|
catch { }
|
|
175
154
|
return null;
|
|
176
155
|
}
|
|
177
|
-
/**
|
|
178
|
-
* @param {string} commitSha
|
|
179
|
-
* @param {boolean} [useGithubApiFallback]
|
|
180
|
-
* @returns {Promise<string?>}
|
|
181
|
-
*/
|
|
182
|
-
async function getGitTimestamp(commitSha, useGithubApiFallback = false) {
|
|
183
|
-
const fullGitPath = await getFullGitPath();
|
|
184
|
-
if (fullGitPath) {
|
|
185
|
-
try {
|
|
186
|
-
const { stdout } = await (0, teen_process_1.exec)(fullGitPath, ['show', '-s', '--format=%ci', commitSha], {
|
|
187
|
-
cwd: __dirname,
|
|
188
|
-
});
|
|
189
|
-
return stdout.trim();
|
|
190
|
-
}
|
|
191
|
-
catch { }
|
|
192
|
-
}
|
|
193
|
-
if (!useGithubApiFallback) {
|
|
194
|
-
return null;
|
|
195
|
-
}
|
|
196
|
-
try {
|
|
197
|
-
return (await axios_1.default.get(`${GITHUB_API}/git/tags/${commitSha}`, {
|
|
198
|
-
headers: {
|
|
199
|
-
'User-Agent': `Appium ${exports.APPIUM_VER}`,
|
|
200
|
-
},
|
|
201
|
-
})).data?.tagger?.date;
|
|
202
|
-
}
|
|
203
|
-
catch { }
|
|
204
|
-
return null;
|
|
205
|
-
}
|
|
206
156
|
/**
|
|
207
157
|
* Mutable object containing Appium build information. By default it
|
|
208
158
|
* only contains the Appium version, but is updated with the build timestamp
|
|
209
159
|
* and git commit hash asynchronously as soon as `updateBuildInfo` is called
|
|
210
160
|
* and succeeds.
|
|
211
|
-
* @returns {import('appium/types').BuildInfo}
|
|
212
161
|
*/
|
|
213
162
|
function getBuildInfo() {
|
|
214
163
|
return BUILD_INFO;
|
|
215
164
|
}
|
|
216
165
|
/**
|
|
217
|
-
* @returns {void}
|
|
218
166
|
* @throws {Error} If Node version is outside of the supported range
|
|
219
167
|
*/
|
|
220
168
|
function checkNodeOk() {
|
|
@@ -223,21 +171,23 @@ function checkNodeOk() {
|
|
|
223
171
|
throw new Error(`Node version must be at least ${MIN_NODE_VERSION}; current is ${version.version}`);
|
|
224
172
|
}
|
|
225
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Prints the current build info JSON to stdout.
|
|
176
|
+
*
|
|
177
|
+
* This updates build metadata first (using GitHub fallback) and then logs the
|
|
178
|
+
* resulting {@link BuildInfo} object.
|
|
179
|
+
*/
|
|
226
180
|
async function showBuildInfo() {
|
|
227
181
|
await updateBuildInfo(true);
|
|
228
182
|
console.log(JSON.stringify(getBuildInfo()));
|
|
229
183
|
}
|
|
230
184
|
/**
|
|
231
185
|
* Returns k/v pairs of server arguments which are _not_ the defaults.
|
|
232
|
-
* @param {Args} parsedArgs
|
|
233
|
-
* @returns {Args}
|
|
234
186
|
*/
|
|
235
187
|
function getNonDefaultServerArgs(parsedArgs) {
|
|
236
188
|
/**
|
|
237
189
|
* Flattens parsed args into a single level object for comparison with
|
|
238
190
|
* flattened defaults across server args and extension args.
|
|
239
|
-
* @param {Args} args
|
|
240
|
-
* @returns {Record<string, { value: any, argSpec: ArgSpec }>}
|
|
241
191
|
*/
|
|
242
192
|
const flatten = (args) => {
|
|
243
193
|
const argSpecs = (0, schema_1.getAllArgSpecs)();
|
|
@@ -246,18 +196,17 @@ function getNonDefaultServerArgs(parsedArgs) {
|
|
|
246
196
|
acc[argSpec.dest] = { value: lodash_1.default.get(args, argSpec.dest), argSpec };
|
|
247
197
|
}
|
|
248
198
|
return acc;
|
|
249
|
-
},
|
|
250
|
-
/** @type {Record<string, { value: any, argSpec: ArgSpec }>} */ ({}));
|
|
199
|
+
}, {});
|
|
251
200
|
return flattened;
|
|
252
201
|
};
|
|
253
202
|
const args = flatten(parsedArgs);
|
|
254
203
|
// hopefully these function names are descriptive enough
|
|
255
|
-
const typesDiffer =
|
|
256
|
-
const defaultValueIsArray =
|
|
257
|
-
const argsValueIsArray =
|
|
258
|
-
const arraysDiffer =
|
|
259
|
-
const valuesDiffer =
|
|
260
|
-
const defaultIsDefined =
|
|
204
|
+
const typesDiffer = (dest) => typeof args[dest].value !== typeof defaultsFromSchema[dest];
|
|
205
|
+
const defaultValueIsArray = (dest) => lodash_1.default.isArray(defaultsFromSchema[dest]);
|
|
206
|
+
const argsValueIsArray = (dest) => lodash_1.default.isArray(args[dest].value);
|
|
207
|
+
const arraysDiffer = (dest) => lodash_1.default.gt(lodash_1.default.size(lodash_1.default.difference(args[dest].value, defaultsFromSchema[dest])), 0);
|
|
208
|
+
const valuesDiffer = (dest) => args[dest].value !== defaultsFromSchema[dest];
|
|
209
|
+
const defaultIsDefined = (dest) => !lodash_1.default.isUndefined(defaultsFromSchema[dest]);
|
|
261
210
|
// note that `_.overEvery` is like an "AND", and `_.overSome` is like an "OR"
|
|
262
211
|
const argValueNotArrayOrArraysDiffer = lodash_1.default.overSome([lodash_1.default.negate(argsValueIsArray), arraysDiffer]);
|
|
263
212
|
const defaultValueNotArrayAndValuesDiffer = lodash_1.default.overEvery([
|
|
@@ -274,7 +223,6 @@ function getNonDefaultServerArgs(parsedArgs) {
|
|
|
274
223
|
* - if so, and the default is an array:
|
|
275
224
|
* - ensures the args value is an array
|
|
276
225
|
* - ensures the args values do not differ from the default values
|
|
277
|
-
* @type {(dest: string) => boolean}
|
|
278
226
|
*/
|
|
279
227
|
const isNotDefault = lodash_1.default.overEvery([
|
|
280
228
|
defaultIsDefined,
|
|
@@ -285,29 +233,16 @@ function getNonDefaultServerArgs(parsedArgs) {
|
|
|
285
233
|
]),
|
|
286
234
|
]);
|
|
287
235
|
const defaultsFromSchema = (0, schema_1.getDefaultsForSchema)(true);
|
|
288
|
-
return lodash_1.default.reduce(lodash_1.default.pickBy(args, (
|
|
236
|
+
return lodash_1.default.reduce(lodash_1.default.pickBy(args, (_v, key) => isNotDefault(key)),
|
|
289
237
|
// explodes the flattened object back into nested one
|
|
290
|
-
(acc, { value, argSpec }) => lodash_1.default.set(acc, argSpec.dest, value),
|
|
291
|
-
/** @type {Args} */ ({}));
|
|
238
|
+
(acc, { value, argSpec }) => lodash_1.default.set(acc, argSpec.dest, value), {});
|
|
292
239
|
}
|
|
293
|
-
/**
|
|
294
|
-
* Compacts an object for {@link showConfig}:
|
|
295
|
-
* 1. Removes `subcommand` key/value
|
|
296
|
-
* 2. Removes `undefined` values
|
|
297
|
-
* 3. Removes empty objects (but not `false` values)
|
|
298
|
-
* Does not operate recursively.
|
|
299
|
-
*/
|
|
300
|
-
const compactConfig = lodash_1.default.partial(lodash_1.default.omitBy, lodash_1.default, (value, key) => key === 'subcommand' || lodash_1.default.isUndefined(value) || (lodash_1.default.isObject(value) && lodash_1.default.isEmpty(value)));
|
|
301
240
|
/**
|
|
302
241
|
* Shows a breakdown of the current config after CLI params, config file loaded & defaults applied.
|
|
303
242
|
*
|
|
304
|
-
* The actual shape of `preConfigParsedArgs` and `defaults` does not matter for the purposes of this
|
|
305
|
-
* but it's intended to be called with values of type {@link ParsedArgs} and
|
|
306
|
-
*
|
|
307
|
-
* @param {Partial<ParsedArgs>} nonDefaultPreConfigParsedArgs - Parsed CLI args (or param to `init()`) before config & defaults applied
|
|
308
|
-
* @param {import('./config-file').ReadConfigFileResult} configResult - Result of attempting to load a config file. _Must_ be normalized
|
|
309
|
-
* @param {Partial<ParsedArgs>} defaults - Configuration defaults from schemas
|
|
310
|
-
* @param {ParsedArgs} parsedArgs - Entire parsed args object
|
|
243
|
+
* The actual shape of `preConfigParsedArgs` and `defaults` does not matter for the purposes of this
|
|
244
|
+
* function, but it's intended to be called with values of type {@link ParsedArgs} and
|
|
245
|
+
* `DefaultValues<true>`, respectively.
|
|
311
246
|
*/
|
|
312
247
|
function showConfig(nonDefaultPreConfigParsedArgs, configResult, defaults, parsedArgs) {
|
|
313
248
|
console.log('Appium Configuration\n');
|
|
@@ -332,9 +267,10 @@ function showConfig(nonDefaultPreConfigParsedArgs, configResult, defaults, parse
|
|
|
332
267
|
console.dir(compactConfig(parsedArgs));
|
|
333
268
|
}
|
|
334
269
|
/**
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
270
|
+
* Ensures a directory exists and (optionally) is writeable.
|
|
271
|
+
*
|
|
272
|
+
* If the directory does not exist, this attempts to create it recursively.
|
|
273
|
+
*
|
|
338
274
|
* @throws {Error}
|
|
339
275
|
*/
|
|
340
276
|
async function requireDir(root, requireWriteable = true, displayName = 'folder path') {
|
|
@@ -360,19 +296,56 @@ async function requireDir(root, requireWriteable = true, displayName = 'folder p
|
|
|
360
296
|
await support_1.fs.access(root, support_1.fs.constants.W_OK);
|
|
361
297
|
}
|
|
362
298
|
catch {
|
|
363
|
-
throw new Error(`The ${displayName} '${root}' must be `
|
|
364
|
-
`writeable for the current user account '${node_os_1.default.userInfo().username}'`);
|
|
299
|
+
throw new Error(`The ${displayName} '${root}' must be writeable for the current user account '${node_os_1.default.userInfo().username}'`);
|
|
365
300
|
}
|
|
366
301
|
}
|
|
367
302
|
}
|
|
303
|
+
function getNodeVersion() {
|
|
304
|
+
return semver.coerce(process.version);
|
|
305
|
+
}
|
|
306
|
+
const getFullGitPath = lodash_1.default.memoize(async function getFullGitPath() {
|
|
307
|
+
try {
|
|
308
|
+
return await support_1.fs.which(GIT_BINARY);
|
|
309
|
+
}
|
|
310
|
+
catch {
|
|
311
|
+
return null;
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
async function getGitTimestamp(commitSha, useGithubApiFallback = false) {
|
|
315
|
+
const fullGitPath = await getFullGitPath();
|
|
316
|
+
if (fullGitPath) {
|
|
317
|
+
try {
|
|
318
|
+
const { stdout } = await (0, teen_process_1.exec)(fullGitPath, ['show', '-s', '--format=%ci', commitSha], {
|
|
319
|
+
cwd: __dirname,
|
|
320
|
+
});
|
|
321
|
+
return stdout.trim();
|
|
322
|
+
}
|
|
323
|
+
catch { }
|
|
324
|
+
}
|
|
325
|
+
if (!useGithubApiFallback) {
|
|
326
|
+
return null;
|
|
327
|
+
}
|
|
328
|
+
try {
|
|
329
|
+
return (await axios_1.default.get(`${GITHUB_API}/git/tags/${commitSha}`, {
|
|
330
|
+
headers: {
|
|
331
|
+
'User-Agent': `Appium ${exports.APPIUM_VER}`,
|
|
332
|
+
},
|
|
333
|
+
})).data?.tagger?.date;
|
|
334
|
+
}
|
|
335
|
+
catch { }
|
|
336
|
+
return null;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Compacts an object for {@link showConfig}:
|
|
340
|
+
* 1. Removes `subcommand` key/value
|
|
341
|
+
* 2. Removes `undefined` values
|
|
342
|
+
* 3. Removes empty objects (but not `false` values)
|
|
343
|
+
* Does not operate recursively.
|
|
344
|
+
*/
|
|
345
|
+
const compactConfig = lodash_1.default.partial(lodash_1.default.omitBy, lodash_1.default, (value, key) => key === 'subcommand' || lodash_1.default.isUndefined(value) || (lodash_1.default.isObject(value) && lodash_1.default.isEmpty(value)));
|
|
368
346
|
/**
|
|
369
347
|
* Calculates the result of the given function and return its value
|
|
370
348
|
* or the default one if there was an exception.
|
|
371
|
-
*
|
|
372
|
-
* @template T
|
|
373
|
-
* @param {() => Promise<T>} f
|
|
374
|
-
* @param {T} defaultValue
|
|
375
|
-
* @returns {Promise<T>}
|
|
376
349
|
*/
|
|
377
350
|
async function getSafeResult(f, defaultValue) {
|
|
378
351
|
try {
|
|
@@ -382,9 +355,4 @@ async function getSafeResult(f, defaultValue) {
|
|
|
382
355
|
return defaultValue;
|
|
383
356
|
}
|
|
384
357
|
}
|
|
385
|
-
/**
|
|
386
|
-
* @typedef {import('appium/types').ParsedArgs} ParsedArgs
|
|
387
|
-
* @typedef {import('appium/types').Args} Args
|
|
388
|
-
* @typedef {import('./schema/arg-spec').ArgSpec} ArgSpec
|
|
389
|
-
*/
|
|
390
358
|
//# sourceMappingURL=config.js.map
|
package/build/lib/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../lib/config.
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../lib/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,0CAUC;AAKD,sCAyCC;AAQD,8BA2BC;AAQD,oCAEC;AAKD,kCAKC;AAQD,sCAGC;AAKD,0DA0EC;AASD,gCAwBC;AASD,gCA6BC;AA5SD,+BAA+B;AAC/B,oDAAuB;AACvB,6CAAgD;AAChD,kDAA0B;AAC1B,+CAAkC;AAClC,+CAAiC;AACjC,sDAAyB;AACzB,mCAAmC;AACnC,wDAAyB;AACzB,4CAAqE;AAIxD,QAAA,UAAU,GAAG,kBAAU,CAAC,OAAO,CAAC;AAC7C,MAAM,OAAO,GAAG,kBAAU,CAAC,OAAiC,CAAC;AAC7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,YAAY,CAAC;IACtB,CAAC;AACH,CAAC"}
|
package/build/lib/constants.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The name of the extension type for drivers
|
|
3
3
|
*/
|
|
4
|
-
export const DRIVER_TYPE
|
|
4
|
+
export declare const DRIVER_TYPE = "driver";
|
|
5
5
|
/**
|
|
6
6
|
* The name of the extension type for plugins
|
|
7
7
|
*/
|
|
8
|
-
export const PLUGIN_TYPE
|
|
8
|
+
export declare const PLUGIN_TYPE = "plugin";
|
|
9
9
|
/**
|
|
10
10
|
* The `server` command of the `appium` CLI
|
|
11
11
|
*/
|
|
12
|
-
export const SERVER_SUBCOMMAND
|
|
12
|
+
export declare const SERVER_SUBCOMMAND = "server";
|
|
13
13
|
/**
|
|
14
14
|
* The `setup` command of the `appium` CLI
|
|
15
15
|
*/
|
|
16
|
-
export const SETUP_SUBCOMMAND
|
|
16
|
+
export declare const SETUP_SUBCOMMAND = "setup";
|
|
17
17
|
/**
|
|
18
18
|
* The value of `--use-plugins` if _all_ plugins should be loaded
|
|
19
19
|
*/
|
|
20
|
-
export const USE_ALL_PLUGINS
|
|
21
|
-
export const KNOWN_PLUGINS: Readonly<{
|
|
20
|
+
export declare const USE_ALL_PLUGINS = "all";
|
|
21
|
+
export declare const KNOWN_PLUGINS: Readonly<{
|
|
22
22
|
readonly 'execute-driver': "@appium/execute-driver-plugin";
|
|
23
23
|
readonly images: "@appium/images-plugin";
|
|
24
24
|
readonly inspector: "appium-inspector-plugin";
|
|
@@ -26,21 +26,21 @@ export const KNOWN_PLUGINS: Readonly<{
|
|
|
26
26
|
readonly storage: "@appium/storage-plugin";
|
|
27
27
|
readonly 'universal-xml': "@appium/universal-xml-plugin";
|
|
28
28
|
}>;
|
|
29
|
-
export const MOBILE_DRIVERS: Readonly<{
|
|
29
|
+
export declare const MOBILE_DRIVERS: Readonly<{
|
|
30
30
|
readonly uiautomator2: "appium-uiautomator2-driver";
|
|
31
31
|
readonly xcuitest: "appium-xcuitest-driver";
|
|
32
32
|
readonly espresso: "appium-espresso-driver";
|
|
33
33
|
}>;
|
|
34
|
-
export const DESKTOP_DRIVERS: Readonly<{
|
|
34
|
+
export declare const DESKTOP_DRIVERS: Readonly<{
|
|
35
35
|
readonly mac2: "appium-mac2-driver";
|
|
36
36
|
readonly windows: "appium-windows-driver";
|
|
37
37
|
}>;
|
|
38
|
-
export const DESKTOP_BROWSERS: Readonly<{
|
|
38
|
+
export declare const DESKTOP_BROWSERS: Readonly<{
|
|
39
39
|
readonly safari: "appium-safari-driver";
|
|
40
40
|
readonly gecko: "appium-geckodriver";
|
|
41
41
|
readonly chromium: "appium-chromium-driver";
|
|
42
42
|
}>;
|
|
43
|
-
export const KNOWN_DRIVERS: Readonly<{
|
|
43
|
+
export declare const KNOWN_DRIVERS: Readonly<{
|
|
44
44
|
readonly safari: "appium-safari-driver";
|
|
45
45
|
readonly gecko: "appium-geckodriver";
|
|
46
46
|
readonly chromium: "appium-chromium-driver";
|
|
@@ -53,39 +53,39 @@ export const KNOWN_DRIVERS: Readonly<{
|
|
|
53
53
|
/**
|
|
54
54
|
* Relative path to directory containing any Appium internal files
|
|
55
55
|
*/
|
|
56
|
-
export const CACHE_DIR_RELATIVE_PATH: string;
|
|
56
|
+
export declare const CACHE_DIR_RELATIVE_PATH: string;
|
|
57
57
|
/**
|
|
58
58
|
* Relative path to hashfile (from `APPIUM_HOME`) of consuming project's `package.json` (if it exists)
|
|
59
59
|
*/
|
|
60
|
-
export const PKG_HASHFILE_RELATIVE_PATH: string;
|
|
61
|
-
export const EXT_SUBCOMMAND_LIST
|
|
62
|
-
export const EXT_SUBCOMMAND_INSTALL
|
|
63
|
-
export const EXT_SUBCOMMAND_UNINSTALL
|
|
64
|
-
export const EXT_SUBCOMMAND_UPDATE
|
|
65
|
-
export const EXT_SUBCOMMAND_RUN
|
|
66
|
-
export const EXT_SUBCOMMAND_DOCTOR
|
|
60
|
+
export declare const PKG_HASHFILE_RELATIVE_PATH: string;
|
|
61
|
+
export declare const EXT_SUBCOMMAND_LIST = "list";
|
|
62
|
+
export declare const EXT_SUBCOMMAND_INSTALL = "install";
|
|
63
|
+
export declare const EXT_SUBCOMMAND_UNINSTALL = "uninstall";
|
|
64
|
+
export declare const EXT_SUBCOMMAND_UPDATE = "update";
|
|
65
|
+
export declare const EXT_SUBCOMMAND_RUN = "run";
|
|
66
|
+
export declare const EXT_SUBCOMMAND_DOCTOR = "doctor";
|
|
67
67
|
/**
|
|
68
68
|
* Current revision of the manifest (`extensions.yaml`) schema
|
|
69
69
|
*/
|
|
70
|
-
export const CURRENT_SCHEMA_REV
|
|
70
|
+
export declare const CURRENT_SCHEMA_REV = 4;
|
|
71
71
|
/**
|
|
72
72
|
* The default number of stack frames to show in a "long" stack trace, when enabled via `--long-stacktrace`
|
|
73
73
|
* @remarks This value may be increased in the future.
|
|
74
74
|
* @privateRemarks A value like `Infinity` may provide to have deleterious effects on
|
|
75
75
|
* memory usage, perf, and/or log output, and higher limits may be difficult to scan.
|
|
76
76
|
*/
|
|
77
|
-
export const LONG_STACKTRACE_LIMIT
|
|
77
|
+
export declare const LONG_STACKTRACE_LIMIT = 100;
|
|
78
78
|
/**
|
|
79
79
|
* Where should the bidi websocket handler live on the server?
|
|
80
80
|
*/
|
|
81
|
-
export const BIDI_BASE_PATH
|
|
81
|
+
export declare const BIDI_BASE_PATH = "/bidi";
|
|
82
82
|
/**
|
|
83
83
|
* The name of the event for drivers to emit when they want to send bidi events to a client over
|
|
84
84
|
* a bidi socket
|
|
85
85
|
*/
|
|
86
|
-
export const BIDI_EVENT_NAME
|
|
86
|
+
export declare const BIDI_EVENT_NAME = "bidiEvent";
|
|
87
87
|
/**
|
|
88
88
|
* The name of the insecure feature that allows retrieving the list of active server sessions
|
|
89
89
|
*/
|
|
90
|
-
export const SESSION_DISCOVERY_FEATURE
|
|
90
|
+
export declare const SESSION_DISCOVERY_FEATURE = "session_discovery";
|
|
91
91
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../lib/constants.
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../lib/constants.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,WAAW,WAAW,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,WAAW,WAAW,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,gBAAgB,UAAU,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,eAAe,QAAQ,CAAC;AAMrC,eAAO,MAAM,aAAa;;;;;;;EAOf,CAAC;AAEZ,eAAO,MAAM,cAAc;;;;EAIhB,CAAC;AAEZ,eAAO,MAAM,eAAe;;;EAGjB,CAAC;AAEZ,eAAO,MAAM,gBAAgB;;;;EAIlB,CAAC;AAMZ,eAAO,MAAM,aAAa;;;;;;;;;EAIf,CAAC;AAEZ;;GAEG;AACH,eAAO,MAAM,uBAAuB,QAAgD,CAAC;AAErF;;GAEG;AACH,eAAO,MAAM,0BAA0B,QAAqD,CAAC;AAE7F,eAAO,MAAM,mBAAmB,SAAS,CAAC;AAC1C,eAAO,MAAM,sBAAsB,YAAY,CAAC;AAChD,eAAO,MAAM,wBAAwB,cAAc,CAAC;AACpD,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AACxC,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC;;GAEG;AACH,eAAO,MAAM,cAAc,UAAU,CAAC;AAEtC;;;GAGG;AACH,eAAO,MAAM,eAAe,cAAc,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,yBAAyB,sBAAsB,CAAC"}
|
package/build/lib/constants.js
CHANGED
|
@@ -29,42 +29,37 @@ exports.USE_ALL_PLUGINS = 'all';
|
|
|
29
29
|
// The plugins in this list will be available to the CLI so users can just
|
|
30
30
|
// type 'appium plugin install 'name'', rather than having to specify the full
|
|
31
31
|
// npm package. I.e., these are the officially recognized plugins.
|
|
32
|
-
exports.KNOWN_PLUGINS = Object.freeze(
|
|
33
|
-
/** @type {const} */ ({
|
|
32
|
+
exports.KNOWN_PLUGINS = Object.freeze({
|
|
34
33
|
'execute-driver': '@appium/execute-driver-plugin',
|
|
35
34
|
images: '@appium/images-plugin',
|
|
36
35
|
inspector: 'appium-inspector-plugin',
|
|
37
36
|
'relaxed-caps': '@appium/relaxed-caps-plugin',
|
|
38
37
|
storage: '@appium/storage-plugin',
|
|
39
38
|
'universal-xml': '@appium/universal-xml-plugin',
|
|
40
|
-
})
|
|
41
|
-
exports.MOBILE_DRIVERS = Object.freeze(
|
|
42
|
-
/** @type {const} */ ({
|
|
39
|
+
});
|
|
40
|
+
exports.MOBILE_DRIVERS = Object.freeze({
|
|
43
41
|
uiautomator2: 'appium-uiautomator2-driver',
|
|
44
42
|
xcuitest: 'appium-xcuitest-driver',
|
|
45
43
|
espresso: 'appium-espresso-driver',
|
|
46
|
-
})
|
|
47
|
-
exports.DESKTOP_DRIVERS = Object.freeze(
|
|
48
|
-
/** @type {const} */ ({
|
|
44
|
+
});
|
|
45
|
+
exports.DESKTOP_DRIVERS = Object.freeze({
|
|
49
46
|
mac2: 'appium-mac2-driver',
|
|
50
47
|
windows: 'appium-windows-driver',
|
|
51
|
-
})
|
|
52
|
-
exports.DESKTOP_BROWSERS = Object.freeze(
|
|
53
|
-
/** @type {const} */ ({
|
|
48
|
+
});
|
|
49
|
+
exports.DESKTOP_BROWSERS = Object.freeze({
|
|
54
50
|
safari: 'appium-safari-driver',
|
|
55
51
|
gecko: 'appium-geckodriver',
|
|
56
52
|
chromium: 'appium-chromium-driver',
|
|
57
|
-
})
|
|
53
|
+
});
|
|
58
54
|
// This is a map of driver names to npm packages representing those drivers.
|
|
59
55
|
// The drivers in this list will be available to the CLI so users can just
|
|
60
56
|
// type 'appium driver install 'name'', rather than having to specify the full
|
|
61
57
|
// npm package. I.e., these are the officially recognized drivers.
|
|
62
|
-
exports.KNOWN_DRIVERS = Object.freeze(
|
|
63
|
-
/** @type {const} */ ({
|
|
58
|
+
exports.KNOWN_DRIVERS = Object.freeze({
|
|
64
59
|
...exports.MOBILE_DRIVERS,
|
|
65
60
|
...exports.DESKTOP_DRIVERS,
|
|
66
61
|
...exports.DESKTOP_BROWSERS,
|
|
67
|
-
})
|
|
62
|
+
});
|
|
68
63
|
/**
|
|
69
64
|
* Relative path to directory containing any Appium internal files
|
|
70
65
|
*/
|