@appium/base-driver 9.3.2 → 9.3.4
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/LICENSE +1 -1
- package/build/lib/basedriver/capabilities.d.ts +59 -36
- package/build/lib/basedriver/capabilities.d.ts.map +1 -1
- package/build/lib/basedriver/capabilities.js +57 -45
- package/build/lib/basedriver/capabilities.js.map +1 -1
- package/build/lib/basedriver/commands/event.d.ts +5 -9
- package/build/lib/basedriver/commands/event.d.ts.map +1 -1
- package/build/lib/basedriver/commands/event.js +28 -49
- package/build/lib/basedriver/commands/event.js.map +1 -1
- package/build/lib/basedriver/commands/execute.d.ts +5 -11
- package/build/lib/basedriver/commands/execute.d.ts.map +1 -1
- package/build/lib/basedriver/commands/execute.js +15 -39
- package/build/lib/basedriver/commands/execute.js.map +1 -1
- package/build/lib/basedriver/commands/find.d.ts +5 -12
- package/build/lib/basedriver/commands/find.d.ts.map +1 -1
- package/build/lib/basedriver/commands/find.js +38 -98
- package/build/lib/basedriver/commands/find.js.map +1 -1
- package/build/lib/basedriver/commands/index.d.ts +7 -3
- package/build/lib/basedriver/commands/index.d.ts.map +1 -1
- package/build/lib/basedriver/commands/index.js +7 -28
- package/build/lib/basedriver/commands/index.js.map +1 -1
- package/build/lib/basedriver/commands/log.d.ts +5 -10
- package/build/lib/basedriver/commands/log.d.ts.map +1 -1
- package/build/lib/basedriver/commands/log.js +17 -50
- package/build/lib/basedriver/commands/log.js.map +1 -1
- package/build/lib/basedriver/commands/mixin.d.ts +12 -0
- package/build/lib/basedriver/commands/mixin.d.ts.map +1 -0
- package/build/lib/basedriver/commands/mixin.js +18 -0
- package/build/lib/basedriver/commands/mixin.js.map +1 -0
- package/build/lib/basedriver/commands/session.d.ts +5 -11
- package/build/lib/basedriver/commands/session.d.ts.map +1 -1
- package/build/lib/basedriver/commands/session.js +18 -53
- package/build/lib/basedriver/commands/session.js.map +1 -1
- package/build/lib/basedriver/commands/settings.d.ts +5 -9
- package/build/lib/basedriver/commands/settings.d.ts.map +1 -1
- package/build/lib/basedriver/commands/settings.js +14 -34
- package/build/lib/basedriver/commands/settings.js.map +1 -1
- package/build/lib/basedriver/commands/timeout.d.ts +5 -9
- package/build/lib/basedriver/commands/timeout.d.ts.map +1 -1
- package/build/lib/basedriver/commands/timeout.js +107 -129
- package/build/lib/basedriver/commands/timeout.js.map +1 -1
- package/build/lib/basedriver/core.d.ts +14 -20
- package/build/lib/basedriver/core.d.ts.map +1 -1
- package/build/lib/basedriver/core.js +32 -22
- package/build/lib/basedriver/core.js.map +1 -1
- package/build/lib/basedriver/device-settings.d.ts +11 -11
- package/build/lib/basedriver/device-settings.d.ts.map +1 -1
- package/build/lib/basedriver/device-settings.js +7 -8
- package/build/lib/basedriver/device-settings.js.map +1 -1
- package/build/lib/basedriver/driver.d.ts +23 -108
- package/build/lib/basedriver/driver.d.ts.map +1 -1
- package/build/lib/basedriver/driver.js +38 -135
- package/build/lib/basedriver/driver.js.map +1 -1
- package/build/lib/basedriver/helpers.d.ts +21 -98
- package/build/lib/basedriver/helpers.d.ts.map +1 -1
- package/build/lib/basedriver/helpers.js +178 -182
- package/build/lib/basedriver/helpers.js.map +1 -1
- package/build/lib/express/server.d.ts +3 -15
- package/build/lib/express/server.d.ts.map +1 -1
- package/build/lib/express/server.js +4 -2
- package/build/lib/express/server.js.map +1 -1
- package/build/lib/express/websocket.d.ts +5 -44
- package/build/lib/express/websocket.d.ts.map +1 -1
- package/build/lib/express/websocket.js +10 -39
- package/build/lib/express/websocket.js.map +1 -1
- package/build/lib/helpers/capabilities.d.ts +2 -2
- package/build/lib/helpers/capabilities.d.ts.map +1 -1
- package/build/lib/helpers/capabilities.js +2 -3
- package/build/lib/helpers/capabilities.js.map +1 -1
- package/build/lib/protocol/protocol.d.ts +1 -1
- package/build/lib/protocol/protocol.d.ts.map +1 -1
- package/build/lib/protocol/protocol.js +10 -2
- package/build/lib/protocol/protocol.js.map +1 -1
- package/build/lib/protocol/routes.d.ts +1 -0
- package/build/lib/protocol/routes.d.ts.map +1 -1
- package/build/lib/protocol/routes.js +12 -10
- package/build/lib/protocol/routes.js.map +1 -1
- package/lib/basedriver/capabilities.js +70 -56
- package/lib/basedriver/commands/event.ts +49 -0
- package/lib/basedriver/commands/execute.ts +40 -0
- package/lib/basedriver/commands/find.ts +80 -0
- package/lib/basedriver/commands/index.ts +7 -0
- package/lib/basedriver/commands/log.ts +34 -0
- package/lib/basedriver/commands/mixin.ts +15 -0
- package/lib/basedriver/commands/session.ts +36 -0
- package/lib/basedriver/commands/settings.ts +26 -0
- package/lib/basedriver/commands/timeout.ts +155 -0
- package/lib/basedriver/core.js +11 -28
- package/lib/basedriver/device-settings.js +9 -11
- package/lib/basedriver/{driver.js → driver.ts} +71 -180
- package/lib/basedriver/helpers.js +214 -212
- package/lib/express/server.js +4 -2
- package/lib/express/websocket.js +10 -39
- package/lib/helpers/capabilities.js +2 -3
- package/lib/protocol/protocol.js +11 -2
- package/lib/protocol/routes.js +12 -13
- package/package.json +11 -7
- package/lib/basedriver/commands/event.js +0 -63
- package/lib/basedriver/commands/execute.js +0 -45
- package/lib/basedriver/commands/find.js +0 -108
- package/lib/basedriver/commands/index.js +0 -35
- package/lib/basedriver/commands/log.js +0 -64
- package/lib/basedriver/commands/session.js +0 -57
- package/lib/basedriver/commands/settings.js +0 -38
- package/lib/basedriver/commands/timeout.js +0 -168
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export function SettingsMixin<C extends Readonly<Record<string, import("@appium/types").Constraint>>>(Base: import("./log").LogBase<C>): SettingsBase<C>;
|
|
7
|
-
export type Constraints = import('@appium/types').Constraints;
|
|
8
|
-
export type ISettingsCommands = import('@appium/types').ISettingsCommands;
|
|
9
|
-
export type SettingsBase<C extends Readonly<Record<string, import("@appium/types").Constraint>>> = import('../driver').BaseDriverBase<C, import('@appium/types').ITimeoutCommands & import('@appium/types').IEventCommands & import('@appium/types').IFindCommands & import('@appium/types').ILogCommands<C> & ISettingsCommands>;
|
|
1
|
+
import { Constraints, ISettingsCommands } from '@appium/types';
|
|
2
|
+
declare module '../driver' {
|
|
3
|
+
interface BaseDriver<C extends Constraints> extends ISettingsCommands {
|
|
4
|
+
}
|
|
5
|
+
}
|
|
10
6
|
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../lib/basedriver/commands/settings.
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../lib/basedriver/commands/settings.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAE,iBAAiB,EAAe,MAAM,eAAe,CAAC;AAG3E,OAAO,QAAQ,WAAW,CAAC;IAEzB,UAAU,UAAU,CAAC,CAAC,SAAS,WAAW,CAAE,SAAQ,iBAAiB;KAAG;CACzE"}
|
|
@@ -1,39 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// @ts-check
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
function SettingsMixin(Base) {
|
|
11
|
-
/**
|
|
12
|
-
* @implements {ISettingsCommands}
|
|
13
|
-
*/
|
|
14
|
-
class SettingsCommands extends Base {
|
|
15
|
-
async updateSettings(newSettings) {
|
|
16
|
-
if (!this.settings) {
|
|
17
|
-
this.log.errorAndThrow('Cannot update settings; settings object not found');
|
|
18
|
-
}
|
|
19
|
-
return await this.settings.update(newSettings);
|
|
3
|
+
const mixin_1 = require("./mixin");
|
|
4
|
+
const SettingsCommands = {
|
|
5
|
+
async updateSettings(newSettings) {
|
|
6
|
+
if (!this.settings) {
|
|
7
|
+
this.log.errorAndThrow('Cannot update settings; settings object not found');
|
|
20
8
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
return await this.settings.update(newSettings);
|
|
10
|
+
},
|
|
11
|
+
async getSettings() {
|
|
12
|
+
if (!this.settings) {
|
|
13
|
+
this.log.errorAndThrow('Cannot get settings; settings object not found');
|
|
26
14
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* @typedef {import('@appium/types').Constraints} Constraints
|
|
33
|
-
* @typedef {import('@appium/types').ISettingsCommands} ISettingsCommands
|
|
34
|
-
*/
|
|
35
|
-
/**
|
|
36
|
-
* @template {Constraints} C
|
|
37
|
-
* @typedef {import('../driver').BaseDriverBase<C, import('@appium/types').ITimeoutCommands & import('@appium/types').IEventCommands & import('@appium/types').IFindCommands & import('@appium/types').ILogCommands<C> & ISettingsCommands>} SettingsBase
|
|
38
|
-
*/
|
|
15
|
+
return this.settings.getSettings();
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
(0, mixin_1.mixin)(SettingsCommands);
|
|
39
19
|
//# sourceMappingURL=settings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../../lib/basedriver/commands/settings.
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../../lib/basedriver/commands/settings.ts"],"names":[],"mappings":";;AAEA,mCAA8B;AAO9B,MAAM,gBAAgB,GAAsB;IAC1C,KAAK,CAAC,cAAc,CAA6C,WAAyB;QACxF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,mDAAmD,CAAC,CAAC;SAC7E;QACD,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,WAAW;QACf,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,gDAAgD,CAAC,CAAC;SAC1E;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;IACrC,CAAC;CACF,CAAC;AAEF,IAAA,aAAK,EAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export function TimeoutMixin<C extends Readonly<Record<string, import("@appium/types").Constraint>>>(Base: import("../driver").BaseDriverBase<C, {}, {}>): TimeoutBase<C>;
|
|
7
|
-
export type ITimeoutCommands = import('@appium/types').ITimeoutCommands;
|
|
8
|
-
export type Constraints = import('@appium/types').Constraints;
|
|
9
|
-
export type TimeoutBase<C extends Readonly<Record<string, import("@appium/types").Constraint>>> = import('../driver').BaseDriverBase<C, ITimeoutCommands>;
|
|
1
|
+
import { Constraints, ITimeoutCommands } from '@appium/types';
|
|
2
|
+
declare module '../driver' {
|
|
3
|
+
interface BaseDriver<C extends Constraints> extends ITimeoutCommands {
|
|
4
|
+
}
|
|
5
|
+
}
|
|
10
6
|
//# sourceMappingURL=timeout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeout.d.ts","sourceRoot":"","sources":["../../../../lib/basedriver/commands/timeout.
|
|
1
|
+
{"version":3,"file":"timeout.d.ts","sourceRoot":"","sources":["../../../../lib/basedriver/commands/timeout.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,WAAW,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAG5D,OAAO,QAAQ,WAAW,CAAC;IAEzB,UAAU,UAAU,CAAC,CAAC,SAAS,WAAW,CAAE,SAAQ,gBAAgB;KAAG;CACxE"}
|
|
@@ -1,152 +1,130 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// @ts-check
|
|
3
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
4
|
};
|
|
6
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.TimeoutMixin = void 0;
|
|
8
|
-
/* eslint-disable no-unused-vars */
|
|
9
|
-
/* eslint-disable require-await */
|
|
10
6
|
const asyncbox_1 = require("asyncbox");
|
|
11
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
12
8
|
const support_1 = require("@appium/support");
|
|
13
9
|
const protocol_1 = require("../../protocol");
|
|
10
|
+
const mixin_1 = require("./mixin");
|
|
14
11
|
const MIN_TIMEOUT = 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return;
|
|
35
|
-
case 'page load':
|
|
36
|
-
await this.pageLoadTimeoutMJSONWP(ms);
|
|
37
|
-
return;
|
|
38
|
-
case 'script':
|
|
39
|
-
await this.scriptTimeoutMJSONWP(ms);
|
|
40
|
-
return;
|
|
41
|
-
default:
|
|
42
|
-
throw new Error(`'${type}' type is not supported for MJSONWP timeout`);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
// Otherwise assume it is W3C protocol
|
|
46
|
-
this.log.debug(`W3C timeout argument: ${JSON.stringify({
|
|
47
|
-
script,
|
|
48
|
-
pageLoad,
|
|
49
|
-
implicit,
|
|
50
|
-
})}}`);
|
|
51
|
-
if (support_1.util.hasValue(script)) {
|
|
52
|
-
await this.scriptTimeoutW3C(script);
|
|
53
|
-
}
|
|
54
|
-
if (support_1.util.hasValue(pageLoad)) {
|
|
55
|
-
await this.pageLoadTimeoutW3C(pageLoad);
|
|
56
|
-
}
|
|
57
|
-
if (support_1.util.hasValue(implicit)) {
|
|
58
|
-
await this.implicitWaitW3C(implicit);
|
|
12
|
+
const TimeoutCommands = {
|
|
13
|
+
async timeouts(type, ms, script, pageLoad, implicit) {
|
|
14
|
+
if (support_1.util.hasValue(type) && support_1.util.hasValue(ms)) {
|
|
15
|
+
this.log.debug(`MJSONWP timeout arguments: ${JSON.stringify({ type, ms })}}`);
|
|
16
|
+
switch (type) {
|
|
17
|
+
case 'command':
|
|
18
|
+
await this.newCommandTimeout(ms);
|
|
19
|
+
return;
|
|
20
|
+
case 'implicit':
|
|
21
|
+
await this.implicitWaitMJSONWP(ms);
|
|
22
|
+
return;
|
|
23
|
+
case 'page load':
|
|
24
|
+
await this.pageLoadTimeoutMJSONWP(ms);
|
|
25
|
+
return;
|
|
26
|
+
case 'script':
|
|
27
|
+
await this.scriptTimeoutMJSONWP(ms);
|
|
28
|
+
return;
|
|
29
|
+
default:
|
|
30
|
+
throw new Error(`'${type}' type is not supported for MJSONWP timeout`);
|
|
59
31
|
}
|
|
60
32
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
await this.implicitWait(ms);
|
|
70
|
-
}
|
|
71
|
-
async implicitWaitMJSONWP(ms) {
|
|
72
|
-
await this.implicitWait(ms);
|
|
73
|
-
}
|
|
74
|
-
async implicitWait(ms) {
|
|
75
|
-
await this.setImplicitWait(this.parseTimeoutArgument(ms));
|
|
33
|
+
// Otherwise assume it is W3C protocol
|
|
34
|
+
this.log.debug(`W3C timeout argument: ${JSON.stringify({
|
|
35
|
+
script,
|
|
36
|
+
pageLoad,
|
|
37
|
+
implicit,
|
|
38
|
+
})}}`);
|
|
39
|
+
if (support_1.util.hasValue(script)) {
|
|
40
|
+
await this.scriptTimeoutW3C(script);
|
|
76
41
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
throw new protocol_1.errors.NotImplementedError('Not implemented yet for pageLoad.');
|
|
42
|
+
if (support_1.util.hasValue(pageLoad)) {
|
|
43
|
+
await this.pageLoadTimeoutW3C(pageLoad);
|
|
80
44
|
}
|
|
81
|
-
|
|
82
|
-
|
|
45
|
+
if (support_1.util.hasValue(implicit)) {
|
|
46
|
+
await this.implicitWaitW3C(implicit);
|
|
83
47
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
48
|
+
},
|
|
49
|
+
async getTimeouts() {
|
|
50
|
+
return {
|
|
51
|
+
command: this.newCommandTimeoutMs,
|
|
52
|
+
implicit: this.implicitWaitMs,
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
// implicit
|
|
56
|
+
async implicitWaitW3C(ms) {
|
|
57
|
+
await this.implicitWait(ms);
|
|
58
|
+
},
|
|
59
|
+
async implicitWaitMJSONWP(ms) {
|
|
60
|
+
await this.implicitWait(ms);
|
|
61
|
+
},
|
|
62
|
+
async implicitWait(ms) {
|
|
63
|
+
this.setImplicitWait(this.parseTimeoutArgument(ms));
|
|
64
|
+
},
|
|
65
|
+
// pageLoad
|
|
66
|
+
async pageLoadTimeoutW3C(ms) {
|
|
67
|
+
throw new protocol_1.errors.NotImplementedError('Not implemented yet for pageLoad.');
|
|
68
|
+
},
|
|
69
|
+
async pageLoadTimeoutMJSONWP(ms) {
|
|
70
|
+
throw new protocol_1.errors.NotImplementedError('Not implemented yet for pageLoad.');
|
|
71
|
+
},
|
|
72
|
+
// script
|
|
73
|
+
async scriptTimeoutW3C(ms) {
|
|
74
|
+
throw new protocol_1.errors.NotImplementedError('Not implemented yet for script.');
|
|
75
|
+
},
|
|
76
|
+
async scriptTimeoutMJSONWP(ms) {
|
|
77
|
+
throw new protocol_1.errors.NotImplementedError('Not implemented yet for script.');
|
|
78
|
+
},
|
|
79
|
+
// command
|
|
80
|
+
async newCommandTimeout(ms) {
|
|
81
|
+
this.setNewCommandTimeout(this.parseTimeoutArgument(ms));
|
|
82
|
+
},
|
|
83
|
+
setImplicitWait(ms) {
|
|
84
|
+
// eslint-disable-line require-await
|
|
85
|
+
this.implicitWaitMs = ms;
|
|
86
|
+
this.log.debug(`Set implicit wait to ${ms}ms`);
|
|
87
|
+
if (this.managedDrivers && this.managedDrivers.length) {
|
|
88
|
+
this.log.debug('Setting implicit wait on managed drivers');
|
|
89
|
+
for (const driver of this.managedDrivers) {
|
|
90
|
+
if (lodash_1.default.isFunction(driver.setImplicitWait)) {
|
|
91
|
+
driver.setImplicitWait(ms);
|
|
105
92
|
}
|
|
106
93
|
}
|
|
107
94
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
95
|
+
},
|
|
96
|
+
setNewCommandTimeout(ms) {
|
|
97
|
+
this.newCommandTimeoutMs = ms;
|
|
98
|
+
this.log.debug(`Set new command timeout to ${ms}ms`);
|
|
99
|
+
if (this.managedDrivers && this.managedDrivers.length) {
|
|
100
|
+
this.log.debug('Setting new command timeout on managed drivers');
|
|
101
|
+
for (const driver of this.managedDrivers) {
|
|
102
|
+
if (lodash_1.default.isFunction(driver.setNewCommandTimeout)) {
|
|
103
|
+
driver.setNewCommandTimeout(ms);
|
|
117
104
|
}
|
|
118
105
|
}
|
|
119
106
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
107
|
+
},
|
|
108
|
+
async implicitWaitForCondition(condFn) {
|
|
109
|
+
this.log.debug(`Waiting up to ${this.implicitWaitMs} ms for condition`);
|
|
110
|
+
const wrappedCondFn = async (...args) => {
|
|
111
|
+
// reset command timeout
|
|
112
|
+
await this.clearNewCommandTimeout();
|
|
113
|
+
return await condFn(...args);
|
|
114
|
+
};
|
|
115
|
+
return await (0, asyncbox_1.waitForCondition)(wrappedCondFn, {
|
|
116
|
+
waitMs: this.implicitWaitMs,
|
|
117
|
+
intervalMs: 500,
|
|
118
|
+
logger: this.log,
|
|
119
|
+
});
|
|
120
|
+
},
|
|
121
|
+
parseTimeoutArgument(ms) {
|
|
122
|
+
const duration = parseInt(String(ms), 10);
|
|
123
|
+
if (lodash_1.default.isNaN(duration) || duration < MIN_TIMEOUT) {
|
|
124
|
+
throw new protocol_1.errors.UnknownError(`Invalid timeout value '${ms}'`);
|
|
132
125
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
return duration;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return TimeoutCommands;
|
|
142
|
-
}
|
|
143
|
-
exports.TimeoutMixin = TimeoutMixin;
|
|
144
|
-
/**
|
|
145
|
-
* @typedef {import('@appium/types').ITimeoutCommands} ITimeoutCommands
|
|
146
|
-
* @typedef {import('@appium/types').Constraints} Constraints
|
|
147
|
-
*/
|
|
148
|
-
/**
|
|
149
|
-
* @template {Constraints} C
|
|
150
|
-
* @typedef {import('../driver').BaseDriverBase<C, ITimeoutCommands>} TimeoutBase
|
|
151
|
-
*/
|
|
126
|
+
return duration;
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
(0, mixin_1.mixin)(TimeoutCommands);
|
|
152
130
|
//# sourceMappingURL=timeout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeout.js","sourceRoot":"","sources":["../../../../lib/basedriver/commands/timeout.
|
|
1
|
+
{"version":3,"file":"timeout.js","sourceRoot":"","sources":["../../../../lib/basedriver/commands/timeout.ts"],"names":[],"mappings":";;;;;AAAA,uCAA0C;A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AAW,EAAE,EAAE;YAC7C,wBAAwB;YACxB,MAAM,IAAI,CAAC,sBAAsB,EAAE,CAAC;YAEpC,OAAO,MAAM,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;QAC/B,CAAC,CAAC;QACF,OAAO,MAAM,IAAA,2BAAgB,EAAC,aAAa,EAAE;YAC3C,MAAM,EAAE,IAAI,CAAC,cAAc;YAC3B,UAAU,EAAE,GAAG;YACf,MAAM,EAAE,IAAI,CAAC,GAAG;SACjB,CAAC,CAAC;IACL,CAAC;IAED,oBAAoB,CAA6C,EAAmB;QAClF,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAC1C,IAAI,gBAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,QAAQ,GAAG,WAAW,EAAE;YAC/C,MAAM,IAAI,iBAAM,CAAC,YAAY,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAC;SAChE;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAC;AAEF,IAAA,aAAK,EAAC,eAAe,CAAC,CAAC"}
|
|
@@ -5,22 +5,19 @@ export type EventHistory = import('@appium/types').EventHistory;
|
|
|
5
5
|
export type AppiumLogger = import('@appium/types').AppiumLogger;
|
|
6
6
|
export type StringRecord = import('@appium/types').StringRecord;
|
|
7
7
|
export type BaseDriverCapConstraints = import('@appium/types').BaseDriverCapConstraints;
|
|
8
|
-
export type
|
|
9
|
-
export type
|
|
10
|
-
export type Core<C extends Readonly<Record<string, import("@appium/types").Constraint>>> = import('@appium/types').Core<C>;
|
|
11
|
-
export type DriverOpts<C extends Readonly<Record<string, import("@appium/types").Constraint>>> = import('@appium/types').DriverOpts<C>;
|
|
8
|
+
export type Core<C extends import("@appium/types").Constraints, S extends StringRecord = StringRecord> = import('@appium/types').Core<C, S>;
|
|
9
|
+
export type DriverOpts<C extends import("@appium/types").Constraints> = import('@appium/types').DriverOpts<C>;
|
|
12
10
|
/**
|
|
13
|
-
* @template {Constraints}
|
|
14
|
-
* @
|
|
11
|
+
* @template {Constraints} C
|
|
12
|
+
* @template {StringRecord} [Settings=StringRecord]
|
|
13
|
+
* @implements {Core<C, Settings>}
|
|
15
14
|
*/
|
|
16
|
-
export class DriverCore<C extends
|
|
15
|
+
export class DriverCore<C extends import("@appium/types").Constraints, Settings extends StringRecord = StringRecord> implements Core<C, Settings> {
|
|
17
16
|
/**
|
|
18
17
|
* Make the basedriver version available so for any driver which inherits from this package, we
|
|
19
18
|
* know which version of basedriver it inherited from
|
|
20
19
|
*/
|
|
21
|
-
static baseVersion:
|
|
22
|
-
/** @type {import('@appium/types').ExecuteMethodMap<DriverCore>} */
|
|
23
|
-
static executeMethodMap: import('@appium/types').ExecuteMethodMap<DriverCore>;
|
|
20
|
+
static baseVersion: string;
|
|
24
21
|
/**
|
|
25
22
|
* @param {DriverOpts<C>} opts
|
|
26
23
|
* @param {boolean} [shouldValidateCaps]
|
|
@@ -35,9 +32,9 @@ export class DriverCore<C extends Readonly<Record<string, import("@appium/types"
|
|
|
35
32
|
*/
|
|
36
33
|
opts: import('@appium/types').DriverOpts<C>;
|
|
37
34
|
/**
|
|
38
|
-
* @type {
|
|
35
|
+
* @type {import('@appium/types').DriverOpts<C>}
|
|
39
36
|
*/
|
|
40
|
-
initialOpts:
|
|
37
|
+
initialOpts: import('@appium/types').DriverOpts<C>;
|
|
41
38
|
/** @type {typeof helpers} */
|
|
42
39
|
helpers: typeof helpers;
|
|
43
40
|
/**
|
|
@@ -77,10 +74,9 @@ export class DriverCore<C extends Readonly<Record<string, import("@appium/types"
|
|
|
77
74
|
*/
|
|
78
75
|
_log: AppiumLogger;
|
|
79
76
|
/**
|
|
80
|
-
* @protected
|
|
81
77
|
* @type {boolean}
|
|
82
78
|
*/
|
|
83
|
-
|
|
79
|
+
shutdownUnexpectedly: boolean;
|
|
84
80
|
/**
|
|
85
81
|
* @type {boolean}
|
|
86
82
|
*/
|
|
@@ -95,9 +91,9 @@ export class DriverCore<C extends Readonly<Record<string, import("@appium/types"
|
|
|
95
91
|
* we set it to an empty DeviceSettings instance here to make sure that the
|
|
96
92
|
* default settings are applied even if an extending driver doesn't utilize
|
|
97
93
|
* the settings functionality itself
|
|
98
|
-
* @type {DeviceSettings}
|
|
94
|
+
* @type {DeviceSettings<Settings>}
|
|
99
95
|
*/
|
|
100
|
-
settings: DeviceSettings<
|
|
96
|
+
settings: DeviceSettings<Settings>;
|
|
101
97
|
get log(): import("@appium/types").AppiumLogger;
|
|
102
98
|
/**
|
|
103
99
|
* Set a callback handler if needed to execute a custom piece of code
|
|
@@ -114,10 +110,8 @@ export class DriverCore<C extends Readonly<Record<string, import("@appium/types"
|
|
|
114
110
|
* specific driver sessions. This data can be later used to adjust
|
|
115
111
|
* properties for driver instances running in parallel.
|
|
116
112
|
* Override it in inherited driver classes if necessary.
|
|
117
|
-
*
|
|
118
|
-
* @return {Record<string,unknown>} Driver properties mapping
|
|
119
113
|
*/
|
|
120
|
-
get driverData():
|
|
114
|
+
get driverData(): import("@appium/types").DriverData;
|
|
121
115
|
/**
|
|
122
116
|
* This property controls the way the `executeCommand` method
|
|
123
117
|
* handles new driver commands received from the client.
|
|
@@ -226,7 +220,7 @@ export class DriverCore<C extends Readonly<Record<string, import("@appium/types"
|
|
|
226
220
|
* @param {Driver} driver
|
|
227
221
|
*/
|
|
228
222
|
addManagedDriver(driver: Driver): void;
|
|
229
|
-
getManagedDrivers(): import("@appium/types").Driver<
|
|
223
|
+
getManagedDrivers(): import("@appium/types").Driver<import("@appium/types").Constraints, import("@appium/types").StringRecord<any>, import("@appium/types").StringRecord<any>, import("@appium/types").DefaultCreateSessionResult<import("@appium/types").Constraints>, void>[];
|
|
230
224
|
clearNewCommandTimeout(): Promise<void>;
|
|
231
225
|
}
|
|
232
226
|
import helpers from "./helpers";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../lib/basedriver/core.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../lib/basedriver/core.js"],"names":[],"mappings":"qBAoba,OAAO,eAAe,EAAE,MAAM;0BAC9B,OAAO,eAAe,EAAE,WAAW;yBACnC,OAAO,eAAe,EAAE,UAAU;2BAClC,OAAO,eAAe,EAAE,YAAY;2BACpC,OAAO,eAAe,EAAE,YAAY;2BACpC,OAAO,eAAe,EAAE,YAAY;uCACpC,OAAO,eAAe,EAAE,wBAAwB;yGAMhD,OAAO,eAAe,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;wEAKlC,OAAO,eAAe,EAAE,UAAU,CAAC,CAAC,CAAC;AApblD;;;;GAIG;AACH,qIAFqB,CAAC,EAAE,QAAQ;IAG9B;;;OAGG;IACH,2BAAoC;IA+FpC;;;OAGG;IACH,mBAHW,WAAW,CAAC,CAAC,4CAoCvB;IAlID;;OAEG;IACH,WAFU,MAAM,QAEN;IAEV;;OAEG;IACH,MAFU,OAAO,eAAe,EAAE,UAAU,CAAC,CAAC,CAAC,CAE1C;IAEL;;OAEG;IACH,aAFU,OAAO,eAAe,EAAE,UAAU,CAAC,CAAC,CAAC,CAEnC;IAEZ,6BAA6B;IAC7B,SADW,cAAc,CACjB;IAER;;;;;;;;OAQG;IACH,UAFU,MAAM,CAEP;IAET,sBAAsB;IACtB,wBADW,OAAO,CACK;IAEvB,uBAAuB;IACvB,eADW,MAAM,EAAE,CACL;IAEd,uBAAuB;IACvB,cADW,MAAM,EAAE,CACN;IAEb,qBAAqB;IACrB,qBADW,MAAM,CACG;IAEpB,qBAAqB;IACrB,gBADW,MAAM,CACF;IAEf,uBAAuB;IACvB,mBADW,MAAM,EAAE,CACD;IAElB,uBAAuB;IACvB,sBADW,MAAM,EAAE,CACE;IAErB,uBAAuB;IACvB,gBADW,MAAM,EAAE,CACJ;IAEf,8BAA8B;IAC9B,gBADW,OAAO,OAAO,QACV;IAEf,2BAA2B;IAC3B,eADW,YAAY,CAC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|
|
3
3
|
/* eslint-disable require-await */
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
+
}) : function(o, v) {
|
|
18
|
+
o["default"] = v;
|
|
19
|
+
});
|
|
20
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
21
|
+
if (mod && mod.__esModule) return mod;
|
|
22
|
+
var result = {};
|
|
23
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
24
|
+
__setModuleDefault(result, mod);
|
|
25
|
+
return result;
|
|
26
|
+
};
|
|
4
27
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
28
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
29
|
};
|
|
@@ -14,14 +37,13 @@ const os_1 = __importDefault(require("os"));
|
|
|
14
37
|
const constants_1 = require("../constants");
|
|
15
38
|
const protocol_1 = require("../protocol");
|
|
16
39
|
const device_settings_1 = __importDefault(require("./device-settings"));
|
|
17
|
-
const helpers_1 =
|
|
18
|
-
// for compat with running tests transpiled and in-place
|
|
19
|
-
const { version: BASEDRIVER_VER } = support_1.fs.readPackageJsonFrom(__dirname);
|
|
40
|
+
const helpers_1 = __importStar(require("./helpers"));
|
|
20
41
|
const NEW_COMMAND_TIMEOUT_MS = 60 * 1000;
|
|
21
42
|
const ON_UNEXPECTED_SHUTDOWN_EVENT = 'onUnexpectedShutdown';
|
|
22
43
|
/**
|
|
23
|
-
* @template {Constraints}
|
|
24
|
-
* @
|
|
44
|
+
* @template {Constraints} C
|
|
45
|
+
* @template {StringRecord} [Settings=StringRecord]
|
|
46
|
+
* @implements {Core<C, Settings>}
|
|
25
47
|
*/
|
|
26
48
|
class DriverCore {
|
|
27
49
|
/**
|
|
@@ -77,11 +99,9 @@ class DriverCore {
|
|
|
77
99
|
* specific driver sessions. This data can be later used to adjust
|
|
78
100
|
* properties for driver instances running in parallel.
|
|
79
101
|
* Override it in inherited driver classes if necessary.
|
|
80
|
-
*
|
|
81
|
-
* @return {Record<string,unknown>} Driver properties mapping
|
|
82
102
|
*/
|
|
83
103
|
get driverData() {
|
|
84
|
-
return {};
|
|
104
|
+
return /** @type {import('@appium/types').DriverData} */ ({});
|
|
85
105
|
}
|
|
86
106
|
/**
|
|
87
107
|
* This property controls the way the `executeCommand` method
|
|
@@ -148,7 +168,7 @@ class DriverCore {
|
|
|
148
168
|
* @returns {Core<C> | null}
|
|
149
169
|
*/
|
|
150
170
|
driverForSession(sessionId) {
|
|
151
|
-
return this;
|
|
171
|
+
return /** @type {Core<C> | null} */ (this);
|
|
152
172
|
}
|
|
153
173
|
isMjsonwpProtocol() {
|
|
154
174
|
return this.protocol === constants_1.PROTOCOLS.MJSONWP;
|
|
@@ -304,9 +324,7 @@ exports.DriverCore = DriverCore;
|
|
|
304
324
|
* Make the basedriver version available so for any driver which inherits from this package, we
|
|
305
325
|
* know which version of basedriver it inherited from
|
|
306
326
|
*/
|
|
307
|
-
DriverCore.baseVersion = BASEDRIVER_VER;
|
|
308
|
-
/** @type {import('@appium/types').ExecuteMethodMap<DriverCore>} */
|
|
309
|
-
DriverCore.executeMethodMap = {};
|
|
327
|
+
DriverCore.baseVersion = helpers_1.BASEDRIVER_VER;
|
|
310
328
|
/**
|
|
311
329
|
* @typedef {import('@appium/types').Driver} Driver
|
|
312
330
|
* @typedef {import('@appium/types').Constraints} Constraints
|
|
@@ -316,18 +334,10 @@ DriverCore.executeMethodMap = {};
|
|
|
316
334
|
* @typedef {import('@appium/types').StringRecord} StringRecord
|
|
317
335
|
* @typedef {import('@appium/types').BaseDriverCapConstraints} BaseDriverCapConstraints
|
|
318
336
|
*/
|
|
319
|
-
/**
|
|
320
|
-
* @template {Constraints} [C=BaseDriverCapConstraints]
|
|
321
|
-
* @template {StringRecord|void} [Extra=void]
|
|
322
|
-
* @typedef {import('@appium/types').Capabilities<C, Extra>} Capabilities
|
|
323
|
-
*/
|
|
324
|
-
/**
|
|
325
|
-
* @template {StringRecord} [T={}]
|
|
326
|
-
* @typedef {import('@appium/types').W3CCapabilities<T>} W3CCapabilities
|
|
327
|
-
*/
|
|
328
337
|
/**
|
|
329
338
|
* @template {Constraints} C
|
|
330
|
-
* @
|
|
339
|
+
* @template {StringRecord} [S=StringRecord]
|
|
340
|
+
* @typedef {import('@appium/types').Core<C, S>} Core
|
|
331
341
|
*/
|
|
332
342
|
/**
|
|
333
343
|
* @template {Constraints} C
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../lib/basedriver/core.js"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,kCAAkC
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../lib/basedriver/core.js"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElC,6CAAuC;AACvC,4DAAmC;AACnC,mCAAoC;AACpC,oDAAuB;AACvB,4CAAoB;AACpB,4CAA0D;AAC1D,0CAAmC;AACnC,wEAA+C;AAC/C,qDAAkD;AAElD,MAAM,sBAAsB,GAAG,EAAE,GAAG,IAAI,CAAC;AAEzC,MAAM,4BAA4B,GAAG,sBAAsB,CAAC;AAE5D;;;;GA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