appium 2.0.0-beta.30 → 2.0.0-beta.35
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 +1 -1
- package/build/lib/appium.d.ts.map +1 -1
- package/build/lib/appium.js +5 -2
- package/build/lib/cli/args.js +1 -1
- package/build/lib/cli/driver-command.d.ts +3 -3
- package/build/lib/cli/driver-command.d.ts.map +1 -1
- package/build/lib/cli/driver-command.js +8 -8
- package/build/lib/cli/extension-command.d.ts +22 -17
- package/build/lib/cli/extension-command.d.ts.map +1 -1
- package/build/lib/cli/extension-command.js +35 -36
- package/build/lib/cli/extension.js +1 -1
- package/build/lib/cli/parser.d.ts +3 -2
- package/build/lib/cli/parser.d.ts.map +1 -1
- package/build/lib/cli/parser.js +1 -1
- package/build/lib/cli/plugin-command.d.ts +9 -15
- package/build/lib/cli/plugin-command.d.ts.map +1 -1
- package/build/lib/cli/plugin-command.js +8 -8
- package/build/lib/cli/utils.js +1 -1
- package/build/lib/config-file.js +1 -1
- package/build/lib/config.d.ts +5 -4
- package/build/lib/config.d.ts.map +1 -1
- package/build/lib/config.js +1 -1
- package/build/lib/constants.js +1 -1
- package/build/lib/extension/driver-config.js +1 -1
- package/build/lib/extension/extension-config.js +1 -1
- package/build/lib/extension/index.js +1 -1
- package/build/lib/extension/manifest.d.ts.map +1 -1
- package/build/lib/extension/manifest.js +1 -1
- package/build/lib/extension/package-changed.js +1 -1
- package/build/lib/extension/plugin-config.js +1 -1
- package/build/lib/grid-register.js +1 -1
- package/build/lib/logger.js +1 -1
- package/build/lib/logsink.js +1 -1
- package/build/lib/main.d.ts +13 -10
- package/build/lib/main.d.ts.map +1 -1
- package/build/lib/main.js +57 -50
- package/build/lib/schema/arg-spec.js +1 -1
- package/build/lib/schema/cli-args.js +1 -1
- package/build/lib/schema/cli-transformers.js +1 -1
- package/build/lib/schema/index.js +1 -1
- package/build/lib/schema/keywords.js +1 -1
- package/build/lib/schema/schema.js +1 -1
- package/build/lib/utils.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/appium-manifest.d.ts +40 -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.d.ts +43 -0
- package/build/types/extension.d.ts.map +1 -0
- package/build/types/external-manifest.d.ts +47 -0
- package/build/types/external-manifest.d.ts.map +1 -0
- package/build/types/index.d.ts +15 -0
- package/build/types/index.d.ts.map +1 -0
- package/lib/appium.js +7 -3
- package/lib/cli/driver-command.js +45 -20
- package/lib/cli/extension-command.js +229 -123
- package/lib/cli/parser.js +2 -1
- package/lib/cli/plugin-command.js +33 -18
- package/lib/config.js +6 -5
- package/lib/extension/manifest.js +0 -2
- package/lib/main.js +78 -63
- package/package.json +20 -14
- package/types/{appium-manifest.d.ts → appium-manifest.ts} +1 -1
- package/types/{cli.d.ts → cli.ts} +48 -29
- package/types/{extension.d.ts → extension.ts} +4 -4
- package/types/{external-manifest.d.ts → external-manifest.ts} +2 -2
- package/types/{index.d.ts → index.ts} +7 -0
- package/lib/appium-config.schema.json +0 -278
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { ServerArgs } from '@appium/types';
|
|
2
|
+
import type { DRIVER_TYPE as DRIVER_SUBCOMMAND, EXT_SUBCOMMAND_INSTALL, EXT_SUBCOMMAND_LIST, EXT_SUBCOMMAND_RUN, EXT_SUBCOMMAND_UNINSTALL, EXT_SUBCOMMAND_UPDATE, PLUGIN_TYPE as PLUGIN_SUBCOMMAND, SERVER_SUBCOMMAND } from '../lib/constants';
|
|
3
|
+
export declare type ServerSubcommand = typeof SERVER_SUBCOMMAND;
|
|
4
|
+
export declare type DriverSubcommand = typeof DRIVER_SUBCOMMAND;
|
|
5
|
+
export declare type PluginSubcommand = typeof PLUGIN_SUBCOMMAND;
|
|
6
|
+
/**
|
|
7
|
+
* Possible subcommands for the `appium` CLI.
|
|
8
|
+
*/
|
|
9
|
+
export declare type CliSubcommand = ServerSubcommand | DriverSubcommand | PluginSubcommand;
|
|
10
|
+
/**
|
|
11
|
+
* Possible subcommands of {@linkcode DriverSubcommand} or
|
|
12
|
+
* {@linkcode PluginSubcommand}.
|
|
13
|
+
*/
|
|
14
|
+
export declare type CliExtensionSubcommand = typeof EXT_SUBCOMMAND_INSTALL | typeof EXT_SUBCOMMAND_LIST | typeof EXT_SUBCOMMAND_RUN | typeof EXT_SUBCOMMAND_UPDATE | typeof EXT_SUBCOMMAND_UNINSTALL;
|
|
15
|
+
/**
|
|
16
|
+
* Random stuff that may appear in the parsed args which has no equivalent in a
|
|
17
|
+
* config file.
|
|
18
|
+
*/
|
|
19
|
+
export interface MoreArgs {
|
|
20
|
+
/**
|
|
21
|
+
* Possible subcommands. If empty, defaults to {@linkcode ServerSubcommand}.
|
|
22
|
+
*/
|
|
23
|
+
subcommand?: CliSubcommand;
|
|
24
|
+
/**
|
|
25
|
+
* Path to config file, if any. Does not make sense for this to be allowed in a config file!
|
|
26
|
+
*/
|
|
27
|
+
configFile?: string;
|
|
28
|
+
/**
|
|
29
|
+
* If true, show the config and exit
|
|
30
|
+
*/
|
|
31
|
+
showConfig?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* If true, open a REPL
|
|
34
|
+
*/
|
|
35
|
+
shell?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* These arguments are _not_ supported by the CLI, but only via programmatic usage / tests.
|
|
39
|
+
*/
|
|
40
|
+
export interface ProgrammaticArgs {
|
|
41
|
+
/**
|
|
42
|
+
* If `true`, throw on error instead of exit.
|
|
43
|
+
*/
|
|
44
|
+
throwInsteadOfExit?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Seems to only be used in tests or standalone driver calls
|
|
47
|
+
*/
|
|
48
|
+
logHandler?: (...args: any[]) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Alternate way to set `APPIUM_HOME` for tests. Since we don't want to muck about
|
|
51
|
+
* with the environment, we just set it here.
|
|
52
|
+
*
|
|
53
|
+
* Setting this means that any discovery of the proper `APPIUM_HOME` path is bypassed
|
|
54
|
+
* and is equivalent to setting `APPIUM_HOME` in the environment.
|
|
55
|
+
*/
|
|
56
|
+
appiumHome?: string;
|
|
57
|
+
/**
|
|
58
|
+
* If true, show the {@link BuildInfo build info} and exit
|
|
59
|
+
*/
|
|
60
|
+
showBuildInfo?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* If true, show config and exit
|
|
63
|
+
*/
|
|
64
|
+
showConfig?: boolean;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* These are args which the user will specify if using an extension command
|
|
68
|
+
*/
|
|
69
|
+
export interface ExtArgs extends WithExtSubcommand {
|
|
70
|
+
/**
|
|
71
|
+
* Subcommands of `driver` subcommand
|
|
72
|
+
*/
|
|
73
|
+
driverCommand?: CliExtensionSubcommand;
|
|
74
|
+
/**
|
|
75
|
+
* Subcommands of `plugin` subcommand
|
|
76
|
+
*/
|
|
77
|
+
pluginCommand?: CliExtensionSubcommand;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Args having the `server` subcommand
|
|
81
|
+
*/
|
|
82
|
+
export interface WithServerSubcommand {
|
|
83
|
+
subcommand?: ServerSubcommand;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Args having the `driver` or `plugin` subcommand
|
|
87
|
+
*/
|
|
88
|
+
export interface WithExtSubcommand {
|
|
89
|
+
subcommand: DriverSubcommand | PluginSubcommand;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Some generic bits of arguments; should not be used outside this declaration
|
|
93
|
+
*/
|
|
94
|
+
declare type CommonArgs<SArgs, T = WithServerSubcommand> = MoreArgs & ProgrammaticArgs & (T extends WithServerSubcommand ? SArgs : T extends WithExtSubcommand ? ExtArgs : never);
|
|
95
|
+
/**
|
|
96
|
+
* Fully-parsed arguments, containing defaults, computed args, and config file values.
|
|
97
|
+
*/
|
|
98
|
+
export declare type ParsedArgs<T = WithServerSubcommand> = CommonArgs<ServerArgs, T>;
|
|
99
|
+
/**
|
|
100
|
+
* Partial arguments, as supplied by a user. _May_ have defaults applied; _may_ contain config values; _may_ contain computed args.
|
|
101
|
+
*/
|
|
102
|
+
export declare type Args<T = WithServerSubcommand> = CommonArgs<Partial<ServerArgs>, T>;
|
|
103
|
+
/**
|
|
104
|
+
* Shown by `appium --build-info`
|
|
105
|
+
*/
|
|
106
|
+
export declare type BuildInfo = {
|
|
107
|
+
version: string;
|
|
108
|
+
'git-sha'?: string;
|
|
109
|
+
built?: string;
|
|
110
|
+
};
|
|
111
|
+
export {};
|
|
112
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../types/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,EACV,WAAW,IAAI,iBAAiB,EAChC,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACrB,WAAW,IAAI,iBAAiB,EAChC,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAE1B,oBAAY,gBAAgB,GAAG,OAAO,iBAAiB,CAAC;AACxD,oBAAY,gBAAgB,GAAG,OAAO,iBAAiB,CAAC;AACxD,oBAAY,gBAAgB,GAAG,OAAO,iBAAiB,CAAC;AAExD;;GAEG;AACH,oBAAY,aAAa,GACrB,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,CAAC;AAErB;;;GAGG;AACH,oBAAY,sBAAsB,GAC9B,OAAO,sBAAsB,GAC7B,OAAO,mBAAmB,GAC1B,OAAO,kBAAkB,GACzB,OAAO,qBAAqB,GAC5B,OAAO,wBAAwB,CAAC;AAEpC;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC;IAE3B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IAEtC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,OAAQ,SAAQ,iBAAiB;IAChD;;OAEG;IACH,aAAa,CAAC,EAAE,sBAAsB,CAAC;IAEvC;;OAEG;IACH,aAAa,CAAC,EAAE,sBAAsB,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,gBAAgB,GAAG,gBAAgB,CAAC;CACjD;AAED;;GAEG;AACH,aAAK,UAAU,CAAC,KAAK,EAAE,CAAC,GAAG,oBAAoB,IAAI,QAAQ,GACzD,gBAAgB,GAChB,CAAC,CAAC,SAAS,oBAAoB,GAC3B,KAAK,GACL,CAAC,SAAS,iBAAiB,GAC3B,OAAO,GACP,KAAK,CAAC,CAAC;AAEb;;GAEG;AACH,oBAAY,UAAU,CAAC,CAAC,GAAG,oBAAoB,IAAI,UAAU,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;AAE7E;;GAEG;AACH,oBAAY,IAAI,CAAC,CAAC,GAAG,oBAAoB,IAAI,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;AAEhF;;GAEG;AACH,oBAAY,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { BaseDriverBase } from '@appium/base-driver/lib/basedriver/driver';
|
|
2
|
+
import { Class, Driver, ExternalDriver } from '@appium/types';
|
|
3
|
+
import { DriverType, ExtensionType, PluginType } from '.';
|
|
4
|
+
export declare type DriverClass = BaseDriverBase<ExternalDriver, ExternalDriverStatic>;
|
|
5
|
+
/**
|
|
6
|
+
* Additional static props for external driver classes
|
|
7
|
+
*/
|
|
8
|
+
export interface ExternalDriverStatic {
|
|
9
|
+
driverName: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* TODO: This should be derived from the base plugin.
|
|
13
|
+
*/
|
|
14
|
+
export declare type PluginClass = Class<PluginProto, ExternalPluginStatic>;
|
|
15
|
+
/**
|
|
16
|
+
* Static props for plugin classes
|
|
17
|
+
*/
|
|
18
|
+
export interface ExternalPluginStatic {
|
|
19
|
+
pluginName: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A plugin must have this shape.
|
|
23
|
+
* @todo Use base plugin instead of this
|
|
24
|
+
*/
|
|
25
|
+
export interface PluginProto {
|
|
26
|
+
/**
|
|
27
|
+
* I'm not sure why `plugin.name` is required, but it is.
|
|
28
|
+
*/
|
|
29
|
+
name: string;
|
|
30
|
+
/**
|
|
31
|
+
* Assigned by Appium; _not_ provided by implementor.
|
|
32
|
+
*/
|
|
33
|
+
cliArgs?: Record<string, any>;
|
|
34
|
+
/**
|
|
35
|
+
* Don't know what this is, but it's also required.
|
|
36
|
+
*/
|
|
37
|
+
onUnexpectedShutdown?: (driver: Driver, cause: Error | string) => Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Generic to get at the class of an extension.
|
|
41
|
+
*/
|
|
42
|
+
export declare type ExtClass<ExtType extends ExtensionType> = ExtType extends DriverType ? DriverClass : ExtType extends PluginType ? PluginClass : never;
|
|
43
|
+
//# sourceMappingURL=extension.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../types/extension.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAE1D,oBAAY,WAAW,GAAG,cAAc,CAAC,cAAc,EACrD,oBAAoB,CAAC,CAAC;AAExB;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,oBAAY,WAAW,GAAG,KAAK,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B;;OAEG;IACH,oBAAoB,CAAC,EAAE,CACrB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,GAAG,MAAM,KAClB,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;AAED;;GAEG;AACH,oBAAY,QAAQ,CAAC,OAAO,SAAS,aAAa,IAAI,OAAO,SAAS,UAAU,GAC5E,WAAW,GACX,OAAO,SAAS,UAAU,GAC1B,WAAW,GACX,KAAK,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These types describe information about external extensions and the contents of their `package.json` files
|
|
3
|
+
*/
|
|
4
|
+
import type { SchemaObject } from 'ajv';
|
|
5
|
+
import type { PackageJson, SetRequired } from 'type-fest';
|
|
6
|
+
import { DriverType, ExtensionType, PluginType } from './index';
|
|
7
|
+
/**
|
|
8
|
+
* This is what is allowed in the `appium.schema` prop of an extension's `package.json`.
|
|
9
|
+
*/
|
|
10
|
+
export declare type SchemaMetadata = string | (SchemaObject & {
|
|
11
|
+
[key: number]: never;
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* Manifest data shared by all extensions, as contained in `package.json`
|
|
15
|
+
*/
|
|
16
|
+
export interface CommonMetadata {
|
|
17
|
+
mainClass: string;
|
|
18
|
+
scripts?: Record<string, string>;
|
|
19
|
+
schema?: SchemaMetadata;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Driver-specific manifest data as contained in `package.json`
|
|
23
|
+
*/
|
|
24
|
+
export interface DriverMetadata {
|
|
25
|
+
automationName: string;
|
|
26
|
+
platformNames: string[];
|
|
27
|
+
driverName: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Plugin-specific manifest data as stored in `package.json`
|
|
31
|
+
*/
|
|
32
|
+
export interface PluginMetadata {
|
|
33
|
+
pluginName: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Generic type to refer to either {@linkcode DriverMetadata} or {@linkcode PluginMetadata}
|
|
37
|
+
* Corresponds to the `appium` prop in an extension's `package.json`.
|
|
38
|
+
*/
|
|
39
|
+
export declare type ExtMetadata<ExtType extends ExtensionType> = (ExtType extends DriverType ? DriverMetadata : ExtType extends PluginType ? PluginMetadata : never) & CommonMetadata;
|
|
40
|
+
/**
|
|
41
|
+
* A `package.json` containing extension metadata.
|
|
42
|
+
* Required fields are `name`, `version`, and `appium`.
|
|
43
|
+
*/
|
|
44
|
+
export declare type ExtPackageJson<ExtType extends ExtensionType> = SetRequired<PackageJson, 'name' | 'version'> & {
|
|
45
|
+
appium: ExtMetadata<ExtType>;
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=external-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external-manifest.d.ts","sourceRoot":"","sources":["../../types/external-manifest.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEhE;;GAEG;AACH,oBAAY,cAAc,GAAG,MAAM,GAAG,CAAC,YAAY,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAA;CAAC,CAAC,CAAC;AAE9E;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,oBAAY,WAAW,CAAC,OAAO,SAAS,aAAa,IACnD,CAAC,OAAO,SAAS,UAAU,GACvB,cAAc,GACd,OAAO,SAAS,UAAU,GAC1B,cAAc,GACd,KAAK,CAAC,GACR,cAAc,CAAC;AAEnB;;;GAGG;AACH,oBAAY,cAAc,CAAC,OAAO,SAAS,aAAa,IAAI,WAAW,CACrE,WAAW,EACX,MAAM,GAAG,SAAS,CACnB,GAAG;IAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
export * from './appium-manifest';
|
|
3
|
+
export * from './external-manifest';
|
|
4
|
+
export * from './extension';
|
|
5
|
+
export * from './cli';
|
|
6
|
+
export declare type DriverType = 'driver';
|
|
7
|
+
export declare type PluginType = 'plugin';
|
|
8
|
+
export declare type ExtensionType = DriverType | PluginType;
|
|
9
|
+
/**
|
|
10
|
+
* Known environment variables concerning Appium
|
|
11
|
+
*/
|
|
12
|
+
export interface AppiumEnv extends NodeJS.ProcessEnv {
|
|
13
|
+
APPIUM_HOME?: string;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":";AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,oBAAY,UAAU,GAAG,QAAQ,CAAC;AAClC,oBAAY,UAAU,GAAG,QAAQ,CAAC;AAClC,oBAAY,aAAa,GAAG,UAAU,GAAG,UAAU,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,MAAM,CAAC,UAAU;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
package/lib/appium.js
CHANGED
|
@@ -274,10 +274,14 @@ class AppiumDriver extends DriverCore {
|
|
|
274
274
|
// the driver so that they cannot be mimicked by a malicious user sending in capabilities
|
|
275
275
|
this.assignCliArgsToExtension('driver', driverName, driverInstance);
|
|
276
276
|
|
|
277
|
-
|
|
278
277
|
// This assignment is required for correct web sockets functionality inside the driver
|
|
279
278
|
// Drivers/plugins might also want to know where they are hosted
|
|
280
|
-
|
|
279
|
+
|
|
280
|
+
// XXX: temporary hack to work around #16747
|
|
281
|
+
driverInstance.server = this.server;
|
|
282
|
+
driverInstance.serverHost = this.args.address;
|
|
283
|
+
driverInstance.serverPort = this.args.port;
|
|
284
|
+
driverInstance.serverPath = this.args.basePath;
|
|
281
285
|
|
|
282
286
|
try {
|
|
283
287
|
runningDriversData = await this.curSessionDataForDriver(InnerDriver) ?? [];
|
|
@@ -737,7 +741,7 @@ export { AppiumDriver };
|
|
|
737
741
|
* @typedef {import('@appium/types').ExternalDriver} ExternalDriver
|
|
738
742
|
* @typedef {import('@appium/types').W3CCapabilities} W3CCapabilities
|
|
739
743
|
* @typedef {import('@appium/types').DriverData} DriverData
|
|
740
|
-
* @typedef {import('@appium/types').
|
|
744
|
+
* @typedef {import('@appium/types').ServerArgs} DriverOpts
|
|
741
745
|
* @typedef {import('@appium/types').Constraints} Constraints
|
|
742
746
|
* @typedef {import('@appium/types').AppiumServer} AppiumServer
|
|
743
747
|
* @typedef {import('../types').ExtensionType} ExtensionType
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import ExtensionCommand from './extension-command';
|
|
3
|
-
import {
|
|
3
|
+
import {KNOWN_DRIVERS} from '../constants';
|
|
4
4
|
import '@colors/colors';
|
|
5
5
|
|
|
6
|
-
const REQ_DRIVER_FIELDS = [
|
|
6
|
+
const REQ_DRIVER_FIELDS = [
|
|
7
|
+
'driverName',
|
|
8
|
+
'automationName',
|
|
9
|
+
'platformNames',
|
|
10
|
+
'mainClass',
|
|
11
|
+
];
|
|
12
|
+
|
|
7
13
|
/**
|
|
8
|
-
* @extends {ExtensionCommand<
|
|
14
|
+
* @extends {ExtensionCommand<DriverType>}
|
|
9
15
|
*/
|
|
10
16
|
export default class DriverCommand extends ExtensionCommand {
|
|
11
|
-
|
|
12
17
|
/**
|
|
13
18
|
* @param {DriverCommandOptions} opts
|
|
14
19
|
*/
|
|
@@ -18,43 +23,63 @@ export default class DriverCommand extends ExtensionCommand {
|
|
|
18
23
|
}
|
|
19
24
|
|
|
20
25
|
async install ({driver, installType, packageName}) {
|
|
21
|
-
return await super._install({
|
|
26
|
+
return await super._install({
|
|
27
|
+
installSpec: driver,
|
|
28
|
+
installType,
|
|
29
|
+
packageName,
|
|
30
|
+
});
|
|
22
31
|
}
|
|
23
32
|
|
|
24
33
|
async uninstall ({driver}) {
|
|
25
|
-
return await super._uninstall({
|
|
34
|
+
return await super._uninstall({installSpec: driver});
|
|
26
35
|
}
|
|
27
36
|
|
|
28
37
|
async update ({driver, unsafe}) {
|
|
29
|
-
return await super._update({
|
|
38
|
+
return await super._update({installSpec: driver, unsafe});
|
|
30
39
|
}
|
|
31
40
|
|
|
32
41
|
async run ({driver, scriptName}) {
|
|
33
|
-
return await super._run({
|
|
42
|
+
return await super._run({installSpec: driver, scriptName});
|
|
34
43
|
}
|
|
35
44
|
|
|
36
45
|
getPostInstallText ({extName, extData}) {
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
46
|
+
return (
|
|
47
|
+
`Driver ${extName}@${extData.version} successfully installed\n`.green +
|
|
48
|
+
`- automationName: ${extData.automationName.green}\n` +
|
|
49
|
+
`- platformNames: ${JSON.stringify(extData.platformNames).green}`
|
|
50
|
+
);
|
|
40
51
|
}
|
|
41
52
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Validates fields in `appium` field of `driverMetadata`
|
|
55
|
+
*
|
|
56
|
+
* For any `package.json` fields which a driver requires, validate the type of
|
|
57
|
+
* those fields on the `package.json` data, throwing an error if anything is
|
|
58
|
+
* amiss.
|
|
59
|
+
* @param {import('appium/types').ExtMetadata<DriverType>} driverMetadata
|
|
60
|
+
* @param {string} installSpec
|
|
61
|
+
*/
|
|
62
|
+
validateExtensionFields (driverMetadata, installSpec) {
|
|
63
|
+
const missingFields = REQ_DRIVER_FIELDS.reduce(
|
|
64
|
+
(acc, field) => (driverMetadata[field] ? acc : [...acc, field]),
|
|
65
|
+
[]
|
|
66
|
+
);
|
|
46
67
|
|
|
47
68
|
if (!_.isEmpty(missingFields)) {
|
|
48
|
-
throw new Error(
|
|
49
|
-
|
|
69
|
+
throw new Error(
|
|
70
|
+
`Driver "${installSpec}" did not expose correct fields for compability ` +
|
|
71
|
+
`with Appium. Missing fields: ${JSON.stringify(missingFields)}`
|
|
72
|
+
);
|
|
50
73
|
}
|
|
51
|
-
|
|
52
74
|
}
|
|
53
|
-
|
|
54
75
|
}
|
|
55
76
|
|
|
56
77
|
/**
|
|
57
78
|
* @typedef DriverCommandOptions
|
|
58
|
-
* @property {import('../extension/extension-config').ExtensionConfig<
|
|
79
|
+
* @property {import('../extension/extension-config').ExtensionConfig<DriverType>} config
|
|
59
80
|
* @property {boolean} json
|
|
60
81
|
*/
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @typedef {import('appium/types').DriverType} DriverType
|
|
85
|
+
*/
|