appium 3.2.2 → 3.3.1
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 +147 -205
- package/build/lib/appium.d.ts.map +1 -1
- package/build/lib/appium.js +169 -282
- package/build/lib/appium.js.map +1 -1
- package/build/lib/bidi-commands.d.ts.map +1 -1
- package/build/lib/bidi-commands.js +11 -11
- package/build/lib/bidi-commands.js.map +1 -1
- package/build/lib/bootstrap/appium-initializer.d.ts +21 -0
- package/build/lib/bootstrap/appium-initializer.d.ts.map +1 -0
- package/build/lib/bootstrap/appium-initializer.js +146 -0
- package/build/lib/bootstrap/appium-initializer.js.map +1 -0
- package/build/lib/bootstrap/appium-main-runner.d.ts +22 -0
- package/build/lib/bootstrap/appium-main-runner.d.ts.map +1 -0
- package/build/lib/bootstrap/appium-main-runner.js +109 -0
- package/build/lib/bootstrap/appium-main-runner.js.map +1 -0
- package/build/lib/bootstrap/config-file.d.ts +37 -0
- package/build/lib/bootstrap/config-file.d.ts.map +1 -0
- package/build/lib/{config-file.js → bootstrap/config-file.js} +62 -138
- package/build/lib/bootstrap/config-file.js.map +1 -0
- package/build/lib/bootstrap/grid-v3-register.d.ts +20 -0
- package/build/lib/bootstrap/grid-v3-register.d.ts.map +1 -0
- package/build/lib/bootstrap/grid-v3-register.js +185 -0
- package/build/lib/bootstrap/grid-v3-register.js.map +1 -0
- package/build/lib/bootstrap/init-types.d.ts +16 -0
- package/build/lib/bootstrap/init-types.d.ts.map +1 -0
- package/build/lib/bootstrap/init-types.js +3 -0
- package/build/lib/bootstrap/init-types.js.map +1 -0
- package/build/lib/bootstrap/main-helpers.d.ts +55 -0
- package/build/lib/bootstrap/main-helpers.d.ts.map +1 -0
- package/build/lib/bootstrap/main-helpers.js +187 -0
- package/build/lib/bootstrap/main-helpers.js.map +1 -0
- package/build/lib/bootstrap/node-helpers.d.ts +32 -0
- package/build/lib/bootstrap/node-helpers.d.ts.map +1 -0
- package/build/lib/bootstrap/node-helpers.js +201 -0
- package/build/lib/bootstrap/node-helpers.js.map +1 -0
- package/build/lib/bootstrap/startup-config.d.ts +22 -0
- package/build/lib/bootstrap/startup-config.d.ts.map +1 -0
- package/build/lib/bootstrap/startup-config.js +111 -0
- package/build/lib/bootstrap/startup-config.js.map +1 -0
- package/build/lib/cli/args.d.ts +16 -12
- package/build/lib/cli/args.d.ts.map +1 -1
- package/build/lib/cli/args.js +20 -40
- package/build/lib/cli/args.js.map +1 -1
- package/build/lib/cli/driver-command.d.ts +51 -93
- package/build/lib/cli/driver-command.d.ts.map +1 -1
- package/build/lib/cli/driver-command.js +11 -66
- package/build/lib/cli/driver-command.js.map +1 -1
- package/build/lib/cli/extension-command.d.ts +173 -377
- package/build/lib/cli/extension-command.d.ts.map +1 -1
- package/build/lib/cli/extension-command.js +387 -656
- package/build/lib/cli/extension-command.js.map +1 -1
- package/build/lib/cli/extension.d.ts +10 -15
- package/build/lib/cli/extension.d.ts.map +1 -1
- package/build/lib/cli/extension.js +15 -33
- package/build/lib/cli/extension.js.map +1 -1
- package/build/lib/cli/parser.d.ts +37 -66
- package/build/lib/cli/parser.d.ts.map +1 -1
- package/build/lib/cli/parser.js +69 -104
- package/build/lib/cli/parser.js.map +1 -1
- package/build/lib/cli/plugin-command.d.ts +50 -90
- package/build/lib/cli/plugin-command.d.ts.map +1 -1
- package/build/lib/cli/plugin-command.js +11 -63
- package/build/lib/cli/plugin-command.js.map +1 -1
- package/build/lib/cli/setup-command.d.ts +21 -26
- package/build/lib/cli/setup-command.d.ts.map +1 -1
- package/build/lib/cli/setup-command.js +19 -61
- package/build/lib/cli/setup-command.js.map +1 -1
- package/build/lib/cli/utils.d.ts +33 -35
- package/build/lib/cli/utils.d.ts.map +1 -1
- package/build/lib/cli/utils.js +48 -50
- package/build/lib/cli/utils.js.map +1 -1
- package/build/lib/constants.d.ts +23 -23
- package/build/lib/constants.d.ts.map +1 -1
- package/build/lib/constants.js +10 -15
- package/build/lib/constants.js.map +1 -1
- package/build/lib/doctor/doctor.d.ts +40 -57
- package/build/lib/doctor/doctor.d.ts.map +1 -1
- package/build/lib/doctor/doctor.js +31 -62
- package/build/lib/doctor/doctor.js.map +1 -1
- package/build/lib/extension/driver-config.d.ts +18 -77
- package/build/lib/extension/driver-config.d.ts.map +1 -1
- package/build/lib/extension/driver-config.js +37 -125
- package/build/lib/extension/driver-config.js.map +1 -1
- package/build/lib/extension/extension-config.d.ts +103 -210
- package/build/lib/extension/extension-config.d.ts.map +1 -1
- package/build/lib/extension/extension-config.js +180 -342
- package/build/lib/extension/extension-config.js.map +1 -1
- package/build/lib/extension/index.d.ts +12 -29
- package/build/lib/extension/index.d.ts.map +1 -1
- package/build/lib/extension/index.js +33 -75
- package/build/lib/extension/index.js.map +1 -1
- package/build/lib/extension/manifest-migrations.d.ts +3 -20
- package/build/lib/extension/manifest-migrations.d.ts.map +1 -1
- package/build/lib/extension/manifest-migrations.js +20 -101
- package/build/lib/extension/manifest-migrations.js.map +1 -1
- package/build/lib/extension/manifest.d.ts +61 -107
- package/build/lib/extension/manifest.d.ts.map +1 -1
- package/build/lib/extension/manifest.js +181 -356
- package/build/lib/extension/manifest.js.map +1 -1
- package/build/lib/extension/package-changed.d.ts +1 -3
- package/build/lib/extension/package-changed.d.ts.map +1 -1
- package/build/lib/extension/package-changed.js +8 -15
- package/build/lib/extension/package-changed.js.map +1 -1
- package/build/lib/extension/plugin-config.d.ts +10 -52
- package/build/lib/extension/plugin-config.d.ts.map +1 -1
- package/build/lib/extension/plugin-config.js +11 -63
- package/build/lib/extension/plugin-config.js.map +1 -1
- package/build/lib/helpers/build.d.ts +22 -0
- package/build/lib/helpers/build.d.ts.map +1 -0
- package/build/lib/helpers/build.js +109 -0
- package/build/lib/helpers/build.js.map +1 -0
- package/build/lib/helpers/capability.d.ts +38 -0
- package/build/lib/helpers/capability.d.ts.map +1 -0
- package/build/lib/helpers/capability.js +128 -0
- package/build/lib/helpers/capability.js.map +1 -0
- package/build/lib/helpers/network.d.ts +14 -0
- package/build/lib/helpers/network.d.ts.map +1 -0
- package/build/lib/helpers/network.js +35 -0
- package/build/lib/helpers/network.js.map +1 -0
- package/build/lib/insecure-features.js +6 -6
- package/build/lib/insecure-features.js.map +1 -1
- package/build/lib/inspector-commands.d.ts +6 -0
- package/build/lib/inspector-commands.d.ts.map +1 -1
- package/build/lib/inspector-commands.js +6 -0
- package/build/lib/inspector-commands.js.map +1 -1
- package/build/lib/logger.d.ts +2 -3
- package/build/lib/logger.d.ts.map +1 -1
- package/build/lib/logger.js +2 -3
- package/build/lib/logger.js.map +1 -1
- package/build/lib/logsink.d.ts +13 -22
- package/build/lib/logsink.d.ts.map +1 -1
- package/build/lib/logsink.js +48 -103
- package/build/lib/logsink.js.map +1 -1
- package/build/lib/main.d.ts +15 -58
- package/build/lib/main.d.ts.map +1 -1
- package/build/lib/main.js +25 -425
- package/build/lib/main.js.map +1 -1
- package/build/lib/schema/arg-spec.d.ts +32 -107
- package/build/lib/schema/arg-spec.d.ts.map +1 -1
- package/build/lib/schema/arg-spec.js +11 -107
- package/build/lib/schema/arg-spec.js.map +1 -1
- package/build/lib/schema/cli-args-guards.d.ts +34 -0
- package/build/lib/schema/cli-args-guards.d.ts.map +1 -0
- package/build/lib/schema/cli-args-guards.js +49 -0
- package/build/lib/schema/cli-args-guards.js.map +1 -0
- package/build/lib/schema/cli-args.d.ts +3 -15
- package/build/lib/schema/cli-args.d.ts.map +1 -1
- package/build/lib/schema/cli-args.js +17 -107
- package/build/lib/schema/cli-args.js.map +1 -1
- package/build/lib/schema/cli-transformers.d.ts +15 -12
- package/build/lib/schema/cli-transformers.d.ts.map +1 -1
- package/build/lib/schema/cli-transformers.js +15 -45
- package/build/lib/schema/cli-transformers.js.map +1 -1
- package/build/lib/schema/format-errors.d.ts +28 -0
- package/build/lib/schema/format-errors.d.ts.map +1 -0
- package/build/lib/schema/format-errors.js +29 -0
- package/build/lib/schema/format-errors.js.map +1 -0
- package/build/lib/schema/index.d.ts +4 -2
- package/build/lib/schema/index.d.ts.map +1 -1
- package/build/lib/schema/index.js +2 -0
- package/build/lib/schema/index.js.map +1 -1
- package/build/lib/schema/keywords.d.ts +12 -20
- package/build/lib/schema/keywords.d.ts.map +1 -1
- package/build/lib/schema/keywords.js +6 -51
- package/build/lib/schema/keywords.js.map +1 -1
- package/build/lib/schema/schema.d.ts +106 -231
- package/build/lib/schema/schema.d.ts.map +1 -1
- package/build/lib/schema/schema.js +88 -358
- package/build/lib/schema/schema.js.map +1 -1
- package/build/lib/utils.d.ts +7 -267
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +10 -409
- package/build/lib/utils.js.map +1 -1
- package/lib/{appium.js → appium.ts} +297 -341
- package/lib/bidi-commands.ts +10 -14
- package/lib/bootstrap/appium-initializer.ts +212 -0
- package/lib/bootstrap/appium-main-runner.ts +172 -0
- package/lib/bootstrap/config-file.ts +178 -0
- package/lib/bootstrap/grid-v3-register.ts +250 -0
- package/lib/bootstrap/init-types.ts +31 -0
- package/lib/bootstrap/main-helpers.ts +223 -0
- package/lib/bootstrap/node-helpers.ts +180 -0
- package/lib/bootstrap/startup-config.ts +143 -0
- package/lib/cli/{args.js → args.ts} +45 -56
- package/lib/cli/driver-command.ts +122 -0
- package/lib/cli/{extension-command.js → extension-command.ts} +827 -906
- package/lib/cli/extension.ts +65 -0
- package/lib/cli/{parser.js → parser.ts} +93 -116
- package/lib/cli/plugin-command.ts +117 -0
- package/lib/cli/{setup-command.js → setup-command.ts} +59 -74
- package/lib/cli/utils.ts +97 -0
- package/lib/{constants.js → constants.ts} +30 -41
- package/lib/doctor/{doctor.js → doctor.ts} +82 -92
- package/lib/extension/driver-config.ts +165 -0
- package/lib/extension/{extension-config.js → extension-config.ts} +291 -405
- package/lib/extension/index.ts +143 -0
- package/lib/extension/manifest-migrations.ts +57 -0
- package/lib/extension/manifest.ts +369 -0
- package/lib/extension/{package-changed.js → package-changed.ts} +9 -18
- package/lib/extension/plugin-config.ts +62 -0
- package/lib/helpers/build.ts +111 -0
- package/lib/helpers/capability.ts +171 -0
- package/lib/helpers/network.ts +30 -0
- package/lib/insecure-features.ts +1 -1
- package/lib/inspector-commands.ts +6 -1
- package/lib/{logger.js → logger.ts} +1 -2
- package/lib/{logsink.js → logsink.ts} +91 -137
- package/lib/main.ts +60 -0
- package/lib/schema/arg-spec.ts +131 -0
- package/lib/schema/cli-args-guards.ts +67 -0
- package/lib/schema/cli-args.ts +171 -0
- package/lib/schema/cli-transformers.ts +83 -0
- package/lib/schema/format-errors.ts +43 -0
- package/lib/schema/index.ts +4 -0
- package/lib/schema/keywords.ts +96 -0
- package/lib/schema/schema.ts +448 -0
- package/lib/utils.ts +73 -0
- package/package.json +17 -18
- package/scripts/autoinstall-extensions.js +3 -0
- package/build/lib/config-file.d.ts +0 -100
- package/build/lib/config-file.d.ts.map +0 -1
- package/build/lib/config-file.js.map +0 -1
- package/build/lib/config.d.ts +0 -70
- package/build/lib/config.d.ts.map +0 -1
- package/build/lib/config.js +0 -390
- package/build/lib/config.js.map +0 -1
- package/build/lib/grid-register.d.ts +0 -10
- package/build/lib/grid-register.d.ts.map +0 -1
- package/build/lib/grid-register.js +0 -134
- package/build/lib/grid-register.js.map +0 -1
- package/lib/cli/driver-command.js +0 -174
- package/lib/cli/extension.js +0 -74
- package/lib/cli/plugin-command.js +0 -164
- package/lib/cli/utils.js +0 -91
- package/lib/config-file.js +0 -228
- package/lib/config.js +0 -389
- package/lib/extension/driver-config.js +0 -245
- package/lib/extension/index.js +0 -169
- package/lib/extension/manifest-migrations.js +0 -136
- package/lib/extension/manifest.js +0 -550
- package/lib/extension/plugin-config.js +0 -112
- package/lib/grid-register.js +0 -146
- package/lib/main.js +0 -545
- package/lib/schema/arg-spec.js +0 -229
- package/lib/schema/cli-args.js +0 -254
- package/lib/schema/cli-transformers.js +0 -113
- package/lib/schema/index.js +0 -2
- package/lib/schema/keywords.js +0 -136
- package/lib/schema/schema.js +0 -725
- package/lib/utils.js +0 -512
package/build/lib/constants.js
CHANGED
|
@@ -29,42 +29,37 @@ exports.USE_ALL_PLUGINS = 'all';
|
|
|
29
29
|
// The plugins in this list will be available to the CLI so users can just
|
|
30
30
|
// type 'appium plugin install 'name'', rather than having to specify the full
|
|
31
31
|
// npm package. I.e., these are the officially recognized plugins.
|
|
32
|
-
exports.KNOWN_PLUGINS = Object.freeze(
|
|
33
|
-
/** @type {const} */ ({
|
|
32
|
+
exports.KNOWN_PLUGINS = Object.freeze({
|
|
34
33
|
'execute-driver': '@appium/execute-driver-plugin',
|
|
35
34
|
images: '@appium/images-plugin',
|
|
36
35
|
inspector: 'appium-inspector-plugin',
|
|
37
36
|
'relaxed-caps': '@appium/relaxed-caps-plugin',
|
|
38
37
|
storage: '@appium/storage-plugin',
|
|
39
38
|
'universal-xml': '@appium/universal-xml-plugin',
|
|
40
|
-
})
|
|
41
|
-
exports.MOBILE_DRIVERS = Object.freeze(
|
|
42
|
-
/** @type {const} */ ({
|
|
39
|
+
});
|
|
40
|
+
exports.MOBILE_DRIVERS = Object.freeze({
|
|
43
41
|
uiautomator2: 'appium-uiautomator2-driver',
|
|
44
42
|
xcuitest: 'appium-xcuitest-driver',
|
|
45
43
|
espresso: 'appium-espresso-driver',
|
|
46
|
-
})
|
|
47
|
-
exports.DESKTOP_DRIVERS = Object.freeze(
|
|
48
|
-
/** @type {const} */ ({
|
|
44
|
+
});
|
|
45
|
+
exports.DESKTOP_DRIVERS = Object.freeze({
|
|
49
46
|
mac2: 'appium-mac2-driver',
|
|
50
47
|
windows: 'appium-windows-driver',
|
|
51
|
-
})
|
|
52
|
-
exports.DESKTOP_BROWSERS = Object.freeze(
|
|
53
|
-
/** @type {const} */ ({
|
|
48
|
+
});
|
|
49
|
+
exports.DESKTOP_BROWSERS = Object.freeze({
|
|
54
50
|
safari: 'appium-safari-driver',
|
|
55
51
|
gecko: 'appium-geckodriver',
|
|
56
52
|
chromium: 'appium-chromium-driver',
|
|
57
|
-
})
|
|
53
|
+
});
|
|
58
54
|
// This is a map of driver names to npm packages representing those drivers.
|
|
59
55
|
// The drivers in this list will be available to the CLI so users can just
|
|
60
56
|
// type 'appium driver install 'name'', rather than having to specify the full
|
|
61
57
|
// npm package. I.e., these are the officially recognized drivers.
|
|
62
|
-
exports.KNOWN_DRIVERS = Object.freeze(
|
|
63
|
-
/** @type {const} */ ({
|
|
58
|
+
exports.KNOWN_DRIVERS = Object.freeze({
|
|
64
59
|
...exports.MOBILE_DRIVERS,
|
|
65
60
|
...exports.DESKTOP_DRIVERS,
|
|
66
61
|
...exports.DESKTOP_BROWSERS,
|
|
67
|
-
})
|
|
62
|
+
});
|
|
68
63
|
/**
|
|
69
64
|
* Relative path to directory containing any Appium internal files
|
|
70
65
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../lib/constants.
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../lib/constants.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAE7B;;GAEG;AACU,QAAA,WAAW,GAAG,QAAQ,CAAC;AAEpC;;GAEG;AACU,QAAA,WAAW,GAAG,QAAQ,CAAC;AAEpC;;GAEG;AACU,QAAA,iBAAiB,GAAG,QAAQ,CAAC;AAE1C;;GAEG;AACU,QAAA,gBAAgB,GAAG,OAAO,CAAC;AAExC;;GAEG;AACU,QAAA,eAAe,GAAG,KAAK,CAAC;AAErC,4EAA4E;AAC5E,0EAA0E;AAC1E,8EAA8E;AAC9E,kEAAkE;AACrD,QAAA,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;IACzC,gBAAgB,EAAE,+BAA+B;IACjD,MAAM,EAAE,uBAAuB;IAC/B,SAAS,EAAE,yBAAyB;IACpC,cAAc,EAAE,6BAA6B;IAC7C,OAAO,EAAE,wBAAwB;IACjC,eAAe,EAAE,8BAA8B;CACvC,CAAC,CAAC;AAEC,QAAA,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1C,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,yBAAyB,GAAG,mBAAmB,CAAC"}
|
|
@@ -1,65 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import '@colors/colors';
|
|
2
|
+
import type { IDoctorCheck } from '@appium/types';
|
|
3
|
+
/**
|
|
4
|
+
* Process exit codes returned by {@link Doctor.run}.
|
|
5
|
+
*/
|
|
6
|
+
export declare const EXIT_CODE: Readonly<{
|
|
7
|
+
readonly SUCCESS: 0;
|
|
8
|
+
readonly HAS_MAJOR_ISSUES: 127;
|
|
4
9
|
}>;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
/** Exit code values produced by {@link Doctor.run}. */
|
|
11
|
+
export type DoctorExitCode = (typeof EXIT_CODE)[keyof typeof EXIT_CODE];
|
|
12
|
+
/**
|
|
13
|
+
* A failed check reported during {@link Doctor} diagnostics.
|
|
14
|
+
*/
|
|
15
|
+
export interface DoctorIssue {
|
|
16
|
+
/** The check that produced this issue. */
|
|
17
|
+
check: IDoctorCheck;
|
|
18
|
+
/** Colored message string as logged during diagnosis. */
|
|
19
|
+
error: string;
|
|
20
|
+
/** Set after a successful automatic fix attempt. */
|
|
21
|
+
fixed?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare class Doctor {
|
|
24
|
+
private readonly log;
|
|
25
|
+
private readonly checks;
|
|
26
|
+
private foundIssues;
|
|
27
|
+
constructor(checks?: IDoctorCheck[]);
|
|
28
|
+
private get issuesRequiredToFix();
|
|
29
|
+
private get issuesOptionalToFix();
|
|
19
30
|
/**
|
|
20
|
-
*
|
|
31
|
+
* Runs diagnostics, reports issues, attempts automatic fixes where supported, and returns an exit code.
|
|
32
|
+
*
|
|
33
|
+
* @returns {@link EXIT_CODE.SUCCESS} when there are no issues or all issues were resolved;
|
|
34
|
+
* {@link EXIT_CODE.HAS_MAJOR_ISSUES} when manual intervention is still required or fixes failed.
|
|
21
35
|
*/
|
|
22
|
-
|
|
36
|
+
run(): Promise<DoctorExitCode>;
|
|
23
37
|
/**
|
|
24
38
|
* The doctor shows the report
|
|
25
39
|
*/
|
|
26
|
-
diagnose
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
*/
|
|
34
|
-
runAutoFix(f: DoctorIssue): Promise<void>;
|
|
35
|
-
/**
|
|
36
|
-
* @returns {Promise<boolean>}
|
|
37
|
-
*/
|
|
38
|
-
runAutoFixes(): Promise<boolean>;
|
|
39
|
-
/**
|
|
40
|
-
* @returns {Promise<EXIT_CODE[keyof EXIT_CODE]>}
|
|
41
|
-
*/
|
|
42
|
-
run(): Promise<0 | 127>;
|
|
43
|
-
/**
|
|
44
|
-
* @param {DoctorCheckResult} result
|
|
45
|
-
* @param {DoctorCheck} check
|
|
46
|
-
* @returns {DoctorIssue?}
|
|
47
|
-
*/
|
|
48
|
-
toIssue(result: DoctorCheckResult, check: DoctorCheck): DoctorIssue | null;
|
|
49
|
-
/**
|
|
50
|
-
* @returns {string}
|
|
51
|
-
*/
|
|
52
|
-
buildFixMessage(): string;
|
|
53
|
-
/**
|
|
54
|
-
* @returns {boolean}
|
|
55
|
-
*/
|
|
56
|
-
reportSuccess(): boolean;
|
|
40
|
+
private diagnose;
|
|
41
|
+
private reportManualIssues;
|
|
42
|
+
private runAutoFix;
|
|
43
|
+
private runAutoFixes;
|
|
44
|
+
private toIssue;
|
|
45
|
+
private buildFixMessage;
|
|
46
|
+
private reportSuccess;
|
|
57
47
|
}
|
|
58
|
-
export type DoctorIssue = {
|
|
59
|
-
check: DoctorCheck;
|
|
60
|
-
error: string;
|
|
61
|
-
fixed?: boolean | undefined;
|
|
62
|
-
};
|
|
63
|
-
export type DoctorCheck = import("@appium/types").IDoctorCheck;
|
|
64
|
-
export type DoctorCheckResult = import("@appium/types").DoctorCheckResult;
|
|
65
48
|
//# sourceMappingURL=doctor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../lib/doctor/doctor.
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../lib/doctor/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAkC,YAAY,EAAC,MAAM,eAAe,CAAC;AAEjF;;GAEG;AACH,eAAO,MAAM,SAAS;;;EAGX,CAAC;AAEZ,uDAAuD;AACvD,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,0CAA0C;IAC1C,KAAK,EAAE,YAAY,CAAC;IACpB,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAe;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,OAAO,CAAC,WAAW,CAAgB;gBAEvB,MAAM,GAAE,YAAY,EAAO;IAWvC,OAAO,KAAK,mBAAmB,GAE9B;IAED,OAAO,KAAK,mBAAmB,GAE9B;IAED;;;;;OAKG;IACG,GAAG,IAAI,OAAO,CAAC,cAAc,CAAC;IAcpC;;OAEG;YACW,QAAQ;YAcR,kBAAkB;YAuDlB,UAAU;YA0BV,YAAY;IAkB1B,OAAO,CAAC,OAAO;IAgBf,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,aAAa;CAQtB"}
|
|
@@ -7,36 +7,52 @@ exports.Doctor = exports.EXIT_CODE = void 0;
|
|
|
7
7
|
require("@colors/colors");
|
|
8
8
|
const lodash_1 = __importDefault(require("lodash"));
|
|
9
9
|
const support_1 = require("@appium/support");
|
|
10
|
+
/**
|
|
11
|
+
* Process exit codes returned by {@link Doctor.run}.
|
|
12
|
+
*/
|
|
10
13
|
exports.EXIT_CODE = Object.freeze({
|
|
11
14
|
SUCCESS: 0,
|
|
12
15
|
HAS_MAJOR_ISSUES: 127,
|
|
13
16
|
});
|
|
14
17
|
class Doctor {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
log;
|
|
19
|
+
checks;
|
|
20
|
+
foundIssues;
|
|
18
21
|
constructor(checks = []) {
|
|
19
22
|
this.log = support_1.logger.getLogger('Doctor');
|
|
20
|
-
/** @type {DoctorCheck[]} */
|
|
21
23
|
this.checks = checks;
|
|
22
24
|
this.checks
|
|
23
25
|
.filter((c) => lodash_1.default.isNil(c.log))
|
|
24
|
-
.forEach((c) => {
|
|
25
|
-
|
|
26
|
+
.forEach((c) => {
|
|
27
|
+
c.log = this.log;
|
|
28
|
+
});
|
|
26
29
|
this.foundIssues = [];
|
|
27
30
|
}
|
|
28
|
-
/**
|
|
29
|
-
* @returns {DoctorIssue[]}
|
|
30
|
-
*/
|
|
31
31
|
get issuesRequiredToFix() {
|
|
32
32
|
return this.foundIssues.filter((f) => !f.check.isOptional());
|
|
33
33
|
}
|
|
34
|
-
/**
|
|
35
|
-
* @returns {DoctorIssue[]}
|
|
36
|
-
*/
|
|
37
34
|
get issuesOptionalToFix() {
|
|
38
35
|
return this.foundIssues.filter((f) => f.check.isOptional());
|
|
39
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Runs diagnostics, reports issues, attempts automatic fixes where supported, and returns an exit code.
|
|
39
|
+
*
|
|
40
|
+
* @returns {@link EXIT_CODE.SUCCESS} when there are no issues or all issues were resolved;
|
|
41
|
+
* {@link EXIT_CODE.HAS_MAJOR_ISSUES} when manual intervention is still required or fixes failed.
|
|
42
|
+
*/
|
|
43
|
+
async run() {
|
|
44
|
+
await this.diagnose();
|
|
45
|
+
if (this.reportSuccess()) {
|
|
46
|
+
return exports.EXIT_CODE.SUCCESS;
|
|
47
|
+
}
|
|
48
|
+
if (await this.reportManualIssues()) {
|
|
49
|
+
return exports.EXIT_CODE.HAS_MAJOR_ISSUES;
|
|
50
|
+
}
|
|
51
|
+
if (!(await this.runAutoFixes())) {
|
|
52
|
+
return exports.EXIT_CODE.HAS_MAJOR_ISSUES;
|
|
53
|
+
}
|
|
54
|
+
return exports.EXIT_CODE.SUCCESS;
|
|
55
|
+
}
|
|
40
56
|
/**
|
|
41
57
|
* The doctor shows the report
|
|
42
58
|
*/
|
|
@@ -53,9 +69,6 @@ class Doctor {
|
|
|
53
69
|
this.log.info(`### Diagnostic completed, ${this.buildFixMessage()}. ###`);
|
|
54
70
|
this.log.info('');
|
|
55
71
|
}
|
|
56
|
-
/**
|
|
57
|
-
* @returns {Promise<boolean>}
|
|
58
|
-
*/
|
|
59
72
|
async reportManualIssues() {
|
|
60
73
|
const manualIssues = lodash_1.default.filter(this.issuesRequiredToFix, (f) => !f.check.hasAutofix());
|
|
61
74
|
const manualIssuesOptional = lodash_1.default.filter(this.issuesOptionalToFix, (f) => !f.check.hasAutofix());
|
|
@@ -66,7 +79,6 @@ class Doctor {
|
|
|
66
79
|
for (const logMsg of headerLogs) {
|
|
67
80
|
this.log.info(logMsg);
|
|
68
81
|
}
|
|
69
|
-
/** @type {string[]} */
|
|
70
82
|
const fixMessages = [];
|
|
71
83
|
for (const issue of issues) {
|
|
72
84
|
let message;
|
|
@@ -102,16 +114,13 @@ class Doctor {
|
|
|
102
114
|
}
|
|
103
115
|
return false;
|
|
104
116
|
}
|
|
105
|
-
/**
|
|
106
|
-
* @param {DoctorIssue} f
|
|
107
|
-
*/
|
|
108
117
|
async runAutoFix(f) {
|
|
109
118
|
this.log.info(`### Fixing: ${f.error} ###`);
|
|
110
119
|
try {
|
|
111
120
|
await f.check.fix();
|
|
112
121
|
}
|
|
113
122
|
catch (err) {
|
|
114
|
-
if (err
|
|
123
|
+
if (err instanceof support_1.doctor.FixSkippedError) {
|
|
115
124
|
this.log.info(`### Skipped fix ###`);
|
|
116
125
|
return;
|
|
117
126
|
}
|
|
@@ -133,9 +142,6 @@ class Doctor {
|
|
|
133
142
|
this.log.info(`### Fix was applied but issue remains ###`);
|
|
134
143
|
}
|
|
135
144
|
}
|
|
136
|
-
/**
|
|
137
|
-
* @returns {Promise<boolean>}
|
|
138
|
-
*/
|
|
139
145
|
async runAutoFixes() {
|
|
140
146
|
const autoFixes = lodash_1.default.filter(this.foundIssues, (f) => f.check.hasAutofix());
|
|
141
147
|
for (const f of autoFixes) {
|
|
@@ -153,27 +159,6 @@ class Doctor {
|
|
|
153
159
|
this.log.info('');
|
|
154
160
|
return true;
|
|
155
161
|
}
|
|
156
|
-
/**
|
|
157
|
-
* @returns {Promise<EXIT_CODE[keyof EXIT_CODE]>}
|
|
158
|
-
*/
|
|
159
|
-
async run() {
|
|
160
|
-
await this.diagnose();
|
|
161
|
-
if (this.reportSuccess()) {
|
|
162
|
-
return exports.EXIT_CODE.SUCCESS;
|
|
163
|
-
}
|
|
164
|
-
if (await this.reportManualIssues()) {
|
|
165
|
-
return exports.EXIT_CODE.HAS_MAJOR_ISSUES;
|
|
166
|
-
}
|
|
167
|
-
if (!await this.runAutoFixes()) {
|
|
168
|
-
return exports.EXIT_CODE.HAS_MAJOR_ISSUES;
|
|
169
|
-
}
|
|
170
|
-
return exports.EXIT_CODE.SUCCESS;
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* @param {DoctorCheckResult} result
|
|
174
|
-
* @param {DoctorCheck} check
|
|
175
|
-
* @returns {DoctorIssue?}
|
|
176
|
-
*/
|
|
177
162
|
toIssue(result, check) {
|
|
178
163
|
if (result.ok) {
|
|
179
164
|
this.log.info(` ${'\u2714'.green} ${result.message}`);
|
|
@@ -188,16 +173,10 @@ class Doctor {
|
|
|
188
173
|
check,
|
|
189
174
|
};
|
|
190
175
|
}
|
|
191
|
-
/**
|
|
192
|
-
* @returns {string}
|
|
193
|
-
*/
|
|
194
176
|
buildFixMessage() {
|
|
195
|
-
return `${support_1.util.pluralize('required fix', this.issuesRequiredToFix.length, true)} needed, ` +
|
|
196
|
-
`${support_1.util.pluralize('optional fix', this.issuesOptionalToFix.length, true)} possible
|
|
177
|
+
return (`${support_1.util.pluralize('required fix', this.issuesRequiredToFix.length, true)} needed, ` +
|
|
178
|
+
`${support_1.util.pluralize('optional fix', this.issuesOptionalToFix.length, true)} possible`);
|
|
197
179
|
}
|
|
198
|
-
/**
|
|
199
|
-
* @returns {boolean}
|
|
200
|
-
*/
|
|
201
180
|
reportSuccess() {
|
|
202
181
|
if (this.issuesRequiredToFix.length === 0 && this.issuesOptionalToFix.length === 0) {
|
|
203
182
|
this.log.info('Everything looks good, bye!');
|
|
@@ -208,14 +187,4 @@ class Doctor {
|
|
|
208
187
|
}
|
|
209
188
|
}
|
|
210
189
|
exports.Doctor = Doctor;
|
|
211
|
-
/**
|
|
212
|
-
* @typedef DoctorIssue
|
|
213
|
-
* @property {DoctorCheck} check
|
|
214
|
-
* @property {string} error
|
|
215
|
-
* @property {boolean} [fixed]
|
|
216
|
-
*/
|
|
217
|
-
/**
|
|
218
|
-
* @typedef {import('@appium/types').IDoctorCheck} DoctorCheck
|
|
219
|
-
* @typedef {import('@appium/types').DoctorCheckResult} DoctorCheckResult
|
|
220
|
-
*/
|
|
221
190
|
//# sourceMappingURL=doctor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../../lib/doctor/doctor.
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../../lib/doctor/doctor.ts"],"names":[],"mappings":";;;;;;AAAA,0BAAwB;AACxB,oDAAuB;AACvB,6CAAqD;AAGrD;;GAEG;AACU,QAAA,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;IACrC,OAAO,EAAE,CAAC;IACV,gBAAgB,EAAE,GAAG;CACb,CAAC,CAA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AAO,EAAE,CAAC;QACzC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC5B,OAAO;YACL,KAAK,EAAE,YAAY;YACnB,KAAK;SACN,CAAC;IACJ,CAAC;IAEO,eAAe;QACrB,OAAO,CACL,GAAG,cAAI,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW;YACnF,GAAG,cAAI,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CACpF,CAAC;IACJ,CAAC;IAEO,aAAa;QACnB,IAAI,IAAI,CAAC,mBAAmB,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,mBAAmB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnF,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;YAC7C,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAClB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AA/LD,wBA+LC"}
|
|
@@ -1,82 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* A mapping of {@link Manifest} instances to {@link DriverConfig} instances.
|
|
7
|
-
*
|
|
8
|
-
* `Manifest` and `ExtensionConfig` have a one-to-many relationship; each `Manifest` should be associated with a `DriverConfig` and a `PluginConfig`; no more, no less.
|
|
9
|
-
*
|
|
10
|
-
* This variable tracks the `Manifest`-to-`DriverConfig` portion.
|
|
11
|
-
*
|
|
12
|
-
* @type {WeakMap<Manifest,DriverConfig>}
|
|
13
|
-
* @private
|
|
14
|
-
*/
|
|
15
|
-
private static _instances;
|
|
16
|
-
/**
|
|
17
|
-
* Creates a new {@link DriverConfig} instance for a {@link Manifest} instance.
|
|
18
|
-
*
|
|
19
|
-
* @param {Manifest} manifest
|
|
20
|
-
* @throws If `manifest` already associated with a `DriverConfig`
|
|
21
|
-
* @returns {DriverConfig}
|
|
22
|
-
*/
|
|
23
|
-
static create(manifest: Manifest): DriverConfig;
|
|
24
|
-
/**
|
|
25
|
-
* Returns a DriverConfig associated with a Manifest
|
|
26
|
-
* @param {Manifest} manifest
|
|
27
|
-
* @returns {DriverConfig|undefined}
|
|
28
|
-
*/
|
|
29
|
-
static getInstance(manifest: Manifest): DriverConfig | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Call {@link DriverConfig.create} instead.
|
|
32
|
-
* @private
|
|
33
|
-
* @param {import('./manifest').Manifest} manifest - Manifest instance
|
|
34
|
-
*/
|
|
35
|
-
private constructor();
|
|
36
|
-
/**
|
|
37
|
-
* A set of unique automation names used by drivers.
|
|
38
|
-
* @type {Set<string>}
|
|
39
|
-
*/
|
|
40
|
-
knownAutomationNames: Set<string>;
|
|
41
|
-
/**
|
|
42
|
-
* Checks extensions for problems
|
|
43
|
-
*/
|
|
44
|
-
validate(): Promise<import("./extension-config").ExtRecord<"driver">>;
|
|
45
|
-
/**
|
|
46
|
-
* @param {ExtManifest<DriverType>} extData
|
|
47
|
-
* @returns {import('./extension-config').ExtManifestProblem[]}
|
|
48
|
-
*/
|
|
49
|
-
getConfigProblems(extData: ExtManifest<DriverType>): import("./extension-config").ExtManifestProblem[];
|
|
50
|
-
/**
|
|
51
|
-
* Given capabilities, find a matching driver within the config. Load its class and return it along with version and driver name.
|
|
52
|
-
* @template {import('@appium/types').StringRecord} C
|
|
53
|
-
* @param {C} caps
|
|
54
|
-
* @returns {Promise<MatchedDriver>}
|
|
55
|
-
*/
|
|
56
|
-
findMatchingDriver<C extends import("@appium/types").StringRecord>({ automationName, platformName }: C): Promise<MatchedDriver>;
|
|
57
|
-
/**
|
|
58
|
-
* Given an automation name and platform name, find a suitable driver and return its extension data.
|
|
59
|
-
* @param {string} matchAutomationName
|
|
60
|
-
* @param {string} matchPlatformName
|
|
61
|
-
* @returns {ExtMetadata<DriverType> & import('appium/types').InternalMetadata & import('appium/types').CommonExtMetadata}
|
|
62
|
-
*/
|
|
63
|
-
_getDriverBySupport(matchAutomationName: string, matchPlatformName: string): ExtMetadata<DriverType> & import("appium/types").InternalMetadata & import("appium/types").CommonExtMetadata;
|
|
64
|
-
}
|
|
65
|
-
export type ExtMetadata<T extends ExtensionType> = import("appium/types").ExtMetadata<T>;
|
|
66
|
-
export type ExtManifest<T extends ExtensionType> = import("appium/types").ExtManifest<T>;
|
|
67
|
-
export type ExtensionType = import("@appium/types").ExtensionType;
|
|
68
|
-
export type ManifestData = import("appium/types").ManifestData;
|
|
69
|
-
export type DriverType = import("@appium/types").DriverType;
|
|
70
|
-
export type Manifest = import("./manifest").Manifest;
|
|
71
|
-
export type ExtRecord<T extends ExtensionType> = import("appium/types").ExtRecord<T>;
|
|
72
|
-
export type ExtName<T extends ExtensionType> = import("appium/types").ExtName<T>;
|
|
73
|
-
/**
|
|
74
|
-
* Return value of {@linkcode DriverConfig.findMatchingDriver}
|
|
75
|
-
*/
|
|
1
|
+
import type { DriverClass, DriverType, StringRecord } from '@appium/types';
|
|
2
|
+
import type { ExtManifest, ExtName, ExtRecord } from 'appium/types';
|
|
3
|
+
import type { ExtManifestProblem } from './extension-config';
|
|
4
|
+
import { ExtensionConfig } from './extension-config';
|
|
5
|
+
import type { Manifest } from './manifest';
|
|
76
6
|
export type MatchedDriver = {
|
|
77
|
-
driver:
|
|
7
|
+
driver: DriverClass;
|
|
78
8
|
version: string;
|
|
79
9
|
driverName: string;
|
|
80
10
|
};
|
|
81
|
-
|
|
11
|
+
export declare class DriverConfig extends ExtensionConfig<DriverType> {
|
|
12
|
+
private static readonly _instances;
|
|
13
|
+
private knownAutomationNames;
|
|
14
|
+
private constructor();
|
|
15
|
+
static create(manifest: Manifest): DriverConfig;
|
|
16
|
+
static getInstance(manifest: Manifest): DriverConfig | undefined;
|
|
17
|
+
validate(): Promise<ExtRecord<DriverType>>;
|
|
18
|
+
extensionDesc(driverName: ExtName<DriverType>, { version, automationName }: ExtManifest<DriverType>): string;
|
|
19
|
+
findMatchingDriver<C extends StringRecord>({ automationName, platformName, }: C): Promise<MatchedDriver>;
|
|
20
|
+
protected getConfigProblems(extManifest: ExtManifest<DriverType>, extName: string): ExtManifestProblem[];
|
|
21
|
+
private _getDriverBySupport;
|
|
22
|
+
}
|
|
82
23
|
//# sourceMappingURL=driver-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver-config.d.ts","sourceRoot":"","sources":["../../../lib/extension/driver-config.
|
|
1
|
+
{"version":3,"file":"driver-config.d.ts","sourceRoot":"","sources":["../../../lib/extension/driver-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,WAAW,EAAE,UAAU,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACzE,OAAO,KAAK,EAAC,WAAW,EAAE,OAAO,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AAGlE,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEzC,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,qBAAa,YAAa,SAAQ,eAAe,CAAC,UAAU,CAAC;IAC3D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAyC;IAC3E,OAAO,CAAC,oBAAoB,CAAqB;IAEjD,OAAO;IAIP,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY;IAW/C,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY,GAAG,SAAS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