appium 2.5.3 → 2.6.0
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/cli/args.d.ts.map +1 -1
- package/build/lib/cli/args.js +10 -0
- package/build/lib/cli/args.js.map +1 -1
- package/build/lib/cli/parser.d.ts +5 -0
- package/build/lib/cli/parser.d.ts.map +1 -1
- package/build/lib/cli/parser.js +38 -1
- package/build/lib/cli/parser.js.map +1 -1
- package/build/lib/cli/setup-command.d.ts +37 -0
- package/build/lib/cli/setup-command.d.ts.map +1 -0
- package/build/lib/cli/setup-command.js +173 -0
- package/build/lib/cli/setup-command.js.map +1 -0
- package/build/lib/config.d.ts +38 -18
- package/build/lib/config.d.ts.map +1 -1
- package/build/lib/config.js +75 -3
- package/build/lib/config.js.map +1 -1
- package/build/lib/constants.d.ts +21 -2
- package/build/lib/constants.d.ts.map +1 -1
- package/build/lib/constants.js +24 -7
- package/build/lib/constants.js.map +1 -1
- package/build/lib/grid-register.js +2 -2
- package/build/lib/grid-register.js.map +1 -1
- package/build/lib/logsink.d.ts.map +1 -1
- package/build/lib/logsink.js +23 -5
- package/build/lib/logsink.js.map +1 -1
- package/build/lib/main.d.ts +1 -0
- package/build/lib/main.d.ts.map +1 -1
- package/build/lib/main.js +15 -1
- package/build/lib/main.js.map +1 -1
- package/build/lib/utils.d.ts +12 -2
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +15 -3
- package/build/lib/utils.js.map +1 -1
- package/build/types/cli.d.ts +23 -6
- package/build/types/cli.d.ts.map +1 -1
- package/lib/cli/args.js +10 -0
- package/lib/cli/parser.js +52 -2
- package/lib/cli/setup-command.js +185 -0
- package/lib/config.js +81 -20
- package/lib/constants.js +31 -6
- package/lib/grid-register.js +2 -2
- package/lib/logsink.js +24 -5
- package/lib/main.js +17 -1
- package/lib/utils.js +15 -3
- package/package.json +14 -14
- package/types/cli.ts +33 -8
package/lib/utils.js
CHANGED
|
@@ -4,7 +4,7 @@ import {processCapabilities, PROTOCOLS, STANDARD_CAPS, errors} from '@appium/bas
|
|
|
4
4
|
import {inspect as dump} from 'util';
|
|
5
5
|
import {node, fs} from '@appium/support';
|
|
6
6
|
import path from 'path';
|
|
7
|
-
import {SERVER_SUBCOMMAND, DRIVER_TYPE, PLUGIN_TYPE} from './constants';
|
|
7
|
+
import {SERVER_SUBCOMMAND, DRIVER_TYPE, PLUGIN_TYPE, SETUP_SUBCOMMAND} from './constants';
|
|
8
8
|
import os from 'node:os';
|
|
9
9
|
|
|
10
10
|
const W3C_APPIUM_PREFIX = 'appium';
|
|
@@ -330,6 +330,16 @@ export function isServerCommandArgs(args) {
|
|
|
330
330
|
return args.subcommand === SERVER_SUBCOMMAND;
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
+
/**
|
|
334
|
+
* @template {CliCommand} Cmd
|
|
335
|
+
* @template {CliExtensionSubcommand|CliCommandSetupSubcommand|void} [SubCmd=void]
|
|
336
|
+
* @param {Args<Cmd, SubCmd>} args
|
|
337
|
+
* @returns {args is Args<SetupCommand>}
|
|
338
|
+
*/
|
|
339
|
+
export function isSetupCommandArgs(args) {
|
|
340
|
+
return args.subcommand === SETUP_SUBCOMMAND;
|
|
341
|
+
}
|
|
342
|
+
|
|
333
343
|
/**
|
|
334
344
|
* @template {CliCommand} [Cmd=ServerCommand]
|
|
335
345
|
* @template {CliExtensionSubcommand|void} [SubCmd=void]
|
|
@@ -451,19 +461,21 @@ export {
|
|
|
451
461
|
* @typedef {import('appium/types').CliCommand} CliCommand
|
|
452
462
|
* @typedef {import('appium/types').CliExtensionSubcommand} CliExtensionSubcommand
|
|
453
463
|
* @typedef {import('appium/types').CliExtensionCommand} CliExtensionCommand
|
|
464
|
+
* @typedef {import('appium/types').CliCommandSetupSubcommand} CliCommandSetupSubcommand
|
|
454
465
|
* @typedef {import('appium/types').CliCommandServer} ServerCommand
|
|
455
466
|
* @typedef {import('appium/types').CliCommandDriver} DriverCommand
|
|
456
467
|
* @typedef {import('appium/types').CliCommandPlugin} PluginCommand
|
|
468
|
+
* @typedef {import('appium/types').CliCommandSetup} SetupCommand
|
|
457
469
|
*/
|
|
458
470
|
|
|
459
471
|
/**
|
|
460
472
|
* @template {CliCommand} [Cmd=ServerCommand]
|
|
461
|
-
* @template {CliExtensionSubcommand|void} [SubCmd=void]
|
|
473
|
+
* @template {CliExtensionSubcommand|CliCommandSetupSubcommand|void} [SubCmd=void]
|
|
462
474
|
* @typedef {import('appium/types').Args<Cmd, SubCmd>} Args
|
|
463
475
|
*/
|
|
464
476
|
|
|
465
477
|
/**
|
|
466
478
|
* @template {CliCommand} [Cmd=ServerCommand]
|
|
467
|
-
* @template {CliExtensionSubcommand|void} [SubCmd=void]
|
|
479
|
+
* @template {CliExtensionSubcommand|CliCommandSetupSubcommand|void} [SubCmd=void]
|
|
468
480
|
* @typedef {import('appium/types').ParsedArgs<Cmd, SubCmd>} ParsedArgs
|
|
469
481
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appium",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Automation for Apps.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"automation",
|
|
@@ -60,12 +60,12 @@
|
|
|
60
60
|
"test:unit": "mocha \"./test/unit/**/*.spec.js\""
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@appium/base-driver": "^9.
|
|
64
|
-
"@appium/base-plugin": "^2.2.
|
|
65
|
-
"@appium/docutils": "^1.0.
|
|
63
|
+
"@appium/base-driver": "^9.7.0",
|
|
64
|
+
"@appium/base-plugin": "^2.2.32",
|
|
65
|
+
"@appium/docutils": "^1.0.8",
|
|
66
66
|
"@appium/schema": "~0.5.0",
|
|
67
|
-
"@appium/support": "^4.2.
|
|
68
|
-
"@appium/types": "^0.
|
|
67
|
+
"@appium/support": "^4.2.6",
|
|
68
|
+
"@appium/types": "^0.18.0",
|
|
69
69
|
"@sidvind/better-ajv-errors": "2.1.3",
|
|
70
70
|
"@types/argparse": "2.0.16",
|
|
71
71
|
"@types/bluebird": "3.5.42",
|
|
@@ -73,12 +73,12 @@
|
|
|
73
73
|
"@types/semver": "7.5.8",
|
|
74
74
|
"@types/teen_process": "2.0.4",
|
|
75
75
|
"@types/wrap-ansi": "3.0.0",
|
|
76
|
-
"ajv": "8.
|
|
76
|
+
"ajv": "8.14.0",
|
|
77
77
|
"ajv-formats": "3.0.1",
|
|
78
78
|
"argparse": "2.0.1",
|
|
79
79
|
"async-lock": "1.4.1",
|
|
80
80
|
"asyncbox": "3.0.0",
|
|
81
|
-
"axios": "1.
|
|
81
|
+
"axios": "1.7.2",
|
|
82
82
|
"bluebird": "3.7.2",
|
|
83
83
|
"cross-env": "7.0.3",
|
|
84
84
|
"lilconfig": "3.1.1",
|
|
@@ -87,14 +87,14 @@
|
|
|
87
87
|
"ora": "5.4.1",
|
|
88
88
|
"package-changed": "3.0.0",
|
|
89
89
|
"resolve-from": "5.0.0",
|
|
90
|
-
"semver": "7.6.
|
|
90
|
+
"semver": "7.6.2",
|
|
91
91
|
"source-map-support": "0.5.21",
|
|
92
|
-
"teen_process": "2.1.
|
|
93
|
-
"type-fest": "4.
|
|
92
|
+
"teen_process": "2.1.3",
|
|
93
|
+
"type-fest": "4.18.3",
|
|
94
94
|
"winston": "3.13.0",
|
|
95
95
|
"wrap-ansi": "7.0.0",
|
|
96
|
-
"ws": "8.
|
|
97
|
-
"yaml": "2.4.
|
|
96
|
+
"ws": "8.17.0",
|
|
97
|
+
"yaml": "2.4.2"
|
|
98
98
|
},
|
|
99
99
|
"engines": {
|
|
100
100
|
"node": "^14.17.0 || ^16.13.0 || >=18.0.0",
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
"publishConfig": {
|
|
104
104
|
"access": "public"
|
|
105
105
|
},
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "a4138c6ec9524594519f29938008500b7cdcc0b8"
|
|
107
107
|
}
|
package/types/cli.ts
CHANGED
|
@@ -2,6 +2,7 @@ import {DriverType, PluginType, ServerArgs} from '@appium/types';
|
|
|
2
2
|
import {SetOptional} from 'type-fest';
|
|
3
3
|
import {InstallType} from './manifest';
|
|
4
4
|
export type CliCommandServer = 'server';
|
|
5
|
+
export type CliCommandSetup = 'setup';
|
|
5
6
|
export type CliCommandDriver = DriverType;
|
|
6
7
|
export type CliCommandPlugin = PluginType;
|
|
7
8
|
|
|
@@ -13,7 +14,13 @@ export type CliExtensionCommand = CliCommandDriver | CliCommandPlugin;
|
|
|
13
14
|
/**
|
|
14
15
|
* Possible commands for the `appium` CLI.
|
|
15
16
|
*/
|
|
16
|
-
export type CliCommand = CliCommandServer | CliExtensionCommand;
|
|
17
|
+
export type CliCommand = CliCommandServer | CliExtensionCommand | CliCommandSetup;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Possible subcommands of {@linkcode CliCommandSetup}.
|
|
21
|
+
* The command name will be preset name to get drivers/plugins to be installed.
|
|
22
|
+
*/
|
|
23
|
+
export type CliCommandSetupSubcommand = 'mobile' | 'browser' | 'desktop';
|
|
17
24
|
|
|
18
25
|
/**
|
|
19
26
|
* Possible subcommands of {@linkcode CliCommandDriver} or
|
|
@@ -55,6 +62,11 @@ export interface MoreArgs {
|
|
|
55
62
|
*/
|
|
56
63
|
showConfig?: boolean;
|
|
57
64
|
|
|
65
|
+
/**
|
|
66
|
+
* If true, show the server debug info and exit
|
|
67
|
+
*/
|
|
68
|
+
showDebugInfo?: boolean;
|
|
69
|
+
|
|
58
70
|
/**
|
|
59
71
|
* If true, open a REPL
|
|
60
72
|
*/
|
|
@@ -62,7 +74,7 @@ export interface MoreArgs {
|
|
|
62
74
|
}
|
|
63
75
|
|
|
64
76
|
/**
|
|
65
|
-
* These arguments are
|
|
77
|
+
* These arguments are not necessarily supported by the CLI, but via programmatic usage / tests.
|
|
66
78
|
*/
|
|
67
79
|
export interface ProgrammaticArgs {
|
|
68
80
|
/**
|
|
@@ -93,6 +105,11 @@ export interface ProgrammaticArgs {
|
|
|
93
105
|
* If true, show config and exit
|
|
94
106
|
*/
|
|
95
107
|
showConfig?: boolean;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* If true, show debug info and exit
|
|
111
|
+
*/
|
|
112
|
+
showDebugInfo?: boolean;
|
|
96
113
|
}
|
|
97
114
|
|
|
98
115
|
export interface DriverExtArgs {
|
|
@@ -105,6 +122,10 @@ export interface PluginExtArgs {
|
|
|
105
122
|
plugin?: string;
|
|
106
123
|
}
|
|
107
124
|
|
|
125
|
+
export interface SetupArgs {
|
|
126
|
+
setupCommand?: CliCommandSetupSubcommand;
|
|
127
|
+
}
|
|
128
|
+
|
|
108
129
|
/**
|
|
109
130
|
* These are args which the user will specify if using an extension command
|
|
110
131
|
*/
|
|
@@ -132,9 +153,11 @@ export interface BaseExtArgs<Cmd extends CliExtensionCommand> {
|
|
|
132
153
|
*/
|
|
133
154
|
export type ExtArgs<
|
|
134
155
|
Cmd extends CliExtensionCommand,
|
|
135
|
-
SubCmd extends CliExtensionSubcommand
|
|
156
|
+
SubCmd extends CliExtensionSubcommand | CliCommandSetupSubcommand
|
|
136
157
|
> = BaseExtArgs<Cmd> &
|
|
137
|
-
(Cmd extends
|
|
158
|
+
(Cmd extends CliCommandSetup
|
|
159
|
+
? SetupArgs
|
|
160
|
+
: Cmd extends CliCommandDriver
|
|
138
161
|
? DriverExtArgs
|
|
139
162
|
: Cmd extends CliCommandPlugin
|
|
140
163
|
? PluginExtArgs
|
|
@@ -152,13 +175,15 @@ export type ExtArgs<
|
|
|
152
175
|
*/
|
|
153
176
|
export type CommonArgs<
|
|
154
177
|
Cmd extends CliCommand = CliCommandServer,
|
|
155
|
-
SubCmd extends CliExtensionSubcommand | void = void
|
|
178
|
+
SubCmd extends CliExtensionSubcommand | CliCommandSetupSubcommand | void = void
|
|
156
179
|
> = MoreArgs &
|
|
157
180
|
ProgrammaticArgs &
|
|
158
181
|
(Cmd extends CliCommandServer
|
|
159
182
|
? ServerArgs
|
|
183
|
+
: Cmd extends CliCommandSetup
|
|
184
|
+
? SetupArgs
|
|
160
185
|
: Cmd extends CliExtensionCommand
|
|
161
|
-
? SubCmd extends CliExtensionSubcommand
|
|
186
|
+
? SubCmd extends CliExtensionSubcommand | CliCommandSetupSubcommand
|
|
162
187
|
? ExtArgs<Cmd, SubCmd>
|
|
163
188
|
: never
|
|
164
189
|
: never);
|
|
@@ -168,7 +193,7 @@ export type CommonArgs<
|
|
|
168
193
|
*/
|
|
169
194
|
export type ParsedArgs<
|
|
170
195
|
Cmd extends CliCommand = CliCommandServer,
|
|
171
|
-
SubCmd extends CliExtensionSubcommand | void = void
|
|
196
|
+
SubCmd extends CliExtensionSubcommand | CliCommandSetupSubcommand | void = void
|
|
172
197
|
> = CommonArgs<Cmd, SubCmd>;
|
|
173
198
|
|
|
174
199
|
/**
|
|
@@ -178,7 +203,7 @@ export type ParsedArgs<
|
|
|
178
203
|
*/
|
|
179
204
|
export type Args<
|
|
180
205
|
Cmd extends CliCommand = CliCommandServer,
|
|
181
|
-
SubCmd extends CliExtensionSubcommand | void = void
|
|
206
|
+
SubCmd extends CliExtensionSubcommand | CliCommandSetupSubcommand | void = void
|
|
182
207
|
> = Cmd extends CliCommandServer
|
|
183
208
|
? SetOptional<CommonArgs<Cmd>, keyof ServerArgs>
|
|
184
209
|
: ParsedArgs<Cmd, SubCmd>;
|