appium 2.0.0-beta.5 → 2.0.0-beta.53
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 +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 +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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../../../lib/cli/args.js"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,4CAQsB;AACtB,oEAA4D;AAC5D,iDAAgD;AAChD,MAAM,cAAc,GAAG,UAAU,CAAC;AAClC,MAAM,cAAc,GAAG,eAAe,CAAC;AAEvC;;;GAGG;AACH,MAAM,mBAAmB,GAAG,CAAC,GAAG,gCAAa,CAAC,CAAC;AAE/C,iCAAiC;AACjC,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,uBAAW,EAAE,uBAAW,CAAC,CAAC,CAAC;AAE5D,qEAAqE;AACrE,kCAAkC;AAClC,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;IAClC;QACE,CAAC,QAAQ,CAAC;QACV;YACE,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,YAAY;YACpB,IAAI,EAAE,4BAA4B;YAClC,IAAI,EAAE,MAAM;SACb;KACF;CACF,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,gBAAgB,GAAG,gBAAC,CAAC,OAAO,CAAC,SAAS,gBAAgB;IAC1D,MAAM,aAAa,GAAG,EAAE,CAAC;IACzB,KAAK,MAAM,IAAI,IAAI,eAAe,EA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Z;YACE,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,KAAK;YACf,IAAI,EAAE,4CAA4C;SACnD;KACF;CACF,CAAC,CAAC;AAIH;;GAEG;AAEH;;;GAGG"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @extends {ExtensionCommand<DriverType>}
|
|
3
|
+
*/
|
|
4
|
+
export default class DriverCommand extends ExtensionCommand<"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 DriverCommand.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 DriverCommand.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 DriverCommand.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 DriverCommand.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 ExtensionCommand 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,CAI3D;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,130 @@
|
|
|
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 {ExtensionCommand<DriverType>}
|
|
13
|
+
*/
|
|
14
|
+
class DriverCommand 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({ installSpec: driver, scriptName, extraArgs });
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @param {import('./extension-command').ExtensionArgs} opts
|
|
64
|
+
* @returns {string}
|
|
65
|
+
*/
|
|
66
|
+
getPostInstallText({ extName, extData }) {
|
|
67
|
+
return (`Driver ${extName}@${extData.version} successfully installed\n`.green +
|
|
68
|
+
`- automationName: ${extData.automationName.green}\n` +
|
|
69
|
+
`- platformNames: ${JSON.stringify(extData.platformNames).green}`);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Validates fields in `appium` field of `driverMetadata`
|
|
73
|
+
*
|
|
74
|
+
* For any `package.json` fields which a driver requires, validate the type of
|
|
75
|
+
* those fields on the `package.json` data, throwing an error if anything is
|
|
76
|
+
* amiss.
|
|
77
|
+
* @param {import('appium/types').ExtMetadata<DriverType>} driverMetadata
|
|
78
|
+
* @param {string} installSpec
|
|
79
|
+
*/
|
|
80
|
+
validateExtensionFields(driverMetadata, installSpec) {
|
|
81
|
+
const missingFields = REQ_DRIVER_FIELDS.reduce((acc, field) => (driverMetadata[field] ? acc : [...acc, field]), []);
|
|
82
|
+
if (!lodash_1.default.isEmpty(missingFields)) {
|
|
83
|
+
throw new Error(`Driver "${installSpec}" did not expose correct fields for compability ` +
|
|
84
|
+
`with Appium. Missing fields: ${JSON.stringify(missingFields)}`);
|
|
85
|
+
}
|
|
77
86
|
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
87
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
88
|
+
exports.default = DriverCommand;
|
|
89
|
+
/**
|
|
90
|
+
* @typedef {import('@appium/types').ExtensionType} ExtensionType
|
|
91
|
+
* @typedef {import('@appium/types').DriverType} DriverType
|
|
92
|
+
*/
|
|
93
|
+
/**
|
|
94
|
+
* @template {ExtensionType} ExtType
|
|
95
|
+
* @typedef {import('appium/types').ExtRecord<ExtType>} ExtRecord
|
|
96
|
+
*/
|
|
97
|
+
/**
|
|
98
|
+
* @typedef DriverCommandOptions
|
|
99
|
+
* @property {import('../extension/extension-config').ExtensionConfig<DriverType>} config
|
|
100
|
+
* @property {boolean} json
|
|
101
|
+
*/
|
|
102
|
+
/**
|
|
103
|
+
* Options for {@linkcode DriverCommand.install}
|
|
104
|
+
* @typedef DriverInstallOpts
|
|
105
|
+
* @property {string} driver - the name or spec of a driver to install
|
|
106
|
+
* @property {InstallType} installType - how to install this driver. One of the INSTALL_TYPES
|
|
107
|
+
* @property {string} [packageName] - for git/github installs, the driver node package name
|
|
108
|
+
*/
|
|
109
|
+
/**
|
|
110
|
+
* @typedef {import('appium/types').InstallType} InstallType
|
|
111
|
+
*/
|
|
112
|
+
/**
|
|
113
|
+
* Options for {@linkcode DriverCommand.uninstall}
|
|
114
|
+
* @typedef DriverUninstallOpts
|
|
115
|
+
* @property {string} driver - the name or spec of a driver to uninstall
|
|
116
|
+
*/
|
|
117
|
+
/**
|
|
118
|
+
* Options for {@linkcode DriverCommand.update}
|
|
119
|
+
* @typedef DriverUpdateOpts
|
|
120
|
+
* @property {string} driver - the name of the driver to update
|
|
121
|
+
* @property {boolean} unsafe - if true, will perform unsafe updates past major revision boundaries
|
|
122
|
+
*/
|
|
123
|
+
/**
|
|
124
|
+
* Options for {@linkcode DriverCommand.run}.
|
|
125
|
+
* @typedef DriverRunOptions
|
|
126
|
+
* @property {string} driver - name of the driver to run a script from
|
|
127
|
+
* @property {string} scriptName - name of the script to run
|
|
128
|
+
* @property {string[]} [extraArgs] - arguments to pass to the script
|
|
129
|
+
*/
|
|
130
|
+
//# sourceMappingURL=driver-command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