appium 3.3.0 → 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} +9 -26
- 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/{grid-register.js → bootstrap/grid-v3-register.js} +28 -13
- 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.map +1 -1
- package/build/lib/cli/args.js +9 -9
- package/build/lib/cli/args.js.map +1 -1
- package/build/lib/cli/extension-command.d.ts +95 -95
- package/build/lib/cli/extension-command.d.ts.map +1 -1
- package/build/lib/cli/extension-command.js +18 -18
- package/build/lib/cli/extension-command.js.map +1 -1
- package/build/lib/cli/extension.d.ts +1 -1
- package/build/lib/cli/extension.d.ts.map +1 -1
- package/build/lib/cli/extension.js +5 -5
- package/build/lib/cli/extension.js.map +1 -1
- package/build/lib/cli/parser.d.ts +8 -8
- package/build/lib/cli/parser.d.ts.map +1 -1
- package/build/lib/cli/parser.js +49 -49
- package/build/lib/cli/parser.js.map +1 -1
- package/build/lib/cli/setup-command.js +6 -6
- package/build/lib/cli/setup-command.js.map +1 -1
- package/build/lib/cli/utils.d.ts +17 -17
- package/build/lib/cli/utils.d.ts.map +1 -1
- package/build/lib/cli/utils.js +29 -29
- package/build/lib/cli/utils.js.map +1 -1
- package/build/lib/doctor/doctor.d.ts +2 -2
- package/build/lib/doctor/doctor.d.ts.map +1 -1
- package/build/lib/doctor/doctor.js +6 -6
- 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/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/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.js +2 -2
- package/build/lib/schema/cli-args.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 +2 -0
- 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/schema.d.ts +15 -15
- package/build/lib/schema/schema.d.ts.map +1 -1
- package/build/lib/schema/schema.js +37 -37
- package/build/lib/schema/schema.js.map +1 -1
- package/build/lib/utils.d.ts +0 -81
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +1 -248
- 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/{config-file.ts → bootstrap/config-file.ts} +29 -63
- package/lib/{grid-register.ts → bootstrap/grid-v3-register.ts} +35 -35
- 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.ts +10 -10
- package/lib/cli/extension-command.ts +132 -132
- package/lib/cli/extension.ts +7 -7
- package/lib/cli/parser.ts +50 -50
- package/lib/cli/setup-command.ts +2 -2
- package/lib/cli/utils.ts +33 -33
- package/lib/doctor/doctor.ts +8 -8
- 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/main.ts +60 -0
- package/lib/schema/cli-args-guards.ts +67 -0
- package/lib/schema/cli-args.ts +1 -1
- package/lib/schema/format-errors.ts +43 -0
- package/lib/schema/index.ts +2 -0
- package/lib/schema/schema.ts +51 -52
- package/lib/utils.ts +0 -331
- package/package.json +12 -13
- package/scripts/autoinstall-extensions.js +3 -0
- package/build/lib/config-file.d.ts +0 -57
- 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 -68
- package/build/lib/config.d.ts.map +0 -1
- package/build/lib/config.js +0 -358
- package/build/lib/config.js.map +0 -1
- package/build/lib/grid-register.d.ts +0 -35
- package/build/lib/grid-register.d.ts.map +0 -1
- package/build/lib/grid-register.js.map +0 -1
- package/lib/config.ts +0 -377
- 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/main.js +0 -545
package/build/lib/appium.d.ts
CHANGED
|
@@ -1,47 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
code: Readonly<string>;
|
|
11
|
-
}
|
|
12
|
-
export type DriverData = import("@appium/types").DriverData;
|
|
13
|
-
export type DriverOpts = import("@appium/types").ServerArgs;
|
|
14
|
-
export type Constraints = import("@appium/types").Constraints;
|
|
15
|
-
export type AppiumServer = import("@appium/types").AppiumServer;
|
|
16
|
-
export type ExtensionType = import("@appium/types").ExtensionType;
|
|
17
|
-
export type DriverConfig = import("./extension/driver-config").DriverConfig;
|
|
18
|
-
export type PluginType = import("@appium/types").PluginType;
|
|
19
|
-
export type DriverType = import("@appium/types").DriverType;
|
|
20
|
-
export type StringRecord = import("@appium/types").StringRecord;
|
|
21
|
-
export type ExternalDriver = import("@appium/types").ExternalDriver;
|
|
22
|
-
export type PluginClass = import("@appium/types").PluginClass;
|
|
23
|
-
export type Plugin = import("@appium/types").Plugin;
|
|
24
|
-
export type ExtensionCore = import("@appium/base-driver").ExtensionCore;
|
|
25
|
-
export type DriverClass = import("@appium/types").DriverClass<import("@appium/types").Driver>;
|
|
26
|
-
export type AppiumSessionHandler = import("@appium/types").ISessionHandler<AppiumDriverConstraints, SessionHandlerCreateResult, SessionHandlerDeleteResult>;
|
|
27
|
-
export type SessionHandlerCreateResult = SessionHandlerResult<[innerSessionId: string, caps: import("@appium/types").DriverCaps<Constraints>, protocol: string | undefined]>;
|
|
28
|
-
export type Core<C extends Constraints> = import("@appium/types").Core<C>;
|
|
29
|
-
export type SessionHandlerDeleteResult = SessionHandlerResult<void>;
|
|
30
|
-
/**
|
|
31
|
-
* Used by {@linkcode AppiumDriver.createSession} and {@linkcode AppiumDriver.deleteSession} to describe
|
|
32
|
-
* result.
|
|
33
|
-
*/
|
|
34
|
-
export type SessionHandlerResult<V> = {
|
|
35
|
-
value?: V | undefined;
|
|
36
|
-
error?: Error | undefined;
|
|
37
|
-
protocol?: string | undefined;
|
|
38
|
-
};
|
|
39
|
-
export type AppiumDriverConstraints = typeof desiredCapabilityConstraints;
|
|
40
|
-
export type W3CAppiumDriverCaps = import("@appium/types").W3CDriverCaps<AppiumDriverConstraints>;
|
|
41
|
-
/**
|
|
42
|
-
* @extends {DriverCore<AppiumDriverConstraints>}
|
|
43
|
-
*/
|
|
44
|
-
export class AppiumDriver extends DriverCore<{
|
|
1
|
+
import type WebSocket from 'ws';
|
|
2
|
+
import type { AppiumServer, DriverCaps, DriverData, DriverOpts, ExternalDriver, Plugin, PluginClass, RouteMatcher, StringRecord, TimestampedMultiSessionData, W3CDriverCaps } from '@appium/types';
|
|
3
|
+
import { DriverCore } from '@appium/base-driver';
|
|
4
|
+
import * as bidiCommands from './bidi-commands';
|
|
5
|
+
import * as insecureFeatures from './insecure-features';
|
|
6
|
+
import * as inspectorCommands from './inspector-commands';
|
|
7
|
+
import type { DriverConfig } from './extension/driver-config';
|
|
8
|
+
declare const desiredCapabilityConstraints: {
|
|
45
9
|
readonly automationName: {
|
|
46
10
|
readonly presence: true;
|
|
47
11
|
readonly isString: true;
|
|
@@ -50,207 +14,185 @@ export class AppiumDriver extends DriverCore<{
|
|
|
50
14
|
readonly presence: true;
|
|
51
15
|
readonly isString: true;
|
|
52
16
|
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
sessionPlugins: Record<string,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
* @type {InstanceType<PluginClass>[]}
|
|
85
|
-
*/
|
|
86
|
-
sessionlessPlugins: InstanceType<PluginClass>[];
|
|
87
|
-
/** @type {DriverConfig} */
|
|
17
|
+
};
|
|
18
|
+
export type AppiumDriverConstraints = typeof desiredCapabilityConstraints;
|
|
19
|
+
export type W3CAppiumDriverCaps = W3CDriverCaps<AppiumDriverConstraints>;
|
|
20
|
+
/** Result shape for umbrella {@link AppiumDriver.createSession} / {@link AppiumDriver.deleteSession}. */
|
|
21
|
+
interface SessionHandlerResult<V = unknown> {
|
|
22
|
+
value?: V;
|
|
23
|
+
error?: Error;
|
|
24
|
+
protocol?: string;
|
|
25
|
+
}
|
|
26
|
+
type SessionHandlerCreateResult = SessionHandlerResult<[
|
|
27
|
+
string,
|
|
28
|
+
DriverCaps<AppiumDriverConstraints>,
|
|
29
|
+
string | undefined
|
|
30
|
+
]>;
|
|
31
|
+
type SessionHandlerDeleteResult = SessionHandlerResult<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Umbrella driver: owns the session table, loads platform drivers and plugins, and routes
|
|
34
|
+
* commands to the right session driver or plugin chain.
|
|
35
|
+
*/
|
|
36
|
+
export declare class AppiumDriver extends DriverCore<AppiumDriverConstraints> {
|
|
37
|
+
readonly sessions: Record<string, ExternalDriver>;
|
|
38
|
+
readonly pendingDrivers: Record<string, ExternalDriver[]>;
|
|
39
|
+
/**
|
|
40
|
+
* The umbrella driver does not observe its own command timeout; inner session drivers do.
|
|
41
|
+
*/
|
|
42
|
+
newCommandTimeoutMs: number;
|
|
43
|
+
/** Filled during server bootstrap; keep this map instance (do not reassign). */
|
|
44
|
+
readonly pluginClasses: Map<PluginClass, string>;
|
|
45
|
+
readonly sessionPlugins: Record<string, Plugin[]>;
|
|
46
|
+
sessionlessPlugins: Plugin[];
|
|
47
|
+
/** Set during server init before listen; tests may assign a mock after construction. */
|
|
88
48
|
driverConfig: DriverConfig;
|
|
89
|
-
/**
|
|
49
|
+
/** Set when the HTTP server is created in server bootstrap. */
|
|
90
50
|
server: AppiumServer;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
51
|
+
readonly bidiSockets: Record<string, WebSocket[]>;
|
|
52
|
+
readonly bidiProxyClients: Record<string, WebSocket>;
|
|
53
|
+
readonly desiredCapConstraints: {
|
|
54
|
+
readonly automationName: {
|
|
55
|
+
readonly presence: true;
|
|
56
|
+
readonly isString: true;
|
|
57
|
+
};
|
|
58
|
+
readonly platformName: {
|
|
59
|
+
readonly presence: true;
|
|
60
|
+
readonly isString: true;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
readonly args: DriverOpts<AppiumDriverConstraints>;
|
|
64
|
+
onBidiConnection: typeof bidiCommands.onBidiConnection;
|
|
65
|
+
onBidiMessage: typeof bidiCommands.onBidiMessage;
|
|
66
|
+
onBidiServerError: typeof bidiCommands.onBidiServerError;
|
|
67
|
+
cleanupBidiSockets: typeof bidiCommands.cleanupBidiSockets;
|
|
68
|
+
configureGlobalFeatures: typeof insecureFeatures.configureGlobalFeatures;
|
|
69
|
+
configureDriverFeatures: typeof insecureFeatures.configureDriverFeatures;
|
|
70
|
+
listCommands: typeof inspectorCommands.listCommands;
|
|
71
|
+
listExtensions: typeof inspectorCommands.listExtensions;
|
|
72
|
+
private _isShuttingDown;
|
|
95
73
|
/**
|
|
96
|
-
* @
|
|
97
|
-
|
|
74
|
+
* @param opts - CLI/server options (address, port, security, default capabilities, etc.)
|
|
75
|
+
*/
|
|
76
|
+
constructor(opts: DriverOpts<AppiumDriverConstraints>);
|
|
77
|
+
/** The umbrella driver does not queue commands; inner session drivers may. */
|
|
78
|
+
get isCommandsQueueEnabled(): boolean;
|
|
79
|
+
/** Whether a non-null session id is registered on this server. */
|
|
80
|
+
sessionExists(sessionId: string): boolean;
|
|
81
|
+
/** Active automation driver for the session, or `null` if unknown. */
|
|
82
|
+
driverForSession(sessionId: string): ExternalDriver | null;
|
|
83
|
+
/**
|
|
84
|
+
* WebDriver status payload (readiness message and build metadata).
|
|
85
|
+
* @see https://www.w3.org/TR/webdriver/#dfn-status
|
|
98
86
|
*/
|
|
99
|
-
readonly desiredCapConstraints: AppiumDriverConstraints;
|
|
100
|
-
/** @type {import('@appium/types').DriverOpts<AppiumDriverConstraints>} */
|
|
101
|
-
args: import("@appium/types").DriverOpts<AppiumDriverConstraints>;
|
|
102
|
-
_isShuttingDown: boolean;
|
|
103
|
-
sessionExists(sessionId: any): boolean;
|
|
104
|
-
driverForSession(sessionId: any): import("@appium/types").ExternalDriver<import("@appium/types").Constraints, string, import("@appium/types").StringRecord, import("@appium/types").StringRecord, import("@appium/types").DefaultCreateSessionResult<import("@appium/types").Constraints>, void, import("@appium/types").StringRecord>;
|
|
105
87
|
getStatus(): Promise<{
|
|
106
88
|
build: import("../types").BuildInfo;
|
|
107
89
|
ready: boolean;
|
|
108
90
|
message: string;
|
|
109
91
|
}>;
|
|
110
|
-
/**
|
|
111
|
-
* @param {string|null} reason An optional shutdown reason
|
|
112
|
-
*/
|
|
92
|
+
/** Marks the server as shutting down and ends all sessions (forced unexpected shutdown). */
|
|
113
93
|
shutdown(reason?: string | null): Promise<void>;
|
|
114
94
|
/**
|
|
115
95
|
* Retrieve information about all active sessions.
|
|
116
96
|
* Results are returned only if the `session_discovery` insecure feature is enabled.
|
|
117
|
-
* @returns {Promise<import('@appium/types').TimestampedMultiSessionData[]>}
|
|
118
97
|
*/
|
|
119
|
-
getAppiumSessions(): Promise<
|
|
120
|
-
|
|
98
|
+
getAppiumSessions(): Promise<TimestampedMultiSessionData[]>;
|
|
99
|
+
/** Logs BaseDriver version lines when starting a new inner-driver session. */
|
|
100
|
+
printNewSessionAnnouncement(driverName: string, driverVersion?: string, driverBaseVersion?: string): void;
|
|
121
101
|
/**
|
|
122
|
-
*
|
|
123
|
-
* @param {string} extName - Plugin name
|
|
124
|
-
* @returns {StringRecord} Arguments object. If none, an empty object.
|
|
102
|
+
* CLI arguments object for a plugin (from server config). Empty object if none were passed.
|
|
125
103
|
*/
|
|
126
104
|
getCliArgsForPlugin(extName: string): StringRecord;
|
|
127
105
|
/**
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
* _Note that this behavior currently (May 18 2022) differs from how plugins are handled_ (see {@linkcode AppiumDriver.getCliArgsForPlugin}).
|
|
133
|
-
* @param {string} extName - Driver name
|
|
134
|
-
* @returns {StringRecord|undefined} Arguments object. If none, `undefined`
|
|
106
|
+
* CLI arguments for a driver, omitting keys that match schema defaults (unlike
|
|
107
|
+
* {@link AppiumDriver.getCliArgsForPlugin}, which returns defaults explicitly). `undefined` if
|
|
108
|
+
* there is nothing to pass after omitting defaults.
|
|
135
109
|
*/
|
|
136
110
|
getCliArgsForDriver(extName: string): StringRecord | undefined;
|
|
137
111
|
/**
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
* @param {W3CAppiumDriverCaps} [w3cCapabilities2] W3C capabilities (legacy)
|
|
142
|
-
* @param {W3CAppiumDriverCaps} [w3cCapabilities3] W3C capabilities (legacy)
|
|
143
|
-
* @returns {Promise<SessionHandlerCreateResult>}
|
|
112
|
+
* Creates a session: picks an inner driver from caps, runs plugin hooks, and returns a protocol
|
|
113
|
+
* envelope with either `[sessionId, caps, protocol]` or an error. Legacy call sites may pass the
|
|
114
|
+
* same W3C caps in up to three positions; the first W3C-shaped value wins.
|
|
144
115
|
*/
|
|
145
116
|
createSession(w3cCapabilities1: W3CAppiumDriverCaps, w3cCapabilities2?: W3CAppiumDriverCaps, w3cCapabilities3?: W3CAppiumDriverCaps): Promise<SessionHandlerCreateResult>;
|
|
146
117
|
/**
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
* @param {string} innerSessionId
|
|
118
|
+
* Subscribes to the inner driver’s unexpected-shutdown hook so Appium can drop the session and
|
|
119
|
+
* notify plugins.
|
|
150
120
|
*/
|
|
151
121
|
attachUnexpectedShutdownHandler(driver: ExternalDriver, innerSessionId: string): void;
|
|
152
122
|
/**
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
* @
|
|
156
|
-
* @privateRemarks The _intent_ is that `InnerDriver` is the class of a driver, but it only really
|
|
157
|
-
* needs to be a function or constructor.
|
|
123
|
+
* Collects `driverData` for every active session whose driver class matches `InnerDriver.name`
|
|
124
|
+
* (used when creating another session of the same driver type).
|
|
125
|
+
* @remarks `InnerDriver` is expected to be the driver class; only `.name` is read.
|
|
158
126
|
*/
|
|
159
|
-
curSessionDataForDriver(InnerDriver:
|
|
127
|
+
curSessionDataForDriver(InnerDriver: {
|
|
128
|
+
name: string;
|
|
129
|
+
}): Promise<DriverData[]>;
|
|
160
130
|
/**
|
|
161
|
-
*
|
|
131
|
+
* Ends one session: removes it from the master list immediately, then delegates to the inner
|
|
132
|
+
* driver’s `deleteSession` with sibling-session metadata.
|
|
162
133
|
*/
|
|
163
|
-
deleteSession(sessionId: string): Promise<
|
|
164
|
-
protocol: undefined;
|
|
165
|
-
value: void;
|
|
166
|
-
error?: undefined;
|
|
167
|
-
} | {
|
|
168
|
-
protocol: undefined;
|
|
169
|
-
error: any;
|
|
170
|
-
value?: undefined;
|
|
171
|
-
}>;
|
|
172
|
-
deleteAllSessions(opts?: {}): Promise<void>;
|
|
134
|
+
deleteSession(sessionId: string): Promise<SessionHandlerDeleteResult>;
|
|
173
135
|
/**
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* @param {string|null} [sessionId=null] - the sessionId (or null) to use to find plugins
|
|
177
|
-
* @returns {Array<import('@appium/types').Plugin>} - array of plugin instances
|
|
136
|
+
* Ends every active session, either by normal `deleteSession` or by `startUnexpectedShutdown`
|
|
137
|
+
* when `force` is true.
|
|
178
138
|
*/
|
|
179
|
-
|
|
139
|
+
deleteAllSessions(opts?: {
|
|
140
|
+
force?: boolean;
|
|
141
|
+
reason?: string;
|
|
142
|
+
}): Promise<void>;
|
|
180
143
|
/**
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
* plugin instances reserved for sessionless commands (and we lazily create plugin instances on
|
|
184
|
-
* first use)
|
|
185
|
-
*
|
|
186
|
-
* @param {string} cmd - the name of the command to find a plugin to handle
|
|
187
|
-
* @param {?string} sessionId - the particular session for which to find a plugin, or null if
|
|
188
|
-
* sessionless
|
|
144
|
+
* Plugin instances for a session id, or the shared sessionless list when `sessionId` is null.
|
|
145
|
+
* Lazily builds sessionless instances on first use.
|
|
189
146
|
*/
|
|
190
|
-
|
|
147
|
+
pluginsForSession(sessionId?: string | null): Plugin[];
|
|
191
148
|
/**
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
* @returns {Plugin[]}
|
|
149
|
+
* Plugins that declare a method named `cmd` or a generic `handle` method, scoped to the given
|
|
150
|
+
* session (or sessionless when `sessionId` is null).
|
|
195
151
|
*/
|
|
196
|
-
|
|
152
|
+
pluginsToHandleCmd(cmd: string, sessionId?: string | null): Plugin[];
|
|
197
153
|
/**
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
* @param {...any} args
|
|
201
|
-
* @returns {Promise<{value: any, error?: Error, protocol: string} | import('type-fest').AsyncReturnType<ExternalDriver['executeCommand']>>}
|
|
154
|
+
* One instance per registered plugin class. `driverId` becomes the plugin log prefix segment
|
|
155
|
+
* when tied to a session driver; use `null` for sessionless plugins.
|
|
202
156
|
*/
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
157
|
+
createPluginInstances(driverId?: string | null): Plugin[];
|
|
158
|
+
/**
|
|
159
|
+
* Dispatches a WebDriver/Appium command: may run on this driver, a session’s inner driver, or
|
|
160
|
+
* through a plugin chain, and normalizes the return value into a protocol-shaped result.
|
|
161
|
+
*/
|
|
162
|
+
executeCommand(cmd: string, ...args: any[]): Promise<SessionHandlerResult<unknown>>;
|
|
163
|
+
/** Builds an async chain: each plugin wraps `next` until the default driver behavior runs. */
|
|
164
|
+
wrapCommandWithPlugins({ driver, cmd, args, next, cmdHandledBy, plugins, }: {
|
|
165
|
+
driver: AppiumDriver | ExternalDriver;
|
|
166
|
+
cmd: string;
|
|
167
|
+
args: any[];
|
|
168
|
+
next: () => Promise<unknown>;
|
|
169
|
+
cmdHandledBy: Record<string, boolean>;
|
|
170
|
+
plugins: Plugin[];
|
|
171
|
+
}): () => Promise<unknown>;
|
|
172
|
+
/** After a command with plugins, logs which handlers ran vs. were skipped (debugging aid). */
|
|
173
|
+
logPluginHandlerReport(plugins: Plugin[], { cmd, cmdHandledBy }: {
|
|
174
|
+
cmd: string;
|
|
175
|
+
cmdHandledBy: Record<string, boolean>;
|
|
219
176
|
}): void;
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
onBidiMessage: typeof bidiCommands.onBidiMessage;
|
|
232
|
-
onBidiServerError: typeof bidiCommands.onBidiServerError;
|
|
233
|
-
cleanupBidiSockets: typeof bidiCommands.cleanupBidiSockets;
|
|
234
|
-
configureGlobalFeatures: typeof insecureFeatures.configureGlobalFeatures;
|
|
235
|
-
configureDriverFeatures: typeof insecureFeatures.configureDriverFeatures;
|
|
236
|
-
listCommands: typeof inspectorCommands.listCommands;
|
|
237
|
-
listExtensions: typeof inspectorCommands.listExtensions;
|
|
177
|
+
/** Runs the wrapped plugin chain and merges the result into a `SessionHandlerResult` shape. */
|
|
178
|
+
executeWrappedCommand({ wrappedCmd, protocol, }: {
|
|
179
|
+
wrappedCmd: () => Promise<unknown>;
|
|
180
|
+
protocol: string | null | undefined;
|
|
181
|
+
}): Promise<SessionHandlerResult<unknown>>;
|
|
182
|
+
/** Whether the inner session driver is actively proxying for this session id. */
|
|
183
|
+
proxyActive(sessionId: string): boolean;
|
|
184
|
+
/** URL patterns the session driver does not want proxied; empty if no session or no list. */
|
|
185
|
+
getProxyAvoidList(sessionId: string): RouteMatcher[];
|
|
186
|
+
/** Whether the session driver supports proxying for this session. */
|
|
187
|
+
canProxy(sessionId: string): boolean;
|
|
238
188
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
export { presence_1 as presence };
|
|
247
|
-
let isString_1: true;
|
|
248
|
-
export { isString_1 as isString };
|
|
249
|
-
}
|
|
189
|
+
/**
|
|
190
|
+
* Thrown when Appium tried to proxy a command using a driver's `proxyCommand` method but the
|
|
191
|
+
* method did not exist
|
|
192
|
+
*/
|
|
193
|
+
export declare class NoDriverProxyCommandError extends Error {
|
|
194
|
+
readonly code = "APPIUMERR_NO_DRIVER_PROXYCOMMAND";
|
|
195
|
+
constructor();
|
|
250
196
|
}
|
|
251
|
-
import { DriverCore } from '@appium/base-driver';
|
|
252
|
-
import * as bidiCommands from './bidi-commands';
|
|
253
|
-
import * as insecureFeatures from './insecure-features';
|
|
254
|
-
import * as inspectorCommands from './inspector-commands';
|
|
255
197
|
export {};
|
|
256
198
|
//# sourceMappingURL=appium.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appium.d.ts","sourceRoot":"","sources":["../../lib/appium.
|
|
1
|
+
{"version":3,"file":"appium.d.ts","sourceRoot":"","sources":["../../lib/appium.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,SAAS,MAAM,IAAI,CAAC;AAChC,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,MAAM,EACN,WAAW,EAGX,YAAY,EACZ,YAAY,EACZ,2BAA2B,EAC3B,aAAa,EACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,UAAU,EAcX,MAAM,qBAAqB,CAAC;AAW7B,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,gBAAgB,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,iBAAiB,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAE5D,QAAA,MAAM,4BAA4B;;;;;;;;;CASxB,CAAC;AAEX,MAAM,MAAM,uBAAu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