appium 2.0.0-beta.5 → 2.0.0-beta.52
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/README.md +156 -63
- package/build/lib/appium.d.ts +226 -0
- package/build/lib/appium.d.ts.map +1 -0
- package/build/lib/appium.js +694 -439
- package/build/lib/appium.js.map +1 -0
- package/build/lib/cli/args.d.ts +17 -0
- package/build/lib/cli/args.d.ts.map +1 -0
- package/build/lib/cli/args.js +253 -319
- package/build/lib/cli/args.js.map +1 -0
- package/build/lib/cli/driver-command.d.ts +102 -0
- package/build/lib/cli/driver-command.d.ts.map +1 -0
- package/build/lib/cli/driver-command.js +126 -81
- package/build/lib/cli/driver-command.js.map +1 -0
- package/build/lib/cli/extension-command.d.ts +385 -0
- package/build/lib/cli/extension-command.d.ts.map +1 -0
- package/build/lib/cli/extension-command.js +731 -383
- package/build/lib/cli/extension-command.js.map +1 -0
- package/build/lib/cli/extension.d.ts +23 -0
- package/build/lib/cli/extension.d.ts.map +1 -0
- package/build/lib/cli/extension.js +71 -54
- package/build/lib/cli/extension.js.map +1 -0
- package/build/lib/cli/parser.d.ts +84 -0
- package/build/lib/cli/parser.d.ts.map +1 -0
- package/build/lib/cli/parser.js +240 -128
- package/build/lib/cli/parser.js.map +1 -0
- package/build/lib/cli/plugin-command.d.ts +99 -0
- package/build/lib/cli/plugin-command.d.ts.map +1 -0
- package/build/lib/cli/plugin-command.js +120 -81
- package/build/lib/cli/plugin-command.js.map +1 -0
- package/build/lib/cli/utils.d.ts +29 -0
- package/build/lib/cli/utils.d.ts.map +1 -0
- package/build/lib/cli/utils.js +72 -51
- package/build/lib/cli/utils.js.map +1 -0
- package/build/lib/config-file.d.ts +100 -0
- package/build/lib/config-file.d.ts.map +1 -0
- package/build/lib/config-file.js +207 -0
- package/build/lib/config-file.js.map +1 -0
- package/build/lib/config.d.ts +49 -0
- package/build/lib/config.d.ts.map +1 -0
- package/build/lib/config.js +265 -201
- package/build/lib/config.js.map +1 -0
- package/build/lib/constants.d.ts +49 -0
- package/build/lib/constants.d.ts.map +1 -0
- package/build/lib/constants.js +66 -0
- package/build/lib/constants.js.map +1 -0
- package/build/lib/extension/driver-config.d.ts +82 -0
- package/build/lib/extension/driver-config.d.ts.map +1 -0
- package/build/lib/extension/driver-config.js +212 -0
- package/build/lib/extension/driver-config.js.map +1 -0
- package/build/lib/extension/extension-config.d.ts +249 -0
- package/build/lib/extension/extension-config.d.ts.map +1 -0
- package/build/lib/extension/extension-config.js +581 -0
- package/build/lib/extension/extension-config.js.map +1 -0
- package/build/lib/extension/index.d.ts +48 -0
- package/build/lib/extension/index.d.ts.map +1 -0
- package/build/lib/extension/index.js +105 -0
- package/build/lib/extension/index.js.map +1 -0
- package/build/lib/extension/manifest-migrations.d.ts +27 -0
- package/build/lib/extension/manifest-migrations.d.ts.map +1 -0
- package/build/lib/extension/manifest-migrations.js +118 -0
- package/build/lib/extension/manifest-migrations.js.map +1 -0
- package/build/lib/extension/manifest.d.ts +145 -0
- package/build/lib/extension/manifest.d.ts.map +1 -0
- package/build/lib/extension/manifest.js +521 -0
- package/build/lib/extension/manifest.js.map +1 -0
- package/build/lib/extension/package-changed.d.ts +11 -0
- package/build/lib/extension/package-changed.d.ts.map +1 -0
- package/build/lib/extension/package-changed.js +62 -0
- package/build/lib/extension/package-changed.js.map +1 -0
- package/build/lib/extension/plugin-config.d.ts +56 -0
- package/build/lib/extension/plugin-config.d.ts.map +1 -0
- package/build/lib/extension/plugin-config.js +102 -0
- package/build/lib/extension/plugin-config.js.map +1 -0
- package/build/lib/grid-register.d.ts +10 -0
- package/build/lib/grid-register.d.ts.map +1 -0
- package/build/lib/grid-register.js +122 -144
- package/build/lib/grid-register.js.map +1 -0
- package/build/lib/logger.d.ts +3 -0
- package/build/lib/logger.d.ts.map +1 -0
- package/build/lib/logger.js +5 -17
- package/build/lib/logger.js.map +1 -0
- package/build/lib/logsink.d.ts +4 -0
- package/build/lib/logsink.d.ts.map +1 -0
- package/build/lib/logsink.js +190 -187
- package/build/lib/logsink.js.map +1 -0
- package/build/lib/main.d.ts +62 -0
- package/build/lib/main.d.ts.map +1 -0
- package/build/lib/main.js +348 -228
- package/build/lib/main.js.map +1 -0
- package/build/lib/schema/arg-spec.d.ts +143 -0
- package/build/lib/schema/arg-spec.d.ts.map +1 -0
- package/build/lib/schema/arg-spec.js +164 -0
- package/build/lib/schema/arg-spec.js.map +1 -0
- package/build/lib/schema/cli-args.d.ts +19 -0
- package/build/lib/schema/cli-args.d.ts.map +1 -0
- package/build/lib/schema/cli-args.js +217 -0
- package/build/lib/schema/cli-args.js.map +1 -0
- package/build/lib/schema/cli-transformers.d.ts +5 -0
- package/build/lib/schema/cli-transformers.d.ts.map +1 -0
- package/build/lib/schema/cli-transformers.js +124 -0
- package/build/lib/schema/cli-transformers.js.map +1 -0
- package/build/lib/schema/index.d.ts +3 -0
- package/build/lib/schema/index.d.ts.map +1 -0
- package/build/lib/schema/index.js +19 -0
- package/build/lib/schema/index.js.map +1 -0
- package/build/lib/schema/keywords.d.ts +24 -0
- package/build/lib/schema/keywords.d.ts.map +1 -0
- package/build/lib/schema/keywords.js +128 -0
- package/build/lib/schema/keywords.js.map +1 -0
- package/build/lib/schema/schema.d.ts +259 -0
- package/build/lib/schema/schema.d.ts.map +1 -0
- package/build/lib/schema/schema.js +615 -0
- package/build/lib/schema/schema.js.map +1 -0
- package/build/lib/utils.d.ts +121 -0
- package/build/lib/utils.d.ts.map +1 -0
- package/build/lib/utils.js +351 -273
- package/build/lib/utils.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -0
- package/build/types/cli.d.ts +134 -0
- package/build/types/cli.d.ts.map +1 -0
- package/build/types/cli.js +3 -0
- package/build/types/cli.js.map +1 -0
- package/build/types/index.d.ts +15 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/index.js +19 -0
- package/build/types/index.js.map +1 -0
- package/build/types/manifest/base.d.ts +135 -0
- package/build/types/manifest/base.d.ts.map +1 -0
- package/build/types/manifest/base.js +3 -0
- package/build/types/manifest/base.js.map +1 -0
- package/build/types/manifest/index.d.ts +19 -0
- package/build/types/manifest/index.d.ts.map +1 -0
- package/build/types/manifest/index.js +40 -0
- package/build/types/manifest/index.js.map +1 -0
- package/build/types/manifest/v3.d.ts +139 -0
- package/build/types/manifest/v3.d.ts.map +1 -0
- package/build/types/manifest/v3.js +3 -0
- package/build/types/manifest/v3.js.map +1 -0
- package/driver.d.ts +1 -0
- package/driver.js +14 -0
- package/index.js +11 -0
- package/lib/appium.js +535 -186
- package/lib/cli/args.js +267 -422
- package/lib/cli/driver-command.js +126 -23
- package/lib/cli/extension-command.js +679 -271
- package/lib/cli/extension.js +48 -17
- package/lib/cli/parser.js +263 -83
- package/lib/cli/plugin-command.js +115 -20
- package/lib/cli/utils.js +24 -10
- package/lib/config-file.js +220 -0
- package/lib/config.js +244 -110
- package/lib/constants.js +71 -0
- package/lib/extension/driver-config.js +250 -0
- package/lib/extension/extension-config.js +682 -0
- package/lib/extension/index.js +116 -0
- package/lib/extension/manifest-migrations.js +120 -0
- package/lib/extension/manifest.js +573 -0
- package/lib/extension/package-changed.js +64 -0
- package/lib/extension/plugin-config.js +112 -0
- package/lib/grid-register.js +49 -35
- package/lib/logger.js +1 -2
- package/lib/logsink.js +64 -38
- package/lib/main.js +321 -101
- package/lib/schema/arg-spec.js +229 -0
- package/lib/schema/cli-args.js +238 -0
- package/lib/schema/cli-transformers.js +119 -0
- package/lib/schema/index.js +2 -0
- package/lib/schema/keywords.js +136 -0
- package/lib/schema/schema.js +722 -0
- package/lib/utils.js +291 -167
- package/package.json +83 -84
- package/plugin.d.ts +1 -0
- package/plugin.js +13 -0
- package/scripts/autoinstall-extensions.js +237 -0
- package/support.d.ts +1 -0
- package/support.js +13 -0
- package/tsconfig.json +25 -0
- package/types/cli.ts +189 -0
- package/types/index.ts +20 -0
- package/types/manifest/README.md +30 -0
- package/types/manifest/base.ts +158 -0
- package/types/manifest/index.ts +27 -0
- package/types/manifest/v3.ts +161 -0
- package/CHANGELOG.md +0 -3515
- package/bin/ios-webkit-debug-proxy-launcher.js +0 -71
- package/build/lib/cli/npm.js +0 -208
- package/build/lib/cli/parser-helpers.js +0 -82
- package/build/lib/driver-config.js +0 -77
- package/build/lib/drivers.js +0 -96
- package/build/lib/extension-config.js +0 -253
- package/build/lib/plugin-config.js +0 -59
- package/build/lib/plugins.js +0 -14
- package/lib/cli/npm.js +0 -184
- package/lib/cli/parser-helpers.js +0 -79
- package/lib/driver-config.js +0 -46
- package/lib/drivers.js +0 -81
- package/lib/extension-config.js +0 -209
- package/lib/plugin-config.js +0 -34
- package/lib/plugins.js +0 -10
package/lib/constants.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The name of the extension type for drivers
|
|
5
|
+
*/
|
|
6
|
+
export const DRIVER_TYPE = 'driver';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The name of the extension type for plugins
|
|
10
|
+
*/
|
|
11
|
+
export const PLUGIN_TYPE = 'plugin';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The `server` command of the `appium` CLI
|
|
15
|
+
*/
|
|
16
|
+
export const SERVER_SUBCOMMAND = 'server';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The value of `--use-plugins` if _all_ plugins should be loaded
|
|
20
|
+
*/
|
|
21
|
+
export const USE_ALL_PLUGINS = 'all';
|
|
22
|
+
|
|
23
|
+
// This is a map of plugin names to npm packages representing those plugins.
|
|
24
|
+
// The plugins in this list will be available to the CLI so users can just
|
|
25
|
+
// type 'appium plugin install 'name'', rather than having to specify the full
|
|
26
|
+
// npm package. I.e., these are the officially recognized plugins.
|
|
27
|
+
export const KNOWN_PLUGINS = Object.freeze(
|
|
28
|
+
/** @type {const} */ ({
|
|
29
|
+
images: '@appium/images-plugin',
|
|
30
|
+
'execute-driver': '@appium/execute-driver-plugin',
|
|
31
|
+
'relaxed-caps': '@appium/relaxed-caps-plugin',
|
|
32
|
+
'universal-xml': '@appium/universal-xml-plugin',
|
|
33
|
+
})
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
// This is a map of driver names to npm packages representing those drivers.
|
|
37
|
+
// The drivers in this list will be available to the CLI so users can just
|
|
38
|
+
// type 'appium driver install 'name'', rather than having to specify the full
|
|
39
|
+
// npm package. I.e., these are the officially recognized drivers.
|
|
40
|
+
export const KNOWN_DRIVERS = Object.freeze(
|
|
41
|
+
/** @type {const} */ ({
|
|
42
|
+
uiautomator2: 'appium-uiautomator2-driver',
|
|
43
|
+
xcuitest: 'appium-xcuitest-driver',
|
|
44
|
+
mac2: 'appium-mac2-driver',
|
|
45
|
+
espresso: 'appium-espresso-driver',
|
|
46
|
+
safari: 'appium-safari-driver',
|
|
47
|
+
gecko: 'appium-geckodriver',
|
|
48
|
+
chromium: 'appium-chromium-driver',
|
|
49
|
+
})
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Relative path to directory containing any Appium internal files
|
|
54
|
+
*/
|
|
55
|
+
export const CACHE_DIR_RELATIVE_PATH = path.join('node_modules', '.cache', 'appium');
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Relative path to hashfile (from `APPIUM_HOME`) of consuming project's `package.json` (if it exists)
|
|
59
|
+
*/
|
|
60
|
+
export const PKG_HASHFILE_RELATIVE_PATH = path.join(CACHE_DIR_RELATIVE_PATH, 'package.hash');
|
|
61
|
+
|
|
62
|
+
export const EXT_SUBCOMMAND_LIST = 'list';
|
|
63
|
+
export const EXT_SUBCOMMAND_INSTALL = 'install';
|
|
64
|
+
export const EXT_SUBCOMMAND_UNINSTALL = 'uninstall';
|
|
65
|
+
export const EXT_SUBCOMMAND_UPDATE = 'update';
|
|
66
|
+
export const EXT_SUBCOMMAND_RUN = 'run';
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Current revision of the manifest (`extensions.yaml`) schema
|
|
70
|
+
*/
|
|
71
|
+
export const CURRENT_SCHEMA_REV = 3;
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import _ from 'lodash';
|
|
2
|
+
import {DRIVER_TYPE} from '../constants';
|
|
3
|
+
import log from '../logger';
|
|
4
|
+
import {ExtensionConfig} from './extension-config';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @extends {ExtensionConfig<DriverType>}
|
|
8
|
+
*/
|
|
9
|
+
export class DriverConfig extends ExtensionConfig {
|
|
10
|
+
/**
|
|
11
|
+
* A set of unique automation names used by drivers.
|
|
12
|
+
* @type {Set<string>}
|
|
13
|
+
*/
|
|
14
|
+
knownAutomationNames;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A mapping of {@link Manifest} instances to {@link DriverConfig} instances.
|
|
18
|
+
*
|
|
19
|
+
* `Manifest` and `ExtensionConfig` have a one-to-many relationship; each `Manifest` should be associated with a `DriverConfig` and a `PluginConfig`; no more, no less.
|
|
20
|
+
*
|
|
21
|
+
* This variable tracks the `Manifest`-to-`DriverConfig` portion.
|
|
22
|
+
*
|
|
23
|
+
* @type {WeakMap<Manifest,DriverConfig>}
|
|
24
|
+
* @private
|
|
25
|
+
*/
|
|
26
|
+
static _instances = new WeakMap();
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Call {@link DriverConfig.create} instead.
|
|
30
|
+
* @private
|
|
31
|
+
* @param {import('./manifest').Manifest} manifest - Manifest instance
|
|
32
|
+
*/
|
|
33
|
+
constructor(manifest) {
|
|
34
|
+
super(DRIVER_TYPE, manifest);
|
|
35
|
+
|
|
36
|
+
this.knownAutomationNames = new Set();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Creates a new {@link DriverConfig} instance for a {@link Manifest} instance.
|
|
41
|
+
*
|
|
42
|
+
* @param {Manifest} manifest
|
|
43
|
+
* @throws If `manifest` already associated with a `DriverConfig`
|
|
44
|
+
* @returns {DriverConfig}
|
|
45
|
+
*/
|
|
46
|
+
static create(manifest) {
|
|
47
|
+
const instance = new DriverConfig(manifest);
|
|
48
|
+
if (DriverConfig.getInstance(manifest)) {
|
|
49
|
+
throw new Error(
|
|
50
|
+
`Manifest with APPIUM_HOME ${manifest.appiumHome} already has a DriverConfig; use DriverConfig.getInstance() to retrieve it.`
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
DriverConfig._instances.set(manifest, instance);
|
|
54
|
+
return instance;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Returns a DriverConfig associated with a Manifest
|
|
59
|
+
* @param {Manifest} manifest
|
|
60
|
+
* @returns {DriverConfig|undefined}
|
|
61
|
+
*/
|
|
62
|
+
static getInstance(manifest) {
|
|
63
|
+
return DriverConfig._instances.get(manifest);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Checks extensions for problems
|
|
68
|
+
*/
|
|
69
|
+
async validate() {
|
|
70
|
+
this.knownAutomationNames.clear();
|
|
71
|
+
return await super._validate(this.manifest.getExtensionData(DRIVER_TYPE));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @param {ExtManifest<DriverType>} extData
|
|
76
|
+
* @returns {import('./extension-config').ExtManifestProblem[]}
|
|
77
|
+
*/
|
|
78
|
+
getConfigProblems(extData) {
|
|
79
|
+
const problems = [];
|
|
80
|
+
const {platformNames, automationName} = extData;
|
|
81
|
+
|
|
82
|
+
if (!_.isArray(platformNames)) {
|
|
83
|
+
problems.push({
|
|
84
|
+
err: 'Missing or incorrect supported platformNames list.',
|
|
85
|
+
val: platformNames,
|
|
86
|
+
});
|
|
87
|
+
} else {
|
|
88
|
+
if (_.isEmpty(platformNames)) {
|
|
89
|
+
problems.push({
|
|
90
|
+
err: 'Empty platformNames list.',
|
|
91
|
+
val: platformNames,
|
|
92
|
+
});
|
|
93
|
+
} else {
|
|
94
|
+
for (const pName of platformNames) {
|
|
95
|
+
if (!_.isString(pName)) {
|
|
96
|
+
problems.push({
|
|
97
|
+
err: 'Incorrectly formatted platformName.',
|
|
98
|
+
val: pName,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (!_.isString(automationName)) {
|
|
106
|
+
problems.push({
|
|
107
|
+
err: 'Missing or incorrect automationName',
|
|
108
|
+
val: automationName,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (this.knownAutomationNames.has(automationName)) {
|
|
113
|
+
problems.push({
|
|
114
|
+
err: 'Multiple drivers claim support for the same automationName',
|
|
115
|
+
val: automationName,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// should we retain the name at the end of this function, once we've checked there are no problems?
|
|
120
|
+
this.knownAutomationNames.add(automationName);
|
|
121
|
+
|
|
122
|
+
return problems;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @param {ExtName<DriverType>} driverName
|
|
127
|
+
* @param {ExtManifest<DriverType>} extData
|
|
128
|
+
* @returns {string}
|
|
129
|
+
*/
|
|
130
|
+
extensionDesc(driverName, {version, automationName}) {
|
|
131
|
+
return `${driverName}@${version} (automationName '${automationName}')`;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Given capabilities, find a matching driver within the config. Load its class and return it along with version and driver name.
|
|
136
|
+
* @template {import('@appium/types').StringRecord} C
|
|
137
|
+
* @param {C} caps
|
|
138
|
+
* @returns {MatchedDriver}
|
|
139
|
+
*/
|
|
140
|
+
findMatchingDriver({automationName, platformName}) {
|
|
141
|
+
if (!_.isString(platformName)) {
|
|
142
|
+
throw new Error('You must include a platformName capability');
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (!_.isString(automationName)) {
|
|
146
|
+
throw new Error('You must include an automationName capability');
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
log.info(
|
|
150
|
+
`Attempting to find matching driver for automationName ` +
|
|
151
|
+
`'${automationName}' and platformName '${platformName}'`
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
try {
|
|
155
|
+
const {driverName, mainClass, version} = this._getDriverBySupport(
|
|
156
|
+
automationName,
|
|
157
|
+
platformName
|
|
158
|
+
);
|
|
159
|
+
log.info(`The '${driverName}' driver was installed and matched caps.`);
|
|
160
|
+
log.info(`Will require it at ${this.getInstallPath(driverName)}`);
|
|
161
|
+
const driver = this.require(driverName);
|
|
162
|
+
if (!driver) {
|
|
163
|
+
throw new Error(
|
|
164
|
+
`Driver '${driverName}' did not export a class with name '${mainClass}'. Contact the author of the driver!`
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
return {driver, version, driverName};
|
|
168
|
+
} catch (err) {
|
|
169
|
+
const msg =
|
|
170
|
+
`Could not find a driver for automationName ` +
|
|
171
|
+
`'${automationName}' and platformName ${platformName}'. ` +
|
|
172
|
+
`Have you installed a driver that supports those ` +
|
|
173
|
+
`capabilities? Run 'appium driver list --installed' to see. ` +
|
|
174
|
+
`(Lower-level error: ${err.message})`;
|
|
175
|
+
throw new Error(msg);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Given an automation name and platform name, find a suitable driver and return its extension data.
|
|
181
|
+
* @param {string} matchAutomationName
|
|
182
|
+
* @param {string} matchPlatformName
|
|
183
|
+
* @returns {ExtMetadata<DriverType> & import('appium/types').InternalMetadata & import('appium/types').CommonExtMetadata}
|
|
184
|
+
*/
|
|
185
|
+
_getDriverBySupport(matchAutomationName, matchPlatformName) {
|
|
186
|
+
const drivers = this.installedExtensions;
|
|
187
|
+
for (const [driverName, driverData] of _.toPairs(drivers)) {
|
|
188
|
+
const {automationName, platformNames} = driverData;
|
|
189
|
+
const aNameMatches = automationName.toLowerCase() === matchAutomationName.toLowerCase();
|
|
190
|
+
const pNameMatches = _.includes(
|
|
191
|
+
platformNames.map(_.toLower),
|
|
192
|
+
matchPlatformName.toLowerCase()
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
if (aNameMatches && pNameMatches) {
|
|
196
|
+
return {driverName, ...driverData};
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (aNameMatches) {
|
|
200
|
+
throw new Error(
|
|
201
|
+
`Driver '${driverName}' supports automationName ` +
|
|
202
|
+
`'${automationName}', but Appium could not find ` +
|
|
203
|
+
`support for platformName '${matchPlatformName}'. Supported ` +
|
|
204
|
+
`platformNames are: ` +
|
|
205
|
+
JSON.stringify(platformNames)
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
throw new Error(`Could not find installed driver to support given caps`);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* @template T
|
|
216
|
+
* @typedef {import('appium/types').ExtMetadata<T>} ExtMetadata
|
|
217
|
+
*/
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* @template T
|
|
221
|
+
* @typedef {import('appium/types').ExtManifest<T>} ExtManifest
|
|
222
|
+
*/
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* @typedef {import('appium/types').ManifestData} ManifestData
|
|
226
|
+
* @typedef {import('@appium/types').DriverType} DriverType
|
|
227
|
+
* @typedef {import('./manifest').Manifest} Manifest
|
|
228
|
+
*/
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* @template T
|
|
232
|
+
* @typedef {import('appium/types').ExtRecord<T>} ExtRecord
|
|
233
|
+
*/
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* @template T
|
|
237
|
+
* @typedef {import('appium/types').ExtName<T>} ExtName
|
|
238
|
+
*/
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Return value of {@linkcode DriverConfig.findMatchingDriver}
|
|
242
|
+
* @typedef MatchedDriver
|
|
243
|
+
* @property {import('@appium/types').DriverClass} driver
|
|
244
|
+
* @property {string} version
|
|
245
|
+
* @property {string} driverName
|
|
246
|
+
*/
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* @typedef {import('@appium/types').Capabilities} Capabilities
|
|
250
|
+
*/
|