appium 2.0.0-beta.7 → 2.0.0-beta.70
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/LICENSE +1 -1
- package/README.md +149 -58
- package/build/lib/appium.d.ts +229 -0
- package/build/lib/appium.d.ts.map +1 -0
- package/build/lib/appium.js +678 -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 +263 -300
- 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 +131 -81
- package/build/lib/cli/driver-command.js.map +1 -0
- package/build/lib/cli/extension-command.d.ts +402 -0
- package/build/lib/cli/extension-command.d.ts.map +1 -0
- package/build/lib/cli/extension-command.js +799 -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 -60
- 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 +252 -148
- 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 +125 -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 +262 -223
- package/build/lib/config.js.map +1 -0
- package/build/lib/constants.d.ts +56 -0
- package/build/lib/constants.d.ts.map +1 -0
- package/build/lib/constants.js +73 -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 +210 -0
- package/build/lib/extension/driver-config.js.map +1 -0
- package/build/lib/extension/extension-config.d.ts +270 -0
- package/build/lib/extension/extension-config.d.ts.map +1 -0
- package/build/lib/extension/extension-config.js +601 -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 +134 -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 +528 -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 +189 -184
- 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 +388 -234
- 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 +220 -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 +260 -0
- package/build/lib/schema/schema.d.ts.map +1 -0
- package/build/lib/schema/schema.js +640 -0
- package/build/lib/schema/schema.js.map +1 -0
- package/build/lib/utils.d.ts +266 -0
- package/build/lib/utils.d.ts.map +1 -0
- package/build/lib/utils.js +349 -273
- package/build/lib/utils.js.map +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 +21 -0
- package/build/types/manifest/index.d.ts.map +1 -0
- package/build/types/manifest/index.js +42 -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/build/types/manifest/v4.d.ts +139 -0
- package/build/types/manifest/v4.d.ts.map +1 -0
- package/build/types/manifest/v4.js +3 -0
- package/build/types/manifest/v4.js.map +1 -0
- package/driver.d.ts +1 -0
- package/driver.js +14 -0
- package/index.js +11 -0
- package/lib/appium.js +558 -186
- package/lib/cli/args.js +275 -407
- package/lib/cli/driver-command.js +132 -24
- package/lib/cli/extension-command.js +751 -272
- package/lib/cli/extension.js +47 -20
- package/lib/cli/parser.js +267 -95
- package/lib/cli/plugin-command.js +122 -22
- package/lib/cli/utils.js +24 -10
- package/lib/config-file.js +220 -0
- package/lib/config.js +243 -132
- package/lib/constants.js +79 -0
- package/lib/extension/driver-config.js +247 -0
- package/lib/extension/extension-config.js +709 -0
- package/lib/extension/index.js +116 -0
- package/lib/extension/manifest-migrations.js +136 -0
- package/lib/extension/manifest.js +580 -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 +59 -36
- package/lib/main.js +369 -104
- package/lib/schema/arg-spec.js +229 -0
- package/lib/schema/cli-args.js +241 -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 +725 -0
- package/lib/utils.js +289 -167
- package/package.json +84 -83
- package/plugin.d.ts +1 -0
- package/plugin.js +13 -0
- package/scripts/autoinstall-extensions.js +243 -0
- package/support.d.ts +1 -0
- package/support.js +13 -0
- package/tsconfig.json +25 -0
- package/types/cli.ts +193 -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 +28 -0
- package/types/manifest/v3.ts +161 -0
- package/types/manifest/v4.ts +161 -0
- package/CHANGELOG.md +0 -3594
- package/bin/ios-webkit-debug-proxy-launcher.js +0 -71
- package/build/lib/cli/argparse-actions.js +0 -104
- package/build/lib/cli/npm.js +0 -200
- package/build/lib/cli/parser-helpers.js +0 -93
- package/build/lib/driver-config.js +0 -77
- package/build/lib/drivers.js +0 -99
- 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/argparse-actions.js +0 -77
- package/lib/cli/npm.js +0 -175
- package/lib/cli/parser-helpers.js +0 -91
- package/lib/driver-config.js +0 -46
- package/lib/drivers.js +0 -84
- package/lib/extension-config.js +0 -209
- package/lib/plugin-config.js +0 -34
- package/lib/plugins.js +0 -10
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @extends {ExtensionCliCommand<DriverType>}
|
|
3
|
+
*/
|
|
4
|
+
export default class DriverCliCommand extends ExtensionCliCommand<"driver"> {
|
|
5
|
+
/**
|
|
6
|
+
* @param {import('./extension-command').ExtensionCommandOptions<DriverType>} opts
|
|
7
|
+
*/
|
|
8
|
+
constructor({ config, json }: import('./extension-command').ExtensionCommandOptions<DriverType>);
|
|
9
|
+
/**
|
|
10
|
+
* Install a driver
|
|
11
|
+
*
|
|
12
|
+
* @param {DriverInstallOpts} opts
|
|
13
|
+
* @return {Promise<ExtRecord<DriverType>>}
|
|
14
|
+
*/
|
|
15
|
+
install({ driver, installType, packageName }: DriverInstallOpts): Promise<ExtRecord<DriverType>>;
|
|
16
|
+
/**
|
|
17
|
+
* Uninstall a driver
|
|
18
|
+
*
|
|
19
|
+
* @param {DriverUninstallOpts} opts
|
|
20
|
+
* @return {Promise<ExtRecord<DriverType>>}
|
|
21
|
+
*/
|
|
22
|
+
uninstall({ driver }: DriverUninstallOpts): Promise<ExtRecord<DriverType>>;
|
|
23
|
+
/**
|
|
24
|
+
* Update a driver
|
|
25
|
+
*
|
|
26
|
+
* @param {DriverUpdateOpts} opts
|
|
27
|
+
* @return {Promise<import('./extension-command').ExtensionUpdateResult>}
|
|
28
|
+
*/
|
|
29
|
+
update({ driver, unsafe }: DriverUpdateOpts): Promise<import('./extension-command').ExtensionUpdateResult>;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @param {DriverRunOptions} opts
|
|
33
|
+
* @return {Promise<import('./extension-command').RunOutput>}
|
|
34
|
+
*/
|
|
35
|
+
run({ driver, scriptName, extraArgs }: DriverRunOptions): Promise<import('./extension-command').RunOutput>;
|
|
36
|
+
}
|
|
37
|
+
export type ExtensionType = import('@appium/types').ExtensionType;
|
|
38
|
+
export type DriverType = import('@appium/types').DriverType;
|
|
39
|
+
export type ExtRecord<ExtType extends import("@appium/types").ExtensionType> = import('appium/types').ExtRecord<ExtType>;
|
|
40
|
+
export type DriverCommandOptions = {
|
|
41
|
+
config: import('../extension/extension-config').ExtensionConfig<DriverType>;
|
|
42
|
+
json: boolean;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Options for {@linkcode DriverCliCommand.install }
|
|
46
|
+
*/
|
|
47
|
+
export type DriverInstallOpts = {
|
|
48
|
+
/**
|
|
49
|
+
* - the name or spec of a driver to install
|
|
50
|
+
*/
|
|
51
|
+
driver: string;
|
|
52
|
+
/**
|
|
53
|
+
* - how to install this driver. One of the INSTALL_TYPES
|
|
54
|
+
*/
|
|
55
|
+
installType: InstallType;
|
|
56
|
+
/**
|
|
57
|
+
* - for git/github installs, the driver node package name
|
|
58
|
+
*/
|
|
59
|
+
packageName?: string | undefined;
|
|
60
|
+
};
|
|
61
|
+
export type InstallType = import('appium/types').InstallType;
|
|
62
|
+
/**
|
|
63
|
+
* Options for {@linkcode DriverCliCommand.uninstall }
|
|
64
|
+
*/
|
|
65
|
+
export type DriverUninstallOpts = {
|
|
66
|
+
/**
|
|
67
|
+
* - the name or spec of a driver to uninstall
|
|
68
|
+
*/
|
|
69
|
+
driver: string;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Options for {@linkcode DriverCliCommand.update }
|
|
73
|
+
*/
|
|
74
|
+
export type DriverUpdateOpts = {
|
|
75
|
+
/**
|
|
76
|
+
* - the name of the driver to update
|
|
77
|
+
*/
|
|
78
|
+
driver: string;
|
|
79
|
+
/**
|
|
80
|
+
* - if true, will perform unsafe updates past major revision boundaries
|
|
81
|
+
*/
|
|
82
|
+
unsafe: boolean;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Options for {@linkcode DriverCliCommand.run }.
|
|
86
|
+
*/
|
|
87
|
+
export type DriverRunOptions = {
|
|
88
|
+
/**
|
|
89
|
+
* - name of the driver to run a script from
|
|
90
|
+
*/
|
|
91
|
+
driver: string;
|
|
92
|
+
/**
|
|
93
|
+
* - name of the script to run
|
|
94
|
+
*/
|
|
95
|
+
scriptName: string;
|
|
96
|
+
/**
|
|
97
|
+
* - arguments to pass to the script
|
|
98
|
+
*/
|
|
99
|
+
extraArgs?: string[] | undefined;
|
|
100
|
+
};
|
|
101
|
+
import ExtensionCliCommand from "./extension-command";
|
|
102
|
+
//# sourceMappingURL=driver-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"driver-command.d.ts","sourceRoot":"","sources":["../../../lib/cli/driver-command.js"],"names":[],"mappings":"AAOA;;GAEG;AAEH;IACE;;OAEG;IACH,8BAFW,OAAO,qBAAqB,EAAE,uBAAuB,CAAC,UAAU,CAAC,EAK3E;IAED;;;;;OAKG;IACH,8CAHW,iBAAiB,GAChB,QAAQ,UAAU,UAAU,CAAC,CAAC,CAQzC;IAED;;;;;OAKG;IACH,sBAHW,mBAAmB,GAClB,QAAQ,UAAU,UAAU,CAAC,CAAC,CAIzC;IAED;;;;;OAKG;IACH,2BAHW,gBAAgB,GACf,QAAQ,OAAO,qBAAqB,EAAE,qBAAqB,CAAC,CAIvE;IAED;;;;OAIG;IACH,uCAHW,gBAAgB,GACf,QAAQ,OAAO,qBAAqB,EAAE,SAAS,CAAC,CAS3D;CAqCF;4BAGY,OAAO,eAAe,EAAE,aAAa;yBACrC,OAAO,eAAe,EAAE,UAAU;+EAKlC,OAAO,cAAc,EAAE,SAAS,CAAC,OAAO,CAAC;;YAKxC,OAAO,+BAA+B,EAAE,eAAe,CAAC,UAAU,CAAC;UACnE,OAAO;;;;;;;;;YAMP,MAAM;;;;iBACN,WAAW;;;;;;0BAKZ,OAAO,cAAc,EAAE,WAAW;;;;;;;;YAMjC,MAAM;;;;;;;;;YAMN,MAAM;;;;YACN,OAAO;;;;;;;;;YAMP,MAAM;;;;gBACN,MAAM"}
|
|
@@ -1,85 +1,135 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
require("source-map-support/register");
|
|
11
|
-
|
|
12
|
-
var _lodash = _interopRequireDefault(require("lodash"));
|
|
13
|
-
|
|
14
|
-
var _extensionCommand = _interopRequireDefault(require("./extension-command"));
|
|
15
|
-
|
|
16
|
-
var _extensionConfig = require("../extension-config");
|
|
17
|
-
|
|
18
|
-
var _drivers = require("../drivers");
|
|
19
|
-
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
7
|
+
const extension_command_1 = __importDefault(require("./extension-command"));
|
|
8
|
+
const constants_1 = require("../constants");
|
|
9
|
+
require("@colors/colors");
|
|
20
10
|
const REQ_DRIVER_FIELDS = ['driverName', 'automationName', 'platformNames', 'mainClass'];
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
packageName
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @extends {ExtensionCliCommand<DriverType>}
|
|
13
|
+
*/
|
|
14
|
+
class DriverCliCommand extends extension_command_1.default {
|
|
15
|
+
/**
|
|
16
|
+
* @param {import('./extension-command').ExtensionCommandOptions<DriverType>} opts
|
|
17
|
+
*/
|
|
18
|
+
constructor({ config, json }) {
|
|
19
|
+
super({ config, json });
|
|
20
|
+
this.knownExtensions = constants_1.KNOWN_DRIVERS;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Install a driver
|
|
24
|
+
*
|
|
25
|
+
* @param {DriverInstallOpts} opts
|
|
26
|
+
* @return {Promise<ExtRecord<DriverType>>}
|
|
27
|
+
*/
|
|
28
|
+
async install({ driver, installType, packageName }) {
|
|
29
|
+
return await super._install({
|
|
30
|
+
installSpec: driver,
|
|
31
|
+
installType,
|
|
32
|
+
packageName,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Uninstall a driver
|
|
37
|
+
*
|
|
38
|
+
* @param {DriverUninstallOpts} opts
|
|
39
|
+
* @return {Promise<ExtRecord<DriverType>>}
|
|
40
|
+
*/
|
|
41
|
+
async uninstall({ driver }) {
|
|
42
|
+
return await super._uninstall({ installSpec: driver });
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Update a driver
|
|
46
|
+
*
|
|
47
|
+
* @param {DriverUpdateOpts} opts
|
|
48
|
+
* @return {Promise<import('./extension-command').ExtensionUpdateResult>}
|
|
49
|
+
*/
|
|
50
|
+
async update({ driver, unsafe }) {
|
|
51
|
+
return await super._update({ installSpec: driver, unsafe });
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @param {DriverRunOptions} opts
|
|
56
|
+
* @return {Promise<import('./extension-command').RunOutput>}
|
|
57
|
+
*/
|
|
58
|
+
async run({ driver, scriptName, extraArgs }) {
|
|
59
|
+
return await super._run({
|
|
60
|
+
installSpec: driver,
|
|
61
|
+
scriptName,
|
|
62
|
+
extraArgs,
|
|
63
|
+
bufferOutput: this.isJsonOutput,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
*
|
|
68
|
+
* @param {import('./extension-command').ExtensionArgs} opts
|
|
69
|
+
* @returns {string}
|
|
70
|
+
*/
|
|
71
|
+
getPostInstallText({ extName, extData }) {
|
|
72
|
+
return (`Driver ${extName}@${extData.version} successfully installed\n`.green +
|
|
73
|
+
`- automationName: ${extData.automationName.green}\n` +
|
|
74
|
+
`- platformNames: ${JSON.stringify(extData.platformNames).green}`);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Validates fields in `appium` field of `driverMetadata`
|
|
78
|
+
*
|
|
79
|
+
* For any `package.json` fields which a driver requires, validate the type of
|
|
80
|
+
* those fields on the `package.json` data, throwing an error if anything is
|
|
81
|
+
* amiss.
|
|
82
|
+
* @param {import('appium/types').ExtMetadata<DriverType>} driverMetadata
|
|
83
|
+
* @param {string} installSpec
|
|
84
|
+
*/
|
|
85
|
+
validateExtensionFields(driverMetadata, installSpec) {
|
|
86
|
+
const missingFields = REQ_DRIVER_FIELDS.reduce((acc, field) => (driverMetadata[field] ? acc : [...acc, field]), []);
|
|
87
|
+
if (!lodash_1.default.isEmpty(missingFields)) {
|
|
88
|
+
throw new Error(`Driver "${installSpec}" did not expose correct fields for compability ` +
|
|
89
|
+
`with Appium. Missing fields: ${JSON.stringify(missingFields)}`);
|
|
90
|
+
}
|
|
77
91
|
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
92
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
93
|
+
exports.default = DriverCliCommand;
|
|
94
|
+
/**
|
|
95
|
+
* @typedef {import('@appium/types').ExtensionType} ExtensionType
|
|
96
|
+
* @typedef {import('@appium/types').DriverType} DriverType
|
|
97
|
+
*/
|
|
98
|
+
/**
|
|
99
|
+
* @template {ExtensionType} ExtType
|
|
100
|
+
* @typedef {import('appium/types').ExtRecord<ExtType>} ExtRecord
|
|
101
|
+
*/
|
|
102
|
+
/**
|
|
103
|
+
* @typedef DriverCommandOptions
|
|
104
|
+
* @property {import('../extension/extension-config').ExtensionConfig<DriverType>} config
|
|
105
|
+
* @property {boolean} json
|
|
106
|
+
*/
|
|
107
|
+
/**
|
|
108
|
+
* Options for {@linkcode DriverCliCommand.install}
|
|
109
|
+
* @typedef DriverInstallOpts
|
|
110
|
+
* @property {string} driver - the name or spec of a driver to install
|
|
111
|
+
* @property {InstallType} installType - how to install this driver. One of the INSTALL_TYPES
|
|
112
|
+
* @property {string} [packageName] - for git/github installs, the driver node package name
|
|
113
|
+
*/
|
|
114
|
+
/**
|
|
115
|
+
* @typedef {import('appium/types').InstallType} InstallType
|
|
116
|
+
*/
|
|
117
|
+
/**
|
|
118
|
+
* Options for {@linkcode DriverCliCommand.uninstall}
|
|
119
|
+
* @typedef DriverUninstallOpts
|
|
120
|
+
* @property {string} driver - the name or spec of a driver to uninstall
|
|
121
|
+
*/
|
|
122
|
+
/**
|
|
123
|
+
* Options for {@linkcode DriverCliCommand.update}
|
|
124
|
+
* @typedef DriverUpdateOpts
|
|
125
|
+
* @property {string} driver - the name of the driver to update
|
|
126
|
+
* @property {boolean} unsafe - if true, will perform unsafe updates past major revision boundaries
|
|
127
|
+
*/
|
|
128
|
+
/**
|
|
129
|
+
* Options for {@linkcode DriverCliCommand.run}.
|
|
130
|
+
* @typedef DriverRunOptions
|
|
131
|
+
* @property {string} driver - name of the driver to run a script from
|
|
132
|
+
* @property {string} scriptName - name of the script to run
|
|
133
|
+
* @property {string[]} [extraArgs] - arguments to pass to the script
|
|
134
|
+
*/
|
|
135
|
+
//# sourceMappingURL=driver-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"driver-command.js","sourceRoot":"","sources":["../../../lib/cli/driver-command.js"],"names":[],"mappings":";;;;;AAAA,oDAAuB;AACvB,4EAAsD;AACtD,4CAA2C;AAC3C,0BAAwB;AAExB,MAAM,iBAAiB,GAAG,CAAC,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,WAAW,CAAC,CAAC;AAEzF;;GAEG;AAEH,MAAqB,gBAAiB,SAAQ,2BAAmB;IAC/D;;OAEG;IACH,YAAY,EAAC,MAAM,EAAE,IAAI,EAAC;QACxB,KAAK,CAAC,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;QACtB,IAAI,CAAC,eAAe,GAAG,yBAAa,CAAC;IACvC,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,OAAO,CAAC,EAAC,MAAM,EAAE,WAAW,EAAE,WAAW,EAAC;QAC9C,OAAO,MAAM,KAAK,CAAC,QAAQ,CAAC;YAC1B,WAAW,EAAE,MAAM;YACnB,WAAW;YACX,WAAW;SACZ,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,SAAS,CAAC,EAAC,MAAM,EAAC;QACtB,OAAO,MAAM,KAAK,CAAC,UAAU,CAAC,EAAC,WAAW,EAAE,MAAM,EAAC,CAAC,CAAC;IACvD,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CAAC,EAAC,MAAM,EAAE,MAAM,EAAC;QAC3B,OAAO,MAAM,KAAK,CAAC,OAAO,CAAC,EAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAC,CAAC,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,GAAG,CAAC,EAAC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAC;QACvC,OAAO,MAAM,KAAK,CAAC,IAAI,CAAC;YACtB,WAAW,EAAE,MAAM;YACnB,UAAU;YACV,SAAS;YACT,YAAY,EAAE,IAAI,CAAC,YAAY;SAChC,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,kBAAkB,CAAC,EAAC,OAAO,EAAE,OAAO,EAAC;QACnC,OAAO,CACL,UAAU,OAAO,IAAI,OAAO,CAAC,OAAO,2BAA2B,CAAC,KAAK;YACrE,qBAAqB,OAAO,CAAC,cAAc,CAAC,KAAK,IAAI;YACrD,oBAAoB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,KAAK,EAAE,CAClE,CAAC;IACJ,CAAC;IAED;;;;;;;;OAQG;IACH,uBAAuB,CAAC,cAAc,EAAE,WAAW;QACjD,MAAM,aAAa,GAAG,iBAAiB,CAAC,MAAM,CAC5C,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,KAAK,CAAC,CAAC,EAC/D,EAAE,CACH,CAAC;QAEF,IAAI,CAAC,gBAAC,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;YAC7B,MAAM,IAAI,KAAK,CACb,WAAW,WAAW,kDAAkD;gBACtE,gCAAgC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,CAClE,CAAC;SACH;IACH,CAAC;CACF;AA5FD,mCA4FC;AAED;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;;;;GAMG;AAEH;;GAEG;AAEH;;;;GAIG;AAEH;;;;;GAKG;AAEH;;;;;;GAMG"}
|