appium 2.0.0-beta.25 → 2.0.0-beta.28
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/appium.d.ts +215 -0
- package/build/lib/appium.d.ts.map +1 -0
- package/build/lib/appium.js +94 -101
- package/build/lib/cli/args.d.ts +20 -0
- package/build/lib/cli/args.d.ts.map +1 -0
- package/build/lib/cli/args.js +19 -39
- package/build/lib/cli/driver-command.d.ts +36 -0
- package/build/lib/cli/driver-command.d.ts.map +1 -0
- package/build/lib/cli/driver-command.js +10 -13
- package/build/lib/cli/extension-command.d.ts +345 -0
- package/build/lib/cli/extension-command.d.ts.map +1 -0
- package/build/lib/cli/extension-command.js +117 -94
- package/build/lib/cli/extension.d.ts +14 -0
- package/build/lib/cli/extension.d.ts.map +1 -0
- package/build/lib/cli/extension.js +14 -22
- package/build/lib/cli/parser.d.ts +79 -0
- package/build/lib/cli/parser.d.ts.map +1 -0
- package/build/lib/cli/parser.js +9 -19
- package/build/lib/cli/plugin-command.d.ts +39 -0
- package/build/lib/cli/plugin-command.d.ts.map +1 -0
- package/build/lib/cli/plugin-command.js +9 -14
- 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 +2 -4
- 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 +2 -4
- package/build/lib/config.d.ts +40 -0
- package/build/lib/config.d.ts.map +1 -0
- package/build/lib/config.js +8 -7
- package/build/lib/constants.d.ts +48 -0
- package/build/lib/constants.d.ts.map +1 -0
- package/build/lib/constants.js +60 -0
- package/build/lib/extension/driver-config.d.ts +84 -0
- package/build/lib/extension/driver-config.d.ts.map +1 -0
- package/build/lib/extension/driver-config.js +190 -0
- package/build/lib/extension/extension-config.d.ts +170 -0
- package/build/lib/extension/extension-config.d.ts.map +1 -0
- package/build/lib/extension/extension-config.js +297 -0
- package/build/lib/extension/index.d.ts +39 -0
- package/build/lib/extension/index.d.ts.map +1 -0
- package/build/lib/extension/index.js +77 -0
- package/build/lib/extension/manifest.d.ts +174 -0
- package/build/lib/extension/manifest.d.ts.map +1 -0
- package/build/lib/extension/manifest.js +246 -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 +68 -0
- package/build/lib/extension/plugin-config.d.ts +62 -0
- package/build/lib/extension/plugin-config.d.ts.map +1 -0
- package/build/lib/extension/plugin-config.js +87 -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 +2 -4
- package/build/lib/logger.d.ts +3 -0
- package/build/lib/logger.d.ts.map +1 -0
- package/build/lib/logger.js +2 -4
- package/build/lib/logsink.d.ts +4 -0
- package/build/lib/logsink.d.ts.map +1 -0
- package/build/lib/logsink.js +2 -4
- package/build/lib/main.d.ts +51 -0
- package/build/lib/main.d.ts.map +1 -0
- package/build/lib/main.js +40 -68
- 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 +11 -14
- 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 +2 -4
- 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 +2 -4
- 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 +2 -4
- 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 +2 -4
- 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 +57 -39
- package/build/lib/utils.d.ts +66 -0
- package/build/lib/utils.d.ts.map +1 -0
- package/build/lib/utils.js +6 -35
- package/build/tsconfig.tsbuildinfo +1 -0
- package/lib/appium.js +188 -117
- package/lib/cli/args.js +19 -24
- package/lib/cli/driver-command.js +19 -8
- package/lib/cli/extension-command.js +314 -184
- package/lib/cli/extension.js +18 -16
- package/lib/cli/parser.js +7 -16
- package/lib/cli/plugin-command.js +16 -7
- package/lib/cli/utils.js +1 -1
- package/lib/config-file.js +6 -7
- package/lib/config.js +17 -12
- package/lib/constants.js +78 -0
- package/lib/extension/driver-config.js +249 -0
- package/lib/extension/extension-config.js +458 -0
- package/lib/extension/index.js +102 -0
- package/lib/extension/manifest.js +486 -0
- package/lib/extension/package-changed.js +63 -0
- package/lib/extension/plugin-config.js +113 -0
- package/lib/grid-register.js +4 -4
- package/lib/logsink.js +4 -0
- package/lib/main.js +54 -92
- package/lib/schema/arg-spec.js +11 -7
- package/lib/schema/cli-args.js +1 -1
- package/lib/schema/cli-transformers.js +0 -1
- package/lib/schema/keywords.js +1 -2
- package/lib/schema/schema.js +62 -31
- package/lib/utils.js +48 -45
- package/package.json +30 -24
- package/{postinstall.js → scripts/postinstall.js} +1 -1
- package/types/appium-manifest.d.ts +61 -0
- package/types/cli.d.ts +134 -0
- package/types/extension.d.ts +56 -0
- package/types/external-manifest.d.ts +58 -0
- package/types/index.d.ts +7 -0
- package/bin/ios-webkit-debug-proxy-launcher.js +0 -71
- package/build/check-npm-pack-files.js +0 -23
- package/build/commands-yml/parse.js +0 -319
- package/build/commands-yml/validator.js +0 -130
- package/build/index.js +0 -19
- package/build/lib/appium-config.schema.json +0 -0
- package/build/lib/cli/npm.js +0 -220
- package/build/lib/driver-config.js +0 -100
- package/build/lib/drivers.js +0 -100
- package/build/lib/ext-config-io.js +0 -165
- package/build/lib/extension-config.js +0 -320
- package/build/lib/plugin-config.js +0 -69
- package/build/lib/plugins.js +0 -18
- package/build/lib/schema/appium-config-schema.js +0 -253
- package/build/postinstall.js +0 -90
- package/build/test/cli/cli-e2e-specs.js +0 -221
- package/build/test/cli/cli-helpers.js +0 -86
- package/build/test/cli/cli-specs.js +0 -71
- package/build/test/cli/fixtures/test-driver/package.json +0 -27
- package/build/test/cli/schema-args-specs.js +0 -48
- package/build/test/cli/schema-e2e-specs.js +0 -47
- package/build/test/config-e2e-specs.js +0 -112
- package/build/test/config-file-e2e-specs.js +0 -191
- package/build/test/config-file-specs.js +0 -281
- package/build/test/config-specs.js +0 -258
- package/build/test/driver-e2e-specs.js +0 -435
- package/build/test/driver-specs.js +0 -386
- package/build/test/ext-config-io-specs.js +0 -181
- package/build/test/extension-config-specs.js +0 -365
- package/build/test/fixtures/allow-feat.txt +0 -5
- package/build/test/fixtures/caps.json +0 -3
- package/build/test/fixtures/config/allow-insecure.txt +0 -3
- package/build/test/fixtures/config/appium.config.bad-nodeconfig.json +0 -5
- package/build/test/fixtures/config/appium.config.bad.json +0 -32
- package/build/test/fixtures/config/appium.config.ext-good.json +0 -9
- package/build/test/fixtures/config/appium.config.ext-unknown-props.json +0 -10
- package/build/test/fixtures/config/appium.config.good.js +0 -40
- package/build/test/fixtures/config/appium.config.good.json +0 -33
- package/build/test/fixtures/config/appium.config.good.yaml +0 -30
- package/build/test/fixtures/config/appium.config.invalid.json +0 -31
- package/build/test/fixtures/config/appium.config.security-array.json +0 -5
- package/build/test/fixtures/config/appium.config.security-delimited.json +0 -5
- package/build/test/fixtures/config/appium.config.security-path.json +0 -5
- package/build/test/fixtures/config/driver-fake.config.json +0 -8
- package/build/test/fixtures/config/nodeconfig.json +0 -3
- package/build/test/fixtures/config/plugin-fake.config.json +0 -0
- package/build/test/fixtures/default-args.js +0 -35
- package/build/test/fixtures/deny-feat.txt +0 -5
- package/build/test/fixtures/driver.schema.js +0 -20
- package/build/test/fixtures/extensions.yaml +0 -27
- package/build/test/fixtures/flattened-schema.js +0 -532
- package/build/test/fixtures/plugin.schema.js +0 -20
- package/build/test/fixtures/schema-with-extensions.js +0 -28
- package/build/test/grid-register-specs.js +0 -74
- package/build/test/helpers.js +0 -75
- package/build/test/logger-specs.js +0 -76
- package/build/test/npm-specs.js +0 -20
- package/build/test/parser-specs.js +0 -319
- package/build/test/plugin-e2e-specs.js +0 -316
- package/build/test/schema/arg-spec-specs.js +0 -70
- package/build/test/schema/cli-args-specs.js +0 -408
- package/build/test/schema/schema-specs.js +0 -407
- package/build/test/utils-specs.js +0 -288
- package/lib/cli/npm.js +0 -251
- package/lib/driver-config.js +0 -101
- package/lib/drivers.js +0 -84
- package/lib/ext-config-io.js +0 -287
- package/lib/extension-config.js +0 -366
- package/lib/plugin-config.js +0 -63
- package/lib/plugins.js +0 -13
- package/lib/schema/appium-config-schema.js +0 -287
- package/types/appium-config.d.ts +0 -197
- package/types/types.d.ts +0 -206
package/lib/cli/args.js
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
// @ts-check
|
|
2
1
|
|
|
3
2
|
// @ts-ignore
|
|
4
3
|
import _ from 'lodash';
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import PluginConfig from '../plugin-config';
|
|
4
|
+
import { DRIVER_TYPE, PLUGIN_TYPE, EXT_SUBCOMMAND_INSTALL, EXT_SUBCOMMAND_LIST, EXT_SUBCOMMAND_RUN, EXT_SUBCOMMAND_UNINSTALL, EXT_SUBCOMMAND_UPDATE } from '../constants';
|
|
5
|
+
import { INSTALL_TYPES } from '../extension/extension-config';
|
|
8
6
|
import { toParserArgs } from '../schema/cli-args';
|
|
9
|
-
|
|
10
7
|
const DRIVER_EXAMPLE = 'xcuitest';
|
|
11
8
|
const PLUGIN_EXAMPLE = 'find_by_image';
|
|
12
|
-
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* This is necessary because we pass the array into `argparse`. `argparse` is bad and mutates things. We don't want that.
|
|
12
|
+
* Bad `argparse`! Bad!
|
|
13
|
+
*/
|
|
14
|
+
const INSTALL_TYPES_ARRAY = [...INSTALL_TYPES];
|
|
13
15
|
|
|
14
16
|
/** @type {Set<ExtensionType>} */
|
|
15
17
|
const EXTENSION_TYPES = new Set([DRIVER_TYPE, PLUGIN_TYPE]);
|
|
16
18
|
|
|
17
|
-
const driverConfig = DriverConfig.getInstance(APPIUM_HOME);
|
|
18
|
-
const pluginConfig = PluginConfig.getInstance(APPIUM_HOME);
|
|
19
|
-
|
|
20
19
|
// this set of args works for both drivers and plugins ('extensions')
|
|
21
20
|
/** @type {ArgumentDefinitions} */
|
|
22
21
|
const globalExtensionArgs = new Map([
|
|
@@ -32,18 +31,18 @@ const globalExtensionArgs = new Map([
|
|
|
32
31
|
/**
|
|
33
32
|
* Builds a Record of extension types to a Record of subcommands to their argument definitions
|
|
34
33
|
*/
|
|
35
|
-
const getExtensionArgs = _.
|
|
34
|
+
const getExtensionArgs = _.memoize(function getExtensionArgs () {
|
|
36
35
|
const extensionArgs = {};
|
|
37
36
|
for (const type of EXTENSION_TYPES) {
|
|
38
37
|
extensionArgs[type] = {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
[EXT_SUBCOMMAND_LIST]: makeListArgs(type),
|
|
39
|
+
[EXT_SUBCOMMAND_INSTALL]: makeInstallArgs(type),
|
|
40
|
+
[EXT_SUBCOMMAND_UNINSTALL]: makeUninstallArgs(type),
|
|
41
|
+
[EXT_SUBCOMMAND_UPDATE]: makeUpdateArgs(type),
|
|
42
|
+
[EXT_SUBCOMMAND_RUN]: makeRunArgs(type),
|
|
44
43
|
};
|
|
45
44
|
}
|
|
46
|
-
return /** @type {Record<ExtensionType, Record<
|
|
45
|
+
return /** @type {Record<ExtensionType, Record<import('../../types/cli').CliExtensionSubcommand,ArgumentDefinitions>>} */(extensionArgs);
|
|
47
46
|
});
|
|
48
47
|
|
|
49
48
|
/**
|
|
@@ -87,9 +86,9 @@ function makeInstallArgs (type) {
|
|
|
87
86
|
[['--source'], {
|
|
88
87
|
required: false,
|
|
89
88
|
default: null,
|
|
90
|
-
choices:
|
|
89
|
+
choices: INSTALL_TYPES_ARRAY,
|
|
91
90
|
help: `Where to look for the ${type} if it is not one of Appium's verified ` +
|
|
92
|
-
`${type}s. Possible values: ${
|
|
91
|
+
`${type}s. Possible values: ${INSTALL_TYPES_ARRAY.join(', ')}`,
|
|
93
92
|
dest: 'installType'
|
|
94
93
|
}],
|
|
95
94
|
[['--package'], {
|
|
@@ -227,16 +226,12 @@ const serverArgsDisallowedInConfig = new Map([
|
|
|
227
226
|
|
|
228
227
|
export {
|
|
229
228
|
getServerArgs,
|
|
230
|
-
getExtensionArgs
|
|
231
|
-
USE_ALL_PLUGINS,
|
|
232
|
-
driverConfig,
|
|
233
|
-
pluginConfig,
|
|
234
|
-
APPIUM_HOME
|
|
229
|
+
getExtensionArgs
|
|
235
230
|
};
|
|
236
231
|
|
|
237
232
|
/**
|
|
238
233
|
* Alias
|
|
239
|
-
* @typedef {import('../
|
|
234
|
+
* @typedef {import('../extension/manifest').ExtensionType} ExtensionType
|
|
240
235
|
*/
|
|
241
236
|
|
|
242
237
|
/**
|
|
@@ -1,31 +1,36 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import ExtensionCommand from './extension-command';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import { KNOWN_DRIVERS } from '../constants';
|
|
4
|
+
import '@colors/colors';
|
|
5
5
|
|
|
6
6
|
const REQ_DRIVER_FIELDS = ['driverName', 'automationName', 'platformNames', 'mainClass'];
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @extends {ExtensionCommand<import('../extension/manifest').DriverType>}
|
|
9
|
+
*/
|
|
8
10
|
export default class DriverCommand extends ExtensionCommand {
|
|
9
11
|
|
|
12
|
+
/**
|
|
13
|
+
* @param {DriverCommandOptions} opts
|
|
14
|
+
*/
|
|
10
15
|
constructor ({config, json}) {
|
|
11
|
-
super({config, json
|
|
16
|
+
super({config, json});
|
|
12
17
|
this.knownExtensions = KNOWN_DRIVERS;
|
|
13
18
|
}
|
|
14
19
|
|
|
15
20
|
async install ({driver, installType, packageName}) {
|
|
16
|
-
return await super.
|
|
21
|
+
return await super._install({ext: driver, installType, packageName});
|
|
17
22
|
}
|
|
18
23
|
|
|
19
24
|
async uninstall ({driver}) {
|
|
20
|
-
return await super.
|
|
25
|
+
return await super._uninstall({ext: driver});
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
async update ({driver, unsafe}) {
|
|
24
|
-
return await super.
|
|
29
|
+
return await super._update({ext: driver, unsafe});
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
async run ({driver, scriptName}) {
|
|
28
|
-
return await super.
|
|
33
|
+
return await super._run({ext: driver, scriptName});
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
getPostInstallText ({extName, extData}) {
|
|
@@ -47,3 +52,9 @@ export default class DriverCommand extends ExtensionCommand {
|
|
|
47
52
|
}
|
|
48
53
|
|
|
49
54
|
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @typedef DriverCommandOptions
|
|
58
|
+
* @property {import('../extension/extension-config').ExtensionConfig<import('../extension/manifest').DriverType>} config
|
|
59
|
+
* @property {boolean} json
|
|
60
|
+
*/
|