@appium/base-driver 9.3.1 → 9.3.3
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 +10 -0
- package/build/lib/basedriver/capabilities.d.ts.map +1 -1
- package/build/lib/basedriver/capabilities.js +57 -44
- 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 +20 -27
- 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 +17 -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 +20 -45
- 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 -126
- package/build/lib/basedriver/commands/timeout.js.map +1 -1
- package/build/lib/basedriver/core.d.ts +12 -5
- package/build/lib/basedriver/core.d.ts.map +1 -1
- package/build/lib/basedriver/core.js +10 -45
- package/build/lib/basedriver/core.js.map +1 -1
- package/build/lib/basedriver/driver.d.ts +12 -12
- package/build/lib/basedriver/driver.d.ts.map +1 -1
- package/build/lib/basedriver/driver.js +22 -14
- package/build/lib/basedriver/driver.js.map +1 -1
- package/build/lib/basedriver/helpers.d.ts.map +1 -1
- package/build/lib/basedriver/helpers.js +9 -3
- 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/index.d.ts +1 -1
- package/build/lib/index.d.ts.map +1 -1
- package/build/lib/index.js +2 -1
- package/build/lib/index.js.map +1 -1
- package/lib/basedriver/capabilities.js +68 -54
- package/lib/basedriver/commands/event.ts +48 -0
- package/lib/basedriver/commands/execute.ts +39 -0
- package/lib/basedriver/commands/find.ts +79 -0
- package/lib/basedriver/commands/index.ts +7 -0
- package/lib/basedriver/commands/log.ts +36 -0
- package/lib/basedriver/commands/mixin.ts +14 -0
- package/lib/basedriver/commands/session.ts +34 -0
- package/lib/basedriver/commands/settings.ts +25 -0
- package/lib/basedriver/commands/timeout.ts +155 -0
- package/lib/basedriver/core.js +41 -20
- package/lib/basedriver/driver.js +9 -12
- package/lib/basedriver/helpers.js +9 -3
- package/lib/index.js +1 -0
- package/package.json +8 -8
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../../lib/basedriver/commands/find.
|
|
1
|
+
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../../lib/basedriver/commands/find.ts"],"names":[],"mappings":";;AACA,6CAAsC;AAEtC,mCAA8B;AAM9B,MAAM,YAAY,GAAkB;IAClC,KAAK,CAAC,WAAW,CAA6C,QAAQ,EAAE,QAAQ;QAC9E,OAAO,MAAM,IAAI,CAAC,yBAAyB,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;IACzE,CAAC;IAED,KAAK,CAAC,YAAY,CAA6C,QAAQ,EAAE,QAAQ;QAC/E,OAAO,MAAM,IAAI,CAAC,yBAAyB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;IACxE,CAAC;IAED,KAAK,CAAC,sBAAsB,CAE1B,QAAgB,EAChB,QAAgB,EAChB,SAAiB;QAEjB,OAAO,MAAM,IAAI,CAAC,yBAAyB,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IACpF,CAAC;IAED,KAAK,CAAC,uBAAuB,CAE3B,QAAgB,EAChB,QAAgB,EAChB,SAAiB;QAEjB,OAAO,MAAM,IAAI,CAAC,yBAAyB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IACnF,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,WAAW,CAEf,QAAgB,EAChB,QAAgB,EAChB,IAAU,EACV,OAAY;QAEZ,MAAM,IAAI,iBAAM,CAAC,mBAAmB,CAAC,+BAA+B,CAAC,CAAC;IACxE,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,MAAM,IAAI,iBAAM,CAAC,mBAAmB,CAAC,+BAA+B,CAAC,CAAC;IACxE,CAAC;IAED,KAAK,CAAC,yBAAyB,CAE7B,QAAgB,EAChB,QAAgB,EAChB,IAAU,EACV,OAAa;QAEb,IAAI,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI;YACF,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;SAClE;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,IAAI,CAAC,IAAI,CAAC,4BAA4B,EAAE;gBAC1C,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;gBACvC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,wBAAwB,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;gBAC1E,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAC;gBAChF,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACrB;YACD,gCAAgC;YAChC,MAAM,GAAG,CAAC;SACX;IACH,CAAC;CACF,CAAC;AAEF,IAAA,aAAK,EAAC,YAAY,CAAC,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export * from './event';
|
|
2
|
+
export * from './find';
|
|
3
|
+
export * from './log';
|
|
4
|
+
export * from './session';
|
|
5
|
+
export * from './settings';
|
|
6
|
+
export * from './timeout';
|
|
7
|
+
export * from './execute';
|
|
4
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/basedriver/commands/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/basedriver/commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
|
|
@@ -1,31 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
4
15
|
};
|
|
5
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const settings_1 = require("./settings");
|
|
14
|
-
const timeout_1 = require("./timeout");
|
|
15
|
-
const execute_1 = require("./execute");
|
|
16
|
-
/**
|
|
17
|
-
* Applies all the mixins to the `BaseDriverBase` class; returns a `BaseDriver` class definition.
|
|
18
|
-
* Each mixin is applied in the order it is listed here, and each type is a union with the previous.
|
|
19
|
-
*
|
|
20
|
-
* @template {Constraints} C
|
|
21
|
-
* @param {BaseDriverBase<C>} Base
|
|
22
|
-
*/
|
|
23
|
-
exports.createBaseDriverClass = lodash_1.default.flow(timeout_1.TimeoutMixin, event_1.EventMixin, find_1.FindMixin, log_1.LogMixin, settings_1.SettingsMixin, session_1.SessionMixin, execute_1.ExecuteMixin);
|
|
24
|
-
/**
|
|
25
|
-
* @template {Constraints} C
|
|
26
|
-
* @typedef {import('../driver').BaseDriverBase<C>} BaseDriverBase
|
|
27
|
-
*/
|
|
28
|
-
/**
|
|
29
|
-
* @typedef {import('@appium/types').Constraints} Constraints
|
|
30
|
-
*/
|
|
17
|
+
__exportStar(require("./event"), exports);
|
|
18
|
+
__exportStar(require("./find"), exports);
|
|
19
|
+
__exportStar(require("./log"), exports);
|
|
20
|
+
__exportStar(require("./session"), exports);
|
|
21
|
+
__exportStar(require("./settings"), exports);
|
|
22
|
+
__exportStar(require("./timeout"), exports);
|
|
23
|
+
__exportStar(require("./execute"), exports);
|
|
31
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/basedriver/commands/index.
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/basedriver/commands/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,yCAAuB;AACvB,wCAAsB;AACtB,4CAA0B;AAC1B,6CAA2B;AAC3B,4CAA0B;AAC1B,4CAA0B"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export function LogMixin<C extends Readonly<Record<string, import("@appium/types").Constraint>>>(Base: import("./find").FindBase<C>): LogBase<C>;
|
|
7
|
-
export type Constraints = import('@appium/types').Constraints;
|
|
8
|
-
export type StringRecord = import('@appium/types').StringRecord;
|
|
9
|
-
export type ILogCommands<C extends Readonly<Record<string, import("@appium/types").Constraint>>> = import('@appium/types').ILogCommands<C>;
|
|
10
|
-
export type LogBase<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 & ILogCommands<C>>;
|
|
1
|
+
import { ILogCommands } from '@appium/types';
|
|
2
|
+
declare module '../driver' {
|
|
3
|
+
interface BaseDriver<C extends Constraints> extends ILogCommands {
|
|
4
|
+
}
|
|
5
|
+
}
|
|
11
6
|
//# sourceMappingURL=log.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../../lib/basedriver/commands/log.
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../../lib/basedriver/commands/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,YAAY,EAAe,MAAM,eAAe,CAAC;AAK9E,OAAO,QAAQ,WAAW,CAAC;IACzB,UAAU,UAAU,CAAC,CAAC,SAAS,WAAW,CAAE,SAAQ,YAAY;KAAG;CACpE"}
|
|
@@ -1,58 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* eslint-disable require-await */
|
|
3
|
-
// @ts-check
|
|
4
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
4
|
};
|
|
7
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.LogMixin = void 0;
|
|
9
6
|
const lodash_1 = __importDefault(require("lodash"));
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
const mixin_1 = require("./mixin");
|
|
8
|
+
const LogCommands = {
|
|
9
|
+
supportedLogTypes: {},
|
|
10
|
+
async getLogTypes() {
|
|
11
|
+
this.log.debug('Retrieving supported log types');
|
|
12
|
+
return Object.keys(this.supportedLogTypes);
|
|
13
|
+
},
|
|
14
|
+
async getLog(logType) {
|
|
15
|
+
this.log.debug(`Retrieving '${String(logType)}' logs`);
|
|
16
|
+
if (!(logType in this.supportedLogTypes)) {
|
|
17
|
+
const logsTypesWithDescriptions = lodash_1.default.mapValues(this.supportedLogTypes, 'description');
|
|
18
|
+
throw new Error(`Unsupported log type '${String(logType)}'. ` +
|
|
19
|
+
`Supported types: ${JSON.stringify(logsTypesWithDescriptions)}`);
|
|
23
20
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @this {import('@appium/types').Driver<C>}
|
|
30
|
-
* @param {keyof typeof this.supportedLogTypes} logType
|
|
31
|
-
* @returns {Promise<import('type-fest').AsyncReturnType<typeof this.supportedLogTypes[keyof typeof this.supportedLogTypes]['getter']>>}
|
|
32
|
-
*/
|
|
33
|
-
async getLog(logType) {
|
|
34
|
-
this.log.debug(`Retrieving '${String(logType)}' logs`);
|
|
35
|
-
if (!(logType in this.supportedLogTypes)) {
|
|
36
|
-
const logsTypesWithDescriptions = lodash_1.default.mapValues(this.supportedLogTypes, 'description');
|
|
37
|
-
throw new Error(`Unsupported log type '${String(logType)}'. ` +
|
|
38
|
-
`Supported types: ${JSON.stringify(logsTypesWithDescriptions)}`);
|
|
39
|
-
}
|
|
40
|
-
return await this.supportedLogTypes[logType].getter(this);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return LogCommands;
|
|
44
|
-
}
|
|
45
|
-
exports.LogMixin = LogMixin;
|
|
46
|
-
/**
|
|
47
|
-
* @typedef {import('@appium/types').Constraints} Constraints
|
|
48
|
-
* @typedef {import('@appium/types').StringRecord} StringRecord
|
|
49
|
-
*/
|
|
50
|
-
/**
|
|
51
|
-
* @template {Constraints} C
|
|
52
|
-
* @typedef {import('@appium/types').ILogCommands<C>} ILogCommands
|
|
53
|
-
*/
|
|
54
|
-
/**
|
|
55
|
-
* @template {Constraints} C
|
|
56
|
-
* @typedef {import('../driver').BaseDriverBase<C, import('@appium/types').ITimeoutCommands & import('@appium/types').IEventCommands & import('@appium/types').IFindCommands & ILogCommands<C>>} LogBase
|
|
57
|
-
*/
|
|
21
|
+
return await this.supportedLogTypes[logType].getter(this);
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
(0, mixin_1.mixin)(LogCommands);
|
|
58
25
|
//# sourceMappingURL=log.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../../lib/basedriver/commands/log.
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../../lib/basedriver/commands/log.ts"],"names":[],"mappings":";;;;;AACA,oDAAuB;AAEvB,mCAA8B;AAM9B,MAAM,WAAW,GAAiB;IAChC,iBAAiB,EAAgB,EAAE;IAEnC,KAAK,CAAC,WAAW;QACf,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QACjD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,MAAM,CAEV,OAAgD;QAEhD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,eAAe,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAEvD,IAAI,CAAC,CAAC,OAAO,IAAI,IAAI,CAAC,iBAAiB,CAAC,EAAE;YACxC,MAAM,yBAAyB,GAAG,gBAAC,CAAC,SAAS,CAAC,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;YACrF,MAAM,IAAI,KAAK,CACb,yBAAyB,MAAM,CAAC,OAAO,CAAC,KAAK;gBAC3C,oBAAoB,IAAI,CAAC,SAAS,CAAC,yBAAyB,CAAC,EAAE,CAClE,CAAC;SACH;QAED,OAAO,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC;CACF,CAAC;AAEF,IAAA,aAAK,EAAC,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Constraints } from '@appium/types';
|
|
2
|
+
import { BaseDriver } from '../driver';
|
|
3
|
+
/**
|
|
4
|
+
* This function assigns a mixin `T` to the `FakeDriver` class' prototype.
|
|
5
|
+
* While each mixin has its own interface which is (in isolation) unrelated to `FakeDriver`, the constraint
|
|
6
|
+
* on this generic type `T` is that it must be a partial of `FakeDriver`'s interface. This enforces
|
|
7
|
+
* that it does not conflict with the existing interface of `FakeDriver`. In that way, you can
|
|
8
|
+
* think of it as a type guard.
|
|
9
|
+
* @param mixin Mixin implementation
|
|
10
|
+
*/
|
|
11
|
+
export declare function mixin<C extends Constraints, T extends Partial<BaseDriver<C>>>(mixin: T): void;
|
|
12
|
+
//# sourceMappingURL=mixin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mixin.d.ts","sourceRoot":"","sources":["../../../../lib/basedriver/commands/mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,UAAU,EAAC,MAAM,WAAW,CAAC;AAErC;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,SAAS,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAE7F"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mixin = void 0;
|
|
4
|
+
const driver_1 = require("../driver");
|
|
5
|
+
/**
|
|
6
|
+
* This function assigns a mixin `T` to the `FakeDriver` class' prototype.
|
|
7
|
+
* While each mixin has its own interface which is (in isolation) unrelated to `FakeDriver`, the constraint
|
|
8
|
+
* on this generic type `T` is that it must be a partial of `FakeDriver`'s interface. This enforces
|
|
9
|
+
* that it does not conflict with the existing interface of `FakeDriver`. In that way, you can
|
|
10
|
+
* think of it as a type guard.
|
|
11
|
+
* @param mixin Mixin implementation
|
|
12
|
+
*/
|
|
13
|
+
function mixin(mixin) {
|
|
14
|
+
Object.assign(driver_1.BaseDriver.prototype, mixin);
|
|
15
|
+
}
|
|
16
|
+
exports.mixin = mixin;
|
|
17
|
+
//# sourceMappingURL=mixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mixin.js","sourceRoot":"","sources":["../../../../lib/basedriver/commands/mixin.ts"],"names":[],"mappings":";;;AACA,sCAAqC;AAErC;;;;;;;GAOG;AACH,SAAgB,KAAK,CAA0D,KAAQ;IACrF,MAAM,CAAC,MAAM,CAAC,mBAAU,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AAC7C,CAAC;AAFD,sBAEC"}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export function SessionMixin<C extends Readonly<Record<string, import("@appium/types").Constraint>>>(Base: import("./settings").SettingsBase<C>): SessionBase<C>;
|
|
7
|
-
export type ISessionCommands = import('@appium/types').ISessionCommands;
|
|
8
|
-
export type SingularSessionData = import('@appium/types').SingularSessionData;
|
|
9
|
-
export type MultiSessionData = import('@appium/types').MultiSessionData;
|
|
10
|
-
export type Constraints = import('@appium/types').Constraints;
|
|
11
|
-
export type SessionBase<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> & import('@appium/types').ISettingsCommands & ISessionCommands>;
|
|
1
|
+
import { ISessionCommands } from '@appium/types';
|
|
2
|
+
declare module '../driver' {
|
|
3
|
+
interface BaseDriver<C extends Constraints> extends ISessionCommands {
|
|
4
|
+
}
|
|
5
|
+
}
|
|
12
6
|
//# sourceMappingURL=session.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../lib/basedriver/commands/session.
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../lib/basedriver/commands/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,gBAAgB,EAAmB,MAAM,eAAe,CAAC;AAI9E,OAAO,QAAQ,WAAW,CAAC;IACzB,UAAU,UAAU,CAAC,CAAC,SAAS,WAAW,CAAE,SAAQ,gBAAgB;KAAG;CACxE"}
|
|
@@ -1,51 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
const mixin_1 = require("./mixin");
|
|
4
|
+
const SessionCommands = {
|
|
5
|
+
async getSessions() {
|
|
6
|
+
const ret = [];
|
|
7
|
+
if (this.sessionId) {
|
|
8
|
+
ret.push({
|
|
9
|
+
id: this.sessionId,
|
|
10
|
+
capabilities: this.caps,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
return ret;
|
|
14
|
+
},
|
|
10
15
|
/**
|
|
11
|
-
*
|
|
16
|
+
* Returns capabilities for the session and event history (if applicable)
|
|
12
17
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*/
|
|
17
|
-
async getSessions() {
|
|
18
|
-
let ret = [];
|
|
19
|
-
if (this.sessionId) {
|
|
20
|
-
ret.push({
|
|
21
|
-
id: this.sessionId,
|
|
22
|
-
capabilities: this.caps,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
return ret;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Returns capabilities for the session and event history (if applicable)
|
|
29
|
-
* @returns {Promise<SingularSessionData>}
|
|
30
|
-
*/
|
|
31
|
-
async getSession() {
|
|
32
|
-
if (this.caps.eventTimings) {
|
|
33
|
-
return { ...this.caps, events: this.eventHistory };
|
|
34
|
-
}
|
|
35
|
-
return this.caps;
|
|
18
|
+
async getSession() {
|
|
19
|
+
if (this.caps.eventTimings) {
|
|
20
|
+
return { ...this.caps, events: this.eventHistory };
|
|
36
21
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @typedef {import('@appium/types').ISessionCommands} ISessionCommands
|
|
43
|
-
* @typedef {import('@appium/types').SingularSessionData} SingularSessionData
|
|
44
|
-
* @typedef {import('@appium/types').MultiSessionData} MultiSessionData
|
|
45
|
-
* @typedef {import('@appium/types').Constraints} Constraints
|
|
46
|
-
*/
|
|
47
|
-
/**
|
|
48
|
-
* @template {Constraints} C
|
|
49
|
-
* @typedef {import('../driver').BaseDriverBase<C, import('@appium/types').ITimeoutCommands & import('@appium/types').IEventCommands & import('@appium/types').IFindCommands & import('@appium/types').ILogCommands<C> & import('@appium/types').ISettingsCommands & ISessionCommands>} SessionBase
|
|
50
|
-
*/
|
|
22
|
+
return this.caps;
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
(0, mixin_1.mixin)(SessionCommands);
|
|
51
26
|
//# sourceMappingURL=session.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../../../lib/basedriver/commands/session.
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../../../lib/basedriver/commands/session.ts"],"names":[],"mappings":";;AAEA,mCAA8B;AAM9B,MAAM,eAAe,GAAqB;IACxC,KAAK,CAAC,WAAW;QACf,MAAM,GAAG,GAAuB,EAAE,CAAC;QAEnC,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,GAAG,CAAC,IAAI,CAAC;gBACP,EAAE,EAAE,IAAI,CAAC,SAAS;gBAClB,YAAY,EAAE,IAAI,CAAC,IAAI;aACxB,CAAC,CAAC;SACJ;QAED,OAAO,GAAG,CAAC;IACb,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU;QACd,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YAC1B,OAAO,EAAC,GAAG,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,YAAY,EAAC,CAAC;SAClD;QACD,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF,CAAC;AAEF,IAAA,aAAK,EAAC,eAAe,CAAC,CAAC"}
|
|
@@ -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 { 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,iBAAiB,EAAe,MAAM,eAAe,CAAC;AAG3E,OAAO,QAAQ,WAAW,CAAC;IACzB,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;AAM9B,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 { 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":"AASA,OAAO,EAAc,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAG5D,OAAO,QAAQ,WAAW,CAAC;IACzB,UAAU,UAAU,CAAC,CAAC,SAAS,WAAW,CAAE,SAAQ,gBAAgB;KAAG;CACxE"}
|