appium 2.0.0-beta.4 → 2.0.0-beta.40
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 +10 -11
- package/build/lib/appium.d.ts +204 -0
- package/build/lib/appium.d.ts.map +1 -0
- package/build/lib/appium.js +257 -131
- 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 +96 -282
- 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 +25 -18
- package/build/lib/cli/extension-command.d.ts +372 -0
- package/build/lib/cli/extension-command.d.ts.map +1 -0
- package/build/lib/cli/extension-command.js +286 -156
- package/build/lib/cli/extension.d.ts +18 -0
- package/build/lib/cli/extension.d.ts.map +1 -0
- package/build/lib/cli/extension.js +30 -17
- package/build/lib/cli/parser.d.ts +80 -0
- package/build/lib/cli/parser.d.ts.map +1 -0
- package/build/lib/cli/parser.js +152 -95
- package/build/lib/cli/plugin-command.d.ts +33 -0
- package/build/lib/cli/plugin-command.d.ts.map +1 -0
- package/build/lib/cli/plugin-command.js +24 -19
- 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 +27 -3
- 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 +136 -0
- package/build/lib/config.d.ts +41 -0
- package/build/lib/config.d.ts.map +1 -0
- package/build/lib/config.js +92 -67
- 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 +81 -0
- package/build/lib/extension/driver-config.d.ts.map +1 -0
- package/build/lib/extension/driver-config.js +177 -0
- package/build/lib/extension/extension-config.d.ts +242 -0
- package/build/lib/extension/extension-config.d.ts.map +1 -0
- package/build/lib/extension/extension-config.js +436 -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 +74 -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 +256 -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 +57 -0
- package/build/lib/extension/plugin-config.d.ts.map +1 -0
- package/build/lib/extension/plugin-config.js +78 -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 +21 -25
- package/build/lib/logger.d.ts +3 -0
- package/build/lib/logger.d.ts.map +1 -0
- package/build/lib/logger.js +4 -6
- package/build/lib/logsink.d.ts +4 -0
- package/build/lib/logsink.d.ts.map +1 -0
- package/build/lib/logsink.js +14 -17
- package/build/lib/main.d.ts +55 -0
- package/build/lib/main.d.ts.map +1 -0
- package/build/lib/main.js +189 -90
- 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 +119 -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 +180 -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 +74 -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 +34 -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 +70 -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 +452 -0
- package/build/lib/utils.d.ts +66 -0
- package/build/lib/utils.d.ts.map +1 -0
- package/build/lib/utils.js +35 -139
- package/build/tsconfig.tsbuildinfo +1 -0
- package/build/types/appium-manifest.d.ts +59 -0
- package/build/types/appium-manifest.d.ts.map +1 -0
- package/build/types/cli.d.ts +112 -0
- package/build/types/cli.d.ts.map +1 -0
- package/build/types/extension-manifest.d.ts +55 -0
- package/build/types/extension-manifest.d.ts.map +1 -0
- package/build/types/index.d.ts +16 -0
- package/build/types/index.d.ts.map +1 -0
- package/driver.d.ts +1 -0
- package/driver.js +14 -0
- package/index.js +11 -0
- package/lib/appium.js +517 -186
- package/lib/cli/args.js +269 -422
- package/lib/cli/driver-command.js +58 -23
- package/lib/cli/extension-command.js +612 -260
- package/lib/cli/extension.js +34 -16
- package/lib/cli/parser.js +241 -83
- package/lib/cli/plugin-command.js +48 -20
- package/lib/cli/utils.js +24 -10
- package/lib/config-file.js +219 -0
- package/lib/config.js +210 -91
- package/lib/constants.js +69 -0
- package/lib/extension/driver-config.js +249 -0
- package/lib/extension/extension-config.js +679 -0
- package/lib/extension/index.js +116 -0
- package/lib/extension/manifest.js +475 -0
- package/lib/extension/package-changed.js +64 -0
- package/lib/extension/plugin-config.js +113 -0
- package/lib/grid-register.js +49 -35
- package/lib/logger.js +1 -2
- package/lib/logsink.js +38 -33
- package/lib/main.js +303 -100
- package/lib/schema/arg-spec.js +229 -0
- package/lib/schema/cli-args.js +238 -0
- package/lib/schema/cli-transformers.js +115 -0
- package/lib/schema/index.js +2 -0
- package/lib/schema/keywords.js +136 -0
- package/lib/schema/schema.js +717 -0
- package/lib/utils.js +121 -140
- package/package.json +75 -85
- package/plugin.d.ts +1 -0
- package/plugin.js +13 -0
- package/scripts/autoinstall-extensions.js +177 -0
- package/support.d.ts +1 -0
- package/support.js +13 -0
- package/types/appium-manifest.ts +73 -0
- package/types/cli.ts +146 -0
- package/types/extension-manifest.ts +64 -0
- package/types/index.ts +21 -0
- package/CHANGELOG.md +0 -3515
- package/bin/ios-webkit-debug-proxy-launcher.js +0 -71
- package/build/lib/cli/npm.js +0 -206
- 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 -183
- 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
|
@@ -1,45 +1,80 @@
|
|
|
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
|
+
/**
|
|
9
|
+
* @extends {ExtensionCommand<DriverType>}
|
|
10
|
+
*/
|
|
8
11
|
export default class DriverCommand extends ExtensionCommand {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
/**
|
|
13
|
+
* @param {import('./extension-command').ExtensionCommandOptions<DriverType>} opts
|
|
14
|
+
*/
|
|
15
|
+
constructor({config, json}) {
|
|
16
|
+
super({config, json});
|
|
12
17
|
this.knownExtensions = KNOWN_DRIVERS;
|
|
13
18
|
}
|
|
14
19
|
|
|
15
|
-
async install
|
|
16
|
-
return await super.
|
|
20
|
+
async install({driver, installType, packageName}) {
|
|
21
|
+
return await super._install({
|
|
22
|
+
installSpec: driver,
|
|
23
|
+
installType,
|
|
24
|
+
packageName,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async uninstall({driver}) {
|
|
29
|
+
return await super._uninstall({installSpec: driver});
|
|
17
30
|
}
|
|
18
31
|
|
|
19
|
-
async
|
|
20
|
-
return await super.
|
|
32
|
+
async update({driver, unsafe}) {
|
|
33
|
+
return await super._update({installSpec: driver, unsafe});
|
|
21
34
|
}
|
|
22
35
|
|
|
23
|
-
async
|
|
24
|
-
return await super.
|
|
36
|
+
async run({driver, scriptName}) {
|
|
37
|
+
return await super._run({installSpec: driver, scriptName});
|
|
25
38
|
}
|
|
26
39
|
|
|
27
|
-
getPostInstallText
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
|
|
40
|
+
getPostInstallText({extName, extData}) {
|
|
41
|
+
return (
|
|
42
|
+
`Driver ${extName}@${extData.version} successfully installed\n`.green +
|
|
43
|
+
`- automationName: ${extData.automationName.green}\n` +
|
|
44
|
+
`- platformNames: ${JSON.stringify(extData.platformNames).green}`
|
|
45
|
+
);
|
|
31
46
|
}
|
|
32
47
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Validates fields in `appium` field of `driverMetadata`
|
|
50
|
+
*
|
|
51
|
+
* For any `package.json` fields which a driver requires, validate the type of
|
|
52
|
+
* those fields on the `package.json` data, throwing an error if anything is
|
|
53
|
+
* amiss.
|
|
54
|
+
* @param {import('appium/types').ExtMetadata<DriverType>} driverMetadata
|
|
55
|
+
* @param {string} installSpec
|
|
56
|
+
*/
|
|
57
|
+
validateExtensionFields(driverMetadata, installSpec) {
|
|
58
|
+
const missingFields = REQ_DRIVER_FIELDS.reduce(
|
|
59
|
+
(acc, field) => (driverMetadata[field] ? acc : [...acc, field]),
|
|
60
|
+
[]
|
|
61
|
+
);
|
|
37
62
|
|
|
38
63
|
if (!_.isEmpty(missingFields)) {
|
|
39
|
-
throw new Error(
|
|
40
|
-
|
|
64
|
+
throw new Error(
|
|
65
|
+
`Driver "${installSpec}" did not expose correct fields for compability ` +
|
|
66
|
+
`with Appium. Missing fields: ${JSON.stringify(missingFields)}`
|
|
67
|
+
);
|
|
41
68
|
}
|
|
42
|
-
|
|
43
69
|
}
|
|
44
|
-
|
|
45
70
|
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @typedef DriverCommandOptions
|
|
74
|
+
* @property {import('../extension/extension-config').ExtensionConfig<DriverType>} config
|
|
75
|
+
* @property {boolean} json
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @typedef {import('@appium/types').DriverType} DriverType
|
|
80
|
+
*/
|