appium 2.0.0-beta.55 → 2.0.0-beta.57

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.
Files changed (50) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +3 -6
  3. package/build/lib/appium.d.ts +7 -12
  4. package/build/lib/appium.d.ts.map +1 -1
  5. package/build/lib/appium.js +4 -28
  6. package/build/lib/appium.js.map +1 -1
  7. package/build/lib/cli/driver-command.d.ts.map +1 -1
  8. package/build/lib/cli/driver-command.js +6 -1
  9. package/build/lib/cli/driver-command.js.map +1 -1
  10. package/build/lib/cli/extension-command.d.ts +23 -9
  11. package/build/lib/cli/extension-command.d.ts.map +1 -1
  12. package/build/lib/cli/extension-command.js +67 -22
  13. package/build/lib/cli/extension-command.js.map +1 -1
  14. package/build/lib/cli/plugin-command.d.ts.map +1 -1
  15. package/build/lib/cli/plugin-command.js +6 -1
  16. package/build/lib/cli/plugin-command.js.map +1 -1
  17. package/build/lib/config.d.ts +1 -1
  18. package/build/lib/config.d.ts.map +1 -1
  19. package/build/lib/config.js +3 -2
  20. package/build/lib/config.js.map +1 -1
  21. package/build/lib/extension/extension-config.d.ts +6 -6
  22. package/build/lib/extension/extension-config.d.ts.map +1 -1
  23. package/build/lib/extension/extension-config.js +3 -3
  24. package/build/lib/schema/arg-spec.d.ts +1 -1
  25. package/build/lib/schema/arg-spec.js +1 -1
  26. package/build/lib/schema/schema.d.ts +4 -3
  27. package/build/lib/schema/schema.d.ts.map +1 -1
  28. package/build/lib/schema/schema.js +61 -36
  29. package/build/lib/schema/schema.js.map +1 -1
  30. package/build/lib/utils.d.ts +13 -13
  31. package/build/types/cli.d.ts +11 -11
  32. package/build/types/cli.d.ts.map +1 -1
  33. package/build/types/index.d.ts +1 -1
  34. package/build/types/index.d.ts.map +1 -1
  35. package/build/types/manifest/base.d.ts +8 -8
  36. package/build/types/manifest/base.d.ts.map +1 -1
  37. package/build/types/manifest/index.d.ts +1 -1
  38. package/build/types/manifest/index.d.ts.map +1 -1
  39. package/build/types/manifest/v3.d.ts +8 -8
  40. package/build/types/manifest/v3.d.ts.map +1 -1
  41. package/lib/appium.js +20 -8
  42. package/lib/cli/driver-command.js +6 -1
  43. package/lib/cli/extension-command.js +71 -22
  44. package/lib/cli/plugin-command.js +6 -1
  45. package/lib/config.js +3 -2
  46. package/lib/extension/extension-config.js +3 -3
  47. package/lib/schema/arg-spec.js +1 -1
  48. package/lib/schema/schema.js +42 -39
  49. package/package.json +11 -11
  50. package/scripts/autoinstall-extensions.js +23 -0
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../types/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AACjE,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AACtC,OAAO,EAAC,WAAW,EAAC,MAAM,YAAY,CAAC;AACvC,oBAAY,gBAAgB,GAAG,QAAQ,CAAC;AACxC,oBAAY,gBAAgB,GAAG,UAAU,CAAC;AAC1C,oBAAY,gBAAgB,GAAG,UAAU,CAAC;AAE1C;;GAEG;AACH,oBAAY,mBAAmB,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAEtE;;GAEG;AACH,oBAAY,UAAU,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;AAEhE;;;GAGG;AACH,oBAAY,sBAAsB,GAAG,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEzF,MAAM,WAAW,8BAA8B;IAC7C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,iCAAiC;IAChD,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gCAAgC;IAC/C,MAAM,CAAC,EAAE,OAAO,CAAC;CACl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AACH,MAAM,MAAM,UAAU,CACpB,GAAG,SAAS,UAAU,GAAG,gBAAgB,EACzC,MAAM,SAAS,sBAAsB,GAAG,IAAI,GAAG,IAAI,IACjD,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAE5B;;;;GAIG;AACH,MAAM,MAAM,IAAI,CACd,GAAG,SAAS,UAAU,GAAG,gBAAgB,EACzC,MAAM,SAAS,sBAAsB,GAAG,IAAI,GAAG,IAAI,IACjD,GAAG,SAAS,gBAAgB,GAC5B,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,MAAM,UAAU,CAAC,GAC9C,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC"}
@@ -11,5 +11,5 @@ export interface AppiumEnv extends NodeJS.ProcessEnv {
11
11
  /**
12
12
  * Generic to get at the class of an extension.
13
13
  */
14
- export declare type ExtClass<ExtType extends ExtensionType> = ExtType extends DriverType ? DriverClass : ExtType extends PluginType ? PluginClass : never;
14
+ export type ExtClass<ExtType extends ExtensionType> = ExtType extends DriverType ? DriverClass : ExtType extends PluginType ? PluginClass : never;
15
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AAE9F,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AAEtB;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,MAAM,CAAC,UAAU;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,oBAAY,QAAQ,CAAC,OAAO,SAAS,aAAa,IAAI,OAAO,SAAS,UAAU,GAC5E,WAAW,GACX,OAAO,SAAS,UAAU,GAC1B,WAAW,GACX,KAAK,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AAE9F,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AAEtB;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,MAAM,CAAC,UAAU;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,CAAC,OAAO,SAAS,aAAa,IAAI,OAAO,SAAS,UAAU,GAC5E,WAAW,GACX,OAAO,SAAS,UAAU,GAC1B,WAAW,GACX,KAAK,CAAC"}
@@ -4,7 +4,7 @@ import { PackageJson, SetRequired } from 'type-fest';
4
4
  /**
5
5
  * One of the possible extension installation stratgies
6
6
  */
7
- export declare type InstallType = 'npm' | 'git' | 'local' | 'github';
7
+ export type InstallType = 'npm' | 'git' | 'local' | 'github';
8
8
  export interface InternalMetadata {
9
9
  /**
10
10
  * Package name of extension
@@ -36,7 +36,7 @@ export interface InternalMetadata {
36
36
  /**
37
37
  * Shape of the `appium.schema` property in an extension's `package.json` (if it exists)
38
38
  */
39
- export declare type ExtSchemaMetadata = string | (SchemaObject & {
39
+ export type ExtSchemaMetadata = string | (SchemaObject & {
40
40
  [key: number]: never;
41
41
  });
42
42
  /**
@@ -89,17 +89,17 @@ export interface PluginMetadata {
89
89
  /**
90
90
  * Generic extension metadata as stored in the `appium` prop of an extension's `package.json`.
91
91
  */
92
- export declare type ExtMetadata<ExtType extends ExtensionType> = (ExtType extends DriverType ? DriverMetadata : ExtType extends PluginType ? PluginMetadata : never) & CommonExtMetadata;
92
+ export type ExtMetadata<ExtType extends ExtensionType> = (ExtType extends DriverType ? DriverMetadata : ExtType extends PluginType ? PluginMetadata : never) & CommonExtMetadata;
93
93
  /**
94
94
  * Combination of external + internal extension data with `driverName`/`pluginName` removed (it becomes a key in an {@linkcode ExtRecord} object).
95
95
  * Part of `extensions.yaml`.
96
96
  */
97
- export declare type ExtManifest<ExtType extends ExtensionType> = Omit<ExtMetadata<ExtType>, 'driverName' | 'pluginName'> & InternalMetadata;
97
+ export type ExtManifest<ExtType extends ExtensionType> = Omit<ExtMetadata<ExtType>, 'driverName' | 'pluginName'> & InternalMetadata;
98
98
  /**
99
99
  * Lookup of extension name to {@linkcode ExtManifest}.
100
100
  * @see {ManifestData}
101
101
  */
102
- export declare type ExtRecord<ExtType extends ExtensionType> = Record<string, ExtManifest<ExtType>>;
102
+ export type ExtRecord<ExtType extends ExtensionType> = Record<string, ExtManifest<ExtType>>;
103
103
  /**
104
104
  * The shape of the `extensions.yaml` file
105
105
  */
@@ -112,7 +112,7 @@ export interface ManifestData {
112
112
  * The name of an installed extension, as it appears in `extensions.yaml`
113
113
  * (as a property name under `drivers` or `plugins`)
114
114
  */
115
- export declare type ExtName<ExtType extends ExtensionType> = keyof ExtRecord<ExtType>;
115
+ export type ExtName<ExtType extends ExtensionType> = keyof ExtRecord<ExtType>;
116
116
  /**
117
117
  * A `package.json` containing extension metadata.
118
118
  * Must have the following properties:
@@ -121,7 +121,7 @@ export declare type ExtName<ExtType extends ExtensionType> = keyof ExtRecord<Ext
121
121
  * - `appium`: the metadata for the extension
122
122
  * - `peerDependencies.appium`: the maximum compatible version of Appium
123
123
  */
124
- export declare type ExtPackageJson<ExtType extends ExtensionType> = SetRequired<PackageJson, 'name' | 'version'> & {
124
+ export type ExtPackageJson<ExtType extends ExtensionType> = SetRequired<PackageJson, 'name' | 'version'> & {
125
125
  appium: ExtMetadata<ExtType>;
126
126
  peerDependencies: {
127
127
  appium: string;
@@ -131,5 +131,5 @@ export declare type ExtPackageJson<ExtType extends ExtensionType> = SetRequired<
131
131
  /**
132
132
  * A transient format between installation and insertion of extension metadata into the manifest.
133
133
  */
134
- export declare type ExtInstallReceipt<ExtType extends ExtensionType> = ExtMetadata<ExtType> & InternalMetadata;
134
+ export type ExtInstallReceipt<ExtType extends ExtensionType> = ExtMetadata<ExtType> & InternalMetadata;
135
135
  //# sourceMappingURL=base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../types/manifest/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,aAAa,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AACpE,OAAO,EAAC,YAAY,EAAC,MAAM,KAAK,CAAC;AACjC,OAAO,EAAC,WAAW,EAAE,WAAW,EAAC,MAAM,WAAW,CAAC;AAEnD;;GAEG;AACH,oBAAY,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE7D,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,oBAAY,iBAAiB,GAAG,MAAM,GAAG,CAAC,YAAY,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAA;CAAC,CAAC,CAAC;AAEjF;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC;;;;OAIG;IAEH,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAE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ACjF,gBAAgB,CAAC"}
@@ -15,5 +15,5 @@ export interface ManifestDataVersions {
15
15
  *
16
16
  * @privateRemarks You probably don't need to edit this.
17
17
  */
18
- export declare type AnyManifestDataVersion = ManifestDataVersions[keyof ManifestDataVersions];
18
+ export type AnyManifestDataVersion = ManifestDataVersions[keyof ManifestDataVersions];
19
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../types/manifest/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,UAAU,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,UAAU,MAAM,MAAM,CAAC;AAInC,cAAc,MAAM,CAAC;AAGrB,OAAO,EAAC,UAAU,EAAE,UAAU,EAAC,CAAC;AAEhC,MAAM,WAAW,oBAAoB;IACnC,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC;IAC3B,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC;CAC5B;AAGD;;;;GAIG;AACH,oBAAY,sBAAsB,GAAG,oBAAoB,CAAC,MAAM,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../types/manifest/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,UAAU,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,UAAU,MAAM,MAAM,CAAC;AAInC,cAAc,MAAM,CAAC;AAGrB,OAAO,EAAC,UAAU,EAAE,UAAU,EAAC,CAAC;AAEhC,MAAM,WAAW,oBAAoB;IACnC,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC;IAC3B,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC;CAC5B;AAGD;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,oBAAoB,CAAC,MAAM,oBAAoB,CAAC,CAAC"}
@@ -4,7 +4,7 @@ import { PackageJson, SetRequired } from 'type-fest';
4
4
  /**
5
5
  * One of the possible extension installation stratgies
6
6
  */
7
- export declare type InstallType = 'npm' | 'git' | 'local' | 'github';
7
+ export type InstallType = 'npm' | 'git' | 'local' | 'github';
8
8
  export interface InternalMetadata {
9
9
  /**
10
10
  * Package name of extension
@@ -40,7 +40,7 @@ export interface InternalMetadata {
40
40
  /**
41
41
  * Shape of the `appium.schema` property in an extension's `package.json` (if it exists)
42
42
  */
43
- export declare type ExtSchemaMetadata = string | (SchemaObject & {
43
+ export type ExtSchemaMetadata = string | (SchemaObject & {
44
44
  [key: number]: never;
45
45
  });
46
46
  /**
@@ -93,17 +93,17 @@ export interface PluginMetadata {
93
93
  /**
94
94
  * Generic extension metadata as stored in the `appium` prop of an extension's `package.json`.
95
95
  */
96
- export declare type ExtMetadata<ExtType extends ExtensionType> = (ExtType extends DriverType ? DriverMetadata : ExtType extends PluginType ? PluginMetadata : never) & CommonExtMetadata;
96
+ export type ExtMetadata<ExtType extends ExtensionType> = (ExtType extends DriverType ? DriverMetadata : ExtType extends PluginType ? PluginMetadata : never) & CommonExtMetadata;
97
97
  /**
98
98
  * Combination of external + internal extension data with `driverName`/`pluginName` removed (it becomes a key in an {@linkcode ExtRecord} object).
99
99
  * Part of `extensions.yaml`.
100
100
  */
101
- export declare type ExtManifest<ExtType extends ExtensionType> = Omit<ExtMetadata<ExtType>, 'driverName' | 'pluginName'> & InternalMetadata;
101
+ export type ExtManifest<ExtType extends ExtensionType> = Omit<ExtMetadata<ExtType>, 'driverName' | 'pluginName'> & InternalMetadata;
102
102
  /**
103
103
  * Lookup of extension name to {@linkcode ExtManifest}.
104
104
  * @see {ManifestData}
105
105
  */
106
- export declare type ExtRecord<ExtType extends ExtensionType> = Record<string, ExtManifest<ExtType>>;
106
+ export type ExtRecord<ExtType extends ExtensionType> = Record<string, ExtManifest<ExtType>>;
107
107
  /**
108
108
  * The shape of the `extensions.yaml` file
109
109
  */
@@ -116,7 +116,7 @@ export interface ManifestData {
116
116
  * The name of an installed extension, as it appears in `extensions.yaml`
117
117
  * (as a property name under `drivers` or `plugins`)
118
118
  */
119
- export declare type ExtName<ExtType extends ExtensionType> = keyof ExtRecord<ExtType>;
119
+ export type ExtName<ExtType extends ExtensionType> = keyof ExtRecord<ExtType>;
120
120
  /**
121
121
  * A `package.json` containing extension metadata.
122
122
  * Must have the following properties:
@@ -125,7 +125,7 @@ export declare type ExtName<ExtType extends ExtensionType> = keyof ExtRecord<Ext
125
125
  * - `appium`: the metadata for the extension
126
126
  * - `peerDependencies.appium`: the maximum compatible version of Appium
127
127
  */
128
- export declare type ExtPackageJson<ExtType extends ExtensionType> = SetRequired<PackageJson, 'name' | 'version'> & {
128
+ export type ExtPackageJson<ExtType extends ExtensionType> = SetRequired<PackageJson, 'name' | 'version'> & {
129
129
  appium: ExtMetadata<ExtType>;
130
130
  peerDependencies: {
131
131
  appium: string;
@@ -135,5 +135,5 @@ export declare type ExtPackageJson<ExtType extends ExtensionType> = SetRequired<
135
135
  /**
136
136
  * A transient format between installation and insertion of extension metadata into the manifest.
137
137
  */
138
- export declare type ExtInstallReceipt<ExtType extends ExtensionType> = ExtMetadata<ExtType> & InternalMetadata;
138
+ export type ExtInstallReceipt<ExtType extends ExtensionType> = ExtMetadata<ExtType> & InternalMetadata;
139
139
  //# sourceMappingURL=v3.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"v3.d.ts","sourceRoot":"","sources":["../../../types/manifest/v3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,aAAa,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AACpE,OAAO,EAAC,YAAY,EAAC,MAAM,KAAK,CAAC;AACjC,OAAO,EAAC,WAAW,EAAE,WAAW,EAAC,MAAM,WAAW,CAAC;AAEnD;;GAEG;AACH,oBAAY,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE7D,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,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,WAAW,YAAY;IAC3B,OAAO,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IAC/B,OAAO,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,MAAM,OAAO,CAAC,OAAO,SAAS,aAAa,IAAI,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC;AAE9E;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,aAAa,IAAI,WAAW,CACrE,WAAW,EACX,MAAM,GAAG,SAAS,CACnB,GAAG;IACF,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7B,gBAAgB,EAAE;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAC,CAAC;CAC3D,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,OAAO,SAAS,aAAa,IAAI,WAAW,CAAC,OAAO,CAAC,GACjF,gBAAgB,CAAC"}
package/lib/appium.js CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  DELETE_SESSION_COMMAND,
11
11
  GET_STATUS_COMMAND,
12
12
  promoteAppiumOptions,
13
+ promoteAppiumOptionsForObject,
13
14
  } from '@appium/base-driver';
14
15
  import AsyncLock from 'async-lock';
15
16
  import {parseCapsForInnerDriver, pullSettings} from './utils';
@@ -44,7 +45,7 @@ class AppiumDriver extends DriverCore {
44
45
  * It is not recommended to access this property directly from the outside
45
46
  * @type {Record<string,ExternalDriver>}
46
47
  */
47
- sessions = {};
48
+ sessions;
48
49
 
49
50
  /**
50
51
  * Access to pending drivers list must be guarded with a Semaphore, because
@@ -52,14 +53,14 @@ class AppiumDriver extends DriverCore {
52
53
  * It is not recommended to access this property directly from the outside
53
54
  * @type {Record<string,ExternalDriver[]>}
54
55
  */
55
- pendingDrivers = {};
56
+ pendingDrivers;
56
57
 
57
58
  /**
58
59
  * Note that {@linkcode AppiumDriver} has no `newCommandTimeout` method.
59
60
  * `AppiumDriver` does not set and observe its own timeouts; individual
60
61
  * sessions (managed drivers) do instead.
61
62
  */
62
- newCommandTimeoutMs = 0;
63
+ newCommandTimeoutMs;
63
64
 
64
65
  /**
65
66
  * List of active plugins
@@ -71,13 +72,13 @@ class AppiumDriver extends DriverCore {
71
72
  * map of sessions to actual plugin instances per session
72
73
  * @type {Record<string,InstanceType<PluginClass>[]>}
73
74
  */
74
- sessionPlugins = {};
75
+ sessionPlugins;
75
76
 
76
77
  /**
77
78
  * some commands are sessionless, so we need a set of plugins for them
78
79
  * @type {InstanceType<PluginClass>[]}
79
80
  */
80
- sessionlessPlugins = [];
81
+ sessionlessPlugins;
81
82
 
82
83
  /** @type {DriverConfig} */
83
84
  driverConfig;
@@ -85,7 +86,11 @@ class AppiumDriver extends DriverCore {
85
86
  /** @type {AppiumServer} */
86
87
  server;
87
88
 
88
- desiredCapConstraints = desiredCapabilityConstraints;
89
+ /**
90
+ * @type {AppiumDriverConstraints}
91
+ * @readonly
92
+ */
93
+ desiredCapConstraints;
89
94
 
90
95
  /** @type {DriverOpts} */
91
96
  args;
@@ -105,6 +110,13 @@ class AppiumDriver extends DriverCore {
105
110
  super(opts);
106
111
 
107
112
  this.args = {...opts};
113
+ this.sessions = {};
114
+ this.pendingDrivers = {};
115
+ this.newCommandTimeoutMs = 0;
116
+ this.pluginClasses = new Map();
117
+ this.sessionPlugins = {};
118
+ this.sessionlessPlugins = [];
119
+ this.desiredCapConstraints = desiredCapabilityConstraints;
108
120
 
109
121
  // allow this to happen in the background, so no `await`
110
122
  (async () => {
@@ -243,7 +255,7 @@ class AppiumDriver extends DriverCore {
243
255
  jsonwpCaps,
244
256
  promoteAppiumOptions(w3cCapabilities),
245
257
  this.desiredCapConstraints,
246
- defaultCapabilities
258
+ defaultCapabilities ? promoteAppiumOptionsForObject(defaultCapabilities) : undefined
247
259
  );
248
260
 
249
261
  const {desiredCaps, processedJsonwpCapabilities, processedW3CCapabilities} =
@@ -277,7 +289,7 @@ class AppiumDriver extends DriverCore {
277
289
  */
278
290
  let otherPendingDriversData = [];
279
291
 
280
- const driverInstance = new InnerDriver(this.args, true);
292
+ const driverInstance = /** @type {ExternalDriver} */ (new InnerDriver(this.args, true));
281
293
 
282
294
  // We want to assign security values directly on the driver. The driver
283
295
  // should not read security values from `this.opts` because those values
@@ -58,7 +58,12 @@ export default class DriverCommand extends ExtensionCommand {
58
58
  * @return {Promise<import('./extension-command').RunOutput>}
59
59
  */
60
60
  async run({driver, scriptName, extraArgs}) {
61
- return await super._run({installSpec: driver, scriptName, extraArgs});
61
+ return await super._run({
62
+ installSpec: driver,
63
+ scriptName,
64
+ extraArgs,
65
+ bufferOutput: this.isJsonOutput,
66
+ });
62
67
  }
63
68
 
64
69
  /**
@@ -4,14 +4,15 @@ import _ from 'lodash';
4
4
  import path from 'path';
5
5
  import {npm, util, env, console} from '@appium/support';
6
6
  import {spinWith, RingBuffer} from './utils';
7
- import {SubProcess} from 'teen_process';
8
7
  import {
9
8
  INSTALL_TYPE_NPM,
10
9
  INSTALL_TYPE_GIT,
11
10
  INSTALL_TYPE_GITHUB,
12
11
  INSTALL_TYPE_LOCAL,
13
12
  } from '../extension/extension-config';
13
+ import {SubProcess} from 'teen_process';
14
14
  import {packageDidChange} from '../extension/package-changed';
15
+ import {spawn} from 'child_process';
15
16
 
16
17
  const UPDATE_ALL = 'installed';
17
18
 
@@ -660,17 +661,34 @@ class ExtensionCommand {
660
661
  }
661
662
 
662
663
  /**
663
- * Runs a script cached inside the "scripts" field under "appium"
664
- * inside of the driver/plugins "package.json" file. Will throw
665
- * an error if the driver/plugin does not contain a "scripts" field
666
- * underneath the "appium" field in its package.json, if the
667
- * "scripts" field is not a plain object, or if the scriptName is
668
- * not found within "scripts" object.
664
+ * Just wraps {@linkcode child_process.spawn} with some default options
665
+ *
666
+ * @param {string} cwd - CWD
667
+ * @param {string} script - Path to script
668
+ * @param {string[]} args - Extra args for script
669
+ * @param {import('child_process').SpawnOptions} opts - Options
670
+ * @returns {import('node:child_process').ChildProcess}
671
+ */
672
+ _runUnbuffered(cwd, script, args = [], opts = {}) {
673
+ return spawn(process.execPath, [script, ...args], {
674
+ cwd,
675
+ stdio: 'inherit',
676
+ ...opts,
677
+ });
678
+ }
679
+
680
+ /**
681
+ * Runs a script cached inside the `scripts` field under `appium`
682
+ * inside of the extension's `package.json` file. Will throw
683
+ * an error if the driver/plugin does not contain a `scripts` field
684
+ * underneath the `appium` field in its `package.json`, if the
685
+ * `scripts` field is not a plain object, or if the `scriptName` is
686
+ * not found within `scripts` object.
669
687
  *
670
688
  * @param {RunOptions} opts
671
689
  * @return {Promise<RunOutput>}
672
690
  */
673
- async _run({installSpec, scriptName, extraArgs = []}) {
691
+ async _run({installSpec, scriptName, extraArgs = [], bufferOutput = false}) {
674
692
  if (!this.config.isInstalled(installSpec)) {
675
693
  throw this._createFatalError(`The ${this.type} "${installSpec}" is not installed`);
676
694
  }
@@ -693,32 +711,62 @@ class ExtensionCommand {
693
711
  );
694
712
  }
695
713
 
696
- if (!(scriptName in extScripts)) {
714
+ if (!(scriptName in /** @type {Record<string,string>} */ (extScripts))) {
697
715
  throw this._createFatalError(
698
716
  `The ${this.type} named '${installSpec}' does not support the script: '${scriptName}'`
699
717
  );
700
718
  }
701
719
 
702
- const runner = new SubProcess(process.execPath, [extScripts[scriptName], ...extraArgs], {
703
- cwd: this.config.getInstallPath(installSpec),
704
- });
720
+ if (bufferOutput) {
721
+ const runner = new SubProcess(process.execPath, [extScripts[scriptName], ...extraArgs], {
722
+ cwd: this.config.getInstallPath(installSpec),
723
+ });
705
724
 
706
- const output = new RingBuffer(50);
725
+ const output = new RingBuffer(50);
707
726
 
708
- runner.on('stream-line', (line) => {
709
- output.enqueue(line);
710
- this.log.log(line);
711
- });
727
+ runner.on('stream-line', (line) => {
728
+ output.enqueue(line);
729
+ this.log.log(line);
730
+ });
712
731
 
713
- await runner.start(0);
732
+ await runner.start(0);
733
+
734
+ try {
735
+ await runner.join();
736
+ this.log.ok(`${scriptName} successfully ran`.green);
737
+ return {output: output.getBuff()};
738
+ } catch (err) {
739
+ this.log.error(`Encountered an error when running '${scriptName}': ${err.message}`.red);
740
+ return {error: err.message, output: output.getBuff()};
741
+ }
742
+ }
714
743
 
715
744
  try {
716
- await runner.join();
745
+ await new B((resolve, reject) => {
746
+ this._runUnbuffered(
747
+ this.config.getInstallPath(installSpec),
748
+ extScripts[scriptName],
749
+ extraArgs
750
+ )
751
+ .on('error', (err) => {
752
+ // generally this is of the "I can't find the script" variety.
753
+ // this is a developer bug: the extension is pointing to a script that is not where the
754
+ // developer said it would be (in `appium.scripts` of the extension's `package.json`)
755
+ reject(err);
756
+ })
757
+ .on('close', (code) => {
758
+ if (code === 0) {
759
+ resolve();
760
+ } else {
761
+ reject(new Error(`Script "${scriptName}" exited with code ${code}`));
762
+ }
763
+ });
764
+ });
717
765
  this.log.ok(`${scriptName} successfully ran`.green);
718
- return {output: output.getBuff()};
766
+ return {};
719
767
  } catch (err) {
720
768
  this.log.error(`Encountered an error when running '${scriptName}': ${err.message}`.red);
721
- return {error: err.message, output: output.getBuff()};
769
+ return {error: err.message};
722
770
  }
723
771
  }
724
772
  }
@@ -802,6 +850,7 @@ export {ExtensionCommand};
802
850
  * @property {string} installSpec - name of the extension to run a script from
803
851
  * @property {string} scriptName - name of the script to run
804
852
  * @property {string[]} [extraArgs] - arguments to pass to the script
853
+ * @property {boolean} [bufferOutput] - if true, will buffer the output of the script and return it
805
854
  */
806
855
 
807
856
  /**
@@ -809,7 +858,7 @@ export {ExtensionCommand};
809
858
  *
810
859
  * @typedef RunOutput
811
860
  * @property {string} [error] - error message if script ran unsuccessfully, otherwise undefined
812
- * @property {string[]} output - script output
861
+ * @property {string[]} [output] - script output if `bufferOutput` was `true` in {@linkcode RunOptions}
813
862
  */
814
863
 
815
864
  /**
@@ -57,7 +57,12 @@ export default class PluginCommand extends ExtensionCommand {
57
57
  * @returns {Promise<import('./extension-command').RunOutput>}
58
58
  */
59
59
  async run({plugin, scriptName, extraArgs}) {
60
- return await super._run({installSpec: plugin, scriptName, extraArgs});
60
+ return await super._run({
61
+ installSpec: plugin,
62
+ scriptName,
63
+ extraArgs,
64
+ bufferOutput: this.isJsonOutput,
65
+ });
61
66
  }
62
67
 
63
68
  /**
package/lib/config.js CHANGED
@@ -10,8 +10,9 @@ import {getDefaultsForSchema, getAllArgSpecs} from './schema/schema';
10
10
  const npmPackage = fs.readPackageJsonFrom(__dirname);
11
11
 
12
12
  const APPIUM_VER = npmPackage.version;
13
- const MIN_NODE_VERSION = npmPackage.engines.node;
14
- const MIN_NPM_VERSION = npmPackage.engines.npm;
13
+ const ENGINES = /** @type {Record<string,string>} */ (npmPackage.engines);
14
+ const MIN_NODE_VERSION = ENGINES.node;
15
+ const MIN_NPM_VERSION = ENGINES.npm;
15
16
 
16
17
  const GIT_META_ROOT = '.git';
17
18
  const GIT_BINARY = `git${system.isWindows() ? '.exe' : ''}`;
@@ -435,7 +435,7 @@ export class ExtensionConfig {
435
435
  /**
436
436
  * @param {string} extName
437
437
  * @param {ExtManifest<ExtType>} extManifest
438
- * @param {ExtensionConfigMutationOpts} [opts]
438
+ * @param {ExtensionConfigMutationOpts} opts
439
439
  * @returns {Promise<void>}
440
440
  */
441
441
  async addExtension(extName, extManifest, {write = true} = {}) {
@@ -448,7 +448,7 @@ export class ExtensionConfig {
448
448
  /**
449
449
  * @param {ExtName<ExtType>} extName
450
450
  * @param {ExtManifest<ExtType>} extManifest
451
- * @param {ExtensionConfigMutationOpts} [opts]
451
+ * @param {ExtensionConfigMutationOpts} opts
452
452
  * @returns {Promise<void>}
453
453
  */
454
454
  async updateExtension(extName, extManifest, {write = true} = {}) {
@@ -465,7 +465,7 @@ export class ExtensionConfig {
465
465
  * Remove an extension from the list of installed extensions, and optionally avoid a write to the manifest file.
466
466
  *
467
467
  * @param {ExtName<ExtType>} extName
468
- * @param {ExtensionConfigMutationOpts} [opts]
468
+ * @param {ExtensionConfigMutationOpts} opts
469
469
  * @returns {Promise<void>}
470
470
  */
471
471
  async removeExtension(extName, {write = true} = {}) {
@@ -94,7 +94,7 @@ export class ArgSpec {
94
94
  * The _constructor_ is private. Use {@link ArgSpec.create} instead.
95
95
  * @private
96
96
  * @param {string} name
97
- * @param {ArgSpecOptions<D>} [opts]
97
+ * @param {ArgSpecOptions<D>} opts
98
98
  */
99
99
  constructor(name, {extType, extName, dest, defaultValue} = {}) {
100
100
  // we must normalize the extension name to fit into our convention for CLI