@appium/fake-driver 5.1.5 → 5.2.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/LICENSE +1 -1
- package/build/lib/commands/alert.d.ts +12 -77
- package/build/lib/commands/alert.d.ts.map +1 -1
- package/build/lib/commands/alert.js +3 -23
- package/build/lib/commands/alert.js.map +1 -1
- package/build/lib/commands/contexts.d.ts +12 -81
- package/build/lib/commands/contexts.d.ts.map +1 -1
- package/build/lib/commands/contexts.js +8 -28
- package/build/lib/commands/contexts.js.map +1 -1
- package/build/lib/commands/element.d.ts +25 -145
- package/build/lib/commands/element.d.ts.map +1 -1
- package/build/lib/commands/element.js +24 -76
- package/build/lib/commands/element.js.map +1 -1
- package/build/lib/commands/find.d.ts +16 -84
- package/build/lib/commands/find.d.ts.map +1 -1
- package/build/lib/commands/find.js +21 -45
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/general.d.ts +25 -173
- package/build/lib/commands/general.d.ts.map +1 -1
- package/build/lib/commands/general.js +3 -61
- package/build/lib/commands/general.js.map +1 -1
- package/build/lib/commands/index.d.ts +13 -5
- package/build/lib/commands/index.d.ts.map +1 -1
- package/build/lib/commands/index.js +26 -13
- package/build/lib/commands/index.js.map +1 -1
- package/build/lib/commands/mixin.d.ts +11 -0
- package/build/lib/commands/mixin.d.ts.map +1 -0
- package/build/lib/commands/mixin.js +17 -0
- package/build/lib/commands/mixin.js.map +1 -0
- package/build/lib/driver.d.ts +38 -93
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +27 -74
- package/build/lib/driver.js.map +1 -1
- package/build/lib/fake-app.d.ts +9 -7
- package/build/lib/fake-app.d.ts.map +1 -1
- package/build/lib/fake-app.js +2 -0
- package/build/lib/fake-app.js.map +1 -1
- package/build/lib/fake-element.d.ts +12 -4
- package/build/lib/fake-element.d.ts.map +1 -1
- package/build/lib/fake-element.js +11 -4
- package/build/lib/fake-element.js.map +1 -1
- package/build/lib/scripts/fake-error.d.ts +1 -0
- package/build/lib/scripts/fake-error.js +11 -1
- package/build/lib/scripts/fake-error.js.map +1 -1
- package/build/lib/scripts/fake-stdin.d.ts +2 -0
- package/build/lib/scripts/fake-stdin.d.ts.map +1 -0
- package/build/lib/scripts/fake-stdin.js +13 -0
- package/build/lib/scripts/fake-stdin.js.map +1 -0
- package/build/lib/types.d.ts +2 -2
- package/build/lib/types.d.ts.map +1 -1
- package/lib/commands/alert.ts +70 -0
- package/lib/commands/{contexts.js → contexts.ts} +26 -34
- package/lib/commands/element.ts +138 -0
- package/lib/commands/find.ts +137 -0
- package/lib/commands/general.ts +115 -0
- package/lib/commands/{index.js → index.ts} +14 -5
- package/lib/commands/mixin.ts +13 -0
- package/lib/driver.js +43 -79
- package/lib/fake-app.js +3 -3
- package/lib/fake-element.js +21 -6
- package/lib/scripts/fake-error.js +8 -1
- package/lib/scripts/fake-stdin.js +9 -0
- package/package.json +4 -3
- package/lib/commands/alert.js +0 -73
- package/lib/commands/element.js +0 -161
- package/lib/commands/find.js +0 -118
- package/lib/commands/general.js +0 -147
|
@@ -1,93 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const driver_1 = require("appium/driver");
|
|
4
|
+
const mixin_1 = require("./mixin");
|
|
4
5
|
const ORIENTATIONS = new Set(['LANDSCAPE', 'PORTRAIT']);
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @this {FakeDriver}
|
|
8
|
-
*/
|
|
6
|
+
const GeneralMixin = {
|
|
9
7
|
async title() {
|
|
10
8
|
this.assertWebviewContext();
|
|
11
9
|
return this.appModel.title;
|
|
12
10
|
},
|
|
13
|
-
/**
|
|
14
|
-
* @this {FakeDriver}
|
|
15
|
-
*/
|
|
16
11
|
async keys(value) {
|
|
17
12
|
if (!this.focusedElId) {
|
|
18
13
|
throw new driver_1.errors.InvalidElementStateError();
|
|
19
14
|
}
|
|
20
15
|
await this.setValue(value, this.focusedElId);
|
|
21
16
|
},
|
|
22
|
-
/**
|
|
23
|
-
* @this {FakeDriver}
|
|
24
|
-
*/
|
|
25
17
|
async setGeoLocation(location) {
|
|
26
18
|
// TODO test this adequately once WD bug is fixed
|
|
27
19
|
this.appModel.lat = location.latitude;
|
|
28
20
|
this.appModel.long = location.longitude;
|
|
29
21
|
},
|
|
30
|
-
/**
|
|
31
|
-
* @this {FakeDriver}
|
|
32
|
-
*/
|
|
33
22
|
async getGeoLocation() {
|
|
34
23
|
return this.appModel.currentGeoLocation;
|
|
35
24
|
},
|
|
36
|
-
/**
|
|
37
|
-
* @this {FakeDriver}
|
|
38
|
-
*/
|
|
39
25
|
async getPageSource() {
|
|
40
26
|
return this.appModel.rawXml;
|
|
41
27
|
},
|
|
42
|
-
/**
|
|
43
|
-
* @this {FakeDriver}
|
|
44
|
-
*/
|
|
45
28
|
async getOrientation() {
|
|
46
29
|
return this.appModel.orientation;
|
|
47
30
|
},
|
|
48
|
-
/**
|
|
49
|
-
*
|
|
50
|
-
* @param {import('../types').FakeDriverCaps['orientation']} o
|
|
51
|
-
* @this {FakeDriver}
|
|
52
|
-
*/
|
|
53
31
|
async setOrientation(o) {
|
|
54
32
|
if (!ORIENTATIONS.has(o)) {
|
|
55
33
|
throw new driver_1.errors.UnknownError('Orientation must be LANDSCAPE or PORTRAIT');
|
|
56
34
|
}
|
|
57
35
|
this.appModel.orientation = o;
|
|
58
36
|
},
|
|
59
|
-
/**
|
|
60
|
-
* @this {FakeDriver}
|
|
61
|
-
*/
|
|
62
37
|
async getScreenshot() {
|
|
63
38
|
return this.appModel.getScreenshot();
|
|
64
39
|
},
|
|
65
|
-
/**
|
|
66
|
-
* @this {FakeDriver}
|
|
67
|
-
*/
|
|
68
40
|
async getWindowSize() {
|
|
69
41
|
return { width: this.appModel.width, height: this.appModel.height };
|
|
70
42
|
},
|
|
71
|
-
/**
|
|
72
|
-
* @this {FakeDriver}
|
|
73
|
-
*/
|
|
74
43
|
async getWindowRect() {
|
|
75
44
|
return { width: this.appModel.width, height: this.appModel.height, x: 0, y: 0 };
|
|
76
45
|
},
|
|
77
|
-
/**
|
|
78
|
-
*
|
|
79
|
-
* @this {FakeDriver}
|
|
80
|
-
*/
|
|
81
46
|
async performActions(actions) {
|
|
82
47
|
this.appModel.actionLog.push(actions);
|
|
83
48
|
},
|
|
84
|
-
/**
|
|
85
|
-
* @this {FakeDriver}
|
|
86
|
-
*/
|
|
87
49
|
async releaseActions() { },
|
|
88
|
-
/**
|
|
89
|
-
* @this {FakeDriver}
|
|
90
|
-
*/
|
|
91
50
|
async getLog(type) {
|
|
92
51
|
switch (type) {
|
|
93
52
|
case 'actions':
|
|
@@ -96,36 +55,19 @@ exports.default = {
|
|
|
96
55
|
throw new Error(`Don't understand log type '${type}'`);
|
|
97
56
|
}
|
|
98
57
|
},
|
|
99
|
-
/**
|
|
100
|
-
* @this {FakeDriver}
|
|
101
|
-
*/
|
|
102
58
|
async mobileShake() {
|
|
103
59
|
this.shook = true;
|
|
104
60
|
},
|
|
105
|
-
/**
|
|
106
|
-
* @this {FakeDriver}
|
|
107
|
-
*/
|
|
108
61
|
async doubleClick() { },
|
|
109
|
-
/**
|
|
110
|
-
* @this {FakeDriver}
|
|
111
|
-
*/
|
|
112
62
|
async execute(script, args) {
|
|
113
63
|
return await this.executeMethod(script, args);
|
|
114
64
|
},
|
|
115
65
|
/**
|
|
116
66
|
* Add two or maybe even three numbers
|
|
117
|
-
*
|
|
118
|
-
* @param {number} num1
|
|
119
|
-
* @param {number} num2
|
|
120
|
-
* @param {number} [num3]
|
|
121
|
-
* @returns {Promise<number>}
|
|
122
|
-
* @this {FakeDriver}
|
|
123
67
|
*/
|
|
124
68
|
async fakeAddition(num1, num2, num3 = 0) {
|
|
125
69
|
return num1 + num2 + (num3 ?? 0);
|
|
126
70
|
},
|
|
127
71
|
};
|
|
128
|
-
|
|
129
|
-
* @typedef {import('../driver').FakeDriver} FakeDriver
|
|
130
|
-
*/
|
|
72
|
+
(0, mixin_1.mixin)(GeneralMixin);
|
|
131
73
|
//# sourceMappingURL=general.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general.js","sourceRoot":"","sources":["../../../lib/commands/general.
|
|
1
|
+
{"version":3,"file":"general.js","sourceRoot":"","sources":["../../../lib/commands/general.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Export all of the "stuff" from these mixin files. The mixins themselves are not exported,
|
|
3
|
+
* but any types/interfaces that they export (e.g., options objects for some command) are exported.
|
|
4
|
+
*
|
|
5
|
+
* Mixins must not use `Object.assign()` and are expected to use the `mixin` function in the sibling
|
|
6
|
+
* `mixin` module.
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
export * from './alert';
|
|
10
|
+
export * from './contexts';
|
|
11
|
+
export * from './element';
|
|
12
|
+
export * from './find';
|
|
13
|
+
export * from './general';
|
|
6
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/commands/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/commands/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC"}
|
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Export all of the "stuff" from these mixin files. The mixins themselves are not exported,
|
|
4
|
+
* but any types/interfaces that they export (e.g., options objects for some command) are exported.
|
|
5
|
+
*
|
|
6
|
+
* Mixins must not use `Object.assign()` and are expected to use the `mixin` function in the sibling
|
|
7
|
+
* `mixin` module.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}) : (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
o[k2] = m[k];
|
|
20
|
+
}));
|
|
21
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
22
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
4
23
|
};
|
|
5
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var element_1 = require("./element");
|
|
12
|
-
Object.defineProperty(exports, "element", { enumerable: true, get: function () { return __importDefault(element_1).default; } });
|
|
13
|
-
var find_1 = require("./find");
|
|
14
|
-
Object.defineProperty(exports, "find", { enumerable: true, get: function () { return __importDefault(find_1).default; } });
|
|
15
|
-
var general_1 = require("./general");
|
|
16
|
-
Object.defineProperty(exports, "general", { enumerable: true, get: function () { return __importDefault(general_1).default; } });
|
|
25
|
+
__exportStar(require("./alert"), exports);
|
|
26
|
+
__exportStar(require("./contexts"), exports);
|
|
27
|
+
__exportStar(require("./element"), exports);
|
|
28
|
+
__exportStar(require("./find"), exports);
|
|
29
|
+
__exportStar(require("./general"), exports);
|
|
17
30
|
/* // TODO:
|
|
18
31
|
//rest.post('/wd/hub/session/:sessionId?/touch/click', controller.doClick);
|
|
19
32
|
//rest.post('/wd/hub/session/:sessionId?/touch/longclick', controller.touchLongClick);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/commands/index.
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/commands/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,6CAA2B;AAC3B,4CAA0B;AAC1B,yCAAuB;AACvB,4CAA0B;AAE1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsFE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FakeDriver } from '../driver';
|
|
2
|
+
/**
|
|
3
|
+
* This function assigns a mixin `T` to the `FakeDriver` class' prototype.
|
|
4
|
+
* While each mixin has its own interface which is (in isolation) unrelated to `FakeDriver`, the constraint
|
|
5
|
+
* on this generic type `T` is that it must be a partial of `FakeDriver`'s interface. This enforces
|
|
6
|
+
* that it does not conflict with the existing interface of `FakeDriver`. In that way, you can
|
|
7
|
+
* think of it as a type guard.
|
|
8
|
+
* @param mixin Mixin implementation
|
|
9
|
+
*/
|
|
10
|
+
export declare function mixin<T extends Partial<FakeDriver>>(mixin: T): void;
|
|
11
|
+
//# sourceMappingURL=mixin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mixin.d.ts","sourceRoot":"","sources":["../../../lib/commands/mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,WAAW,CAAC;AAErC;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,OAAO,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAEnE"}
|
|
@@ -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.FakeDriver.prototype, mixin);
|
|
15
|
+
}
|
|
16
|
+
exports.mixin = mixin;
|
|
17
|
+
//# sourceMappingURL=mixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mixin.js","sourceRoot":"","sources":["../../../lib/commands/mixin.ts"],"names":[],"mappings":";;;AAAA,sCAAqC;AAErC;;;;;;;GAOG;AACH,SAAgB,KAAK,CAAgC,KAAQ;IAC3D,MAAM,CAAC,MAAM,CAAC,mBAAU,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AAC7C,CAAC;AAFD,sBAEC"}
|
package/build/lib/driver.d.ts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
+
declare const FakeDriver_base: typeof BaseDriver;
|
|
2
|
+
declare const FakeDriver_base_1: typeof BaseDriver;
|
|
3
|
+
declare const FakeDriver_base_2: typeof BaseDriver;
|
|
4
|
+
declare const FakeDriver_base_3: typeof BaseDriver;
|
|
5
|
+
declare const FakeDriver_base_4: typeof BaseDriver;
|
|
1
6
|
/**
|
|
7
|
+
* Constraints for {@linkcode FakeDriver}'s capabilites
|
|
2
8
|
* @typedef {typeof FAKE_DRIVER_CONSTRAINTS} FakeDriverConstraints
|
|
3
9
|
*/
|
|
4
10
|
/**
|
|
11
|
+
* @template [Thing=any]
|
|
5
12
|
* @extends {BaseDriver<FakeDriverConstraints>}
|
|
6
13
|
* @implements {ExternalDriver<FakeDriverConstraints>}
|
|
7
14
|
*/
|
|
8
|
-
export class FakeDriver extends BaseDriver<{
|
|
15
|
+
export class FakeDriver<Thing = any> extends BaseDriver<{
|
|
9
16
|
readonly app: {
|
|
10
17
|
readonly presence: true;
|
|
11
18
|
readonly isString: true;
|
|
@@ -13,7 +20,7 @@ export class FakeDriver extends BaseDriver<{
|
|
|
13
20
|
readonly uniqueApp: {
|
|
14
21
|
readonly isBoolean: true;
|
|
15
22
|
};
|
|
16
|
-
}
|
|
23
|
+
}, import("@appium/types").StringRecord>, FakeDriver_base, FakeDriver_base_1, FakeDriver_base_2, FakeDriver_base_3, FakeDriver_base_4 implements ExternalDriver<FakeDriverConstraints> {
|
|
17
24
|
static newMethodMap: {
|
|
18
25
|
readonly '/session/:sessionId/fakedriver': {
|
|
19
26
|
readonly GET: {
|
|
@@ -72,8 +79,7 @@ export class FakeDriver extends BaseDriver<{
|
|
|
72
79
|
};
|
|
73
80
|
static fakeRoute(req: any, res: any): void;
|
|
74
81
|
static updateServer(expressApp: any, httpServer: any, cliArgs: any): Promise<void>;
|
|
75
|
-
constructor(opts?: {
|
|
76
|
-
desiredCapConstraints: {
|
|
82
|
+
constructor(opts?: import("@appium/types").DriverOpts<{
|
|
77
83
|
readonly app: {
|
|
78
84
|
readonly presence: true;
|
|
79
85
|
readonly isString: true;
|
|
@@ -81,16 +87,28 @@ export class FakeDriver extends BaseDriver<{
|
|
|
81
87
|
readonly uniqueApp: {
|
|
82
88
|
readonly isBoolean: true;
|
|
83
89
|
};
|
|
84
|
-
};
|
|
90
|
+
}>, shouldValidateCaps?: boolean);
|
|
91
|
+
/**
|
|
92
|
+
* @type {FakeDriverConstraints}
|
|
93
|
+
* @readonly
|
|
94
|
+
*/
|
|
95
|
+
readonly desiredCapConstraints: FakeDriverConstraints;
|
|
85
96
|
/** @type {string} */
|
|
86
97
|
curContext: string;
|
|
98
|
+
/** @type {FakeApp} */
|
|
87
99
|
appModel: FakeApp;
|
|
88
|
-
|
|
89
|
-
focusedElId: any;
|
|
90
|
-
maxElId: number;
|
|
91
|
-
fakeThing: any;
|
|
100
|
+
/** @type {boolean} */
|
|
92
101
|
_proxyActive: boolean;
|
|
102
|
+
/** @type {boolean} */
|
|
93
103
|
shook: boolean;
|
|
104
|
+
/** @type {string?} */
|
|
105
|
+
focusedElId: string | null;
|
|
106
|
+
/** @type {Thing?} */
|
|
107
|
+
fakeThing: Thing | null;
|
|
108
|
+
/** @type {number} */
|
|
109
|
+
maxElId: number;
|
|
110
|
+
/** @type {Record<string,import('./fake-element').FakeElement>} */
|
|
111
|
+
elMap: Record<string, import('./fake-element').FakeElement>;
|
|
94
112
|
proxyActive(): boolean;
|
|
95
113
|
canProxy(): boolean;
|
|
96
114
|
proxyReqRes(req: any, res: any): void;
|
|
@@ -106,7 +124,7 @@ export class FakeDriver extends BaseDriver<{
|
|
|
106
124
|
* @param {W3CFakeDriverCaps} [w3cCapabilities3] W3C Capabilities
|
|
107
125
|
* @param {import('@appium/types').DriverData[]} [driverData] Other session data
|
|
108
126
|
* @override
|
|
109
|
-
* @returns {Promise<[string,FakeDriverCaps]>}
|
|
127
|
+
* @returns {Promise<[string,FakeDriverCaps]>}
|
|
110
128
|
*/
|
|
111
129
|
override createSession(w3cCapabilities1: W3CFakeDriverCaps, w3cCapabilities2?: import("./types").W3CFakeDriverCaps | undefined, w3cCapabilities3?: import("./types").W3CFakeDriverCaps | undefined, driverData?: import("@appium/types").DriverData[] | undefined): Promise<[string, Partial<import("@appium/types").ConstraintsToCaps<typeof import("@appium/types").BASE_DESIRED_CAP_CONSTRAINTS & {
|
|
112
130
|
readonly app: {
|
|
@@ -120,14 +138,14 @@ export class FakeDriver extends BaseDriver<{
|
|
|
120
138
|
get driverData(): {
|
|
121
139
|
isUnique: boolean;
|
|
122
140
|
};
|
|
123
|
-
getFakeThing(): Promise<
|
|
141
|
+
getFakeThing(): Promise<Thing | null>;
|
|
124
142
|
/**
|
|
125
143
|
* Set the 'thing' value (so that it can be retrieved later)
|
|
126
144
|
*
|
|
127
|
-
* @param {
|
|
145
|
+
* @param {Thing} thing
|
|
128
146
|
* @returns {Promise<null>}
|
|
129
147
|
*/
|
|
130
|
-
setFakeThing(thing:
|
|
148
|
+
setFakeThing(thing: Thing): Promise<null>;
|
|
131
149
|
/**
|
|
132
150
|
* Get the driver args that were sent in via the CLI
|
|
133
151
|
*
|
|
@@ -146,92 +164,19 @@ export class FakeDriver extends BaseDriver<{
|
|
|
146
164
|
* @returns {Promise<void>}
|
|
147
165
|
*/
|
|
148
166
|
callDeprecatedCommand(): Promise<void>;
|
|
149
|
-
/*********
|
|
150
|
-
* ALERT *
|
|
151
|
-
*********/
|
|
152
|
-
assertNoAlert: (this: FakeDriver) => void;
|
|
153
|
-
assertAlert: (this: FakeDriver) => void;
|
|
154
|
-
getAlertText: (this: FakeDriver) => Promise<string>;
|
|
155
|
-
setAlertText: (this: FakeDriver, text: string) => Promise<void>;
|
|
156
|
-
postAcceptAlert: (this: FakeDriver) => Promise<void>;
|
|
157
|
-
postDismissAlert: (this: FakeDriver) => Promise<void>;
|
|
158
|
-
/************
|
|
159
|
-
* CONTEXTS *
|
|
160
|
-
************/
|
|
161
|
-
getRawContexts: (this: FakeDriver) => {
|
|
162
|
-
NATIVE_APP: null;
|
|
163
|
-
PROXY: null;
|
|
164
|
-
};
|
|
165
|
-
assertWebviewContext: (this: FakeDriver) => void;
|
|
166
|
-
getCurrentContext: (this: FakeDriver) => Promise<string>;
|
|
167
|
-
getContexts: (this: FakeDriver) => Promise<string[]>;
|
|
168
|
-
setContext: (this: FakeDriver, context: string) => Promise<void>;
|
|
169
|
-
setFrame: (this: FakeDriver, frameId: number) => Promise<void>;
|
|
170
|
-
/************
|
|
171
|
-
* ELEMENTS *
|
|
172
|
-
************/
|
|
173
|
-
getElements: (this: FakeDriver, elIds: any) => any;
|
|
174
|
-
getElement: (this: FakeDriver, elId: any) => any;
|
|
175
|
-
getName: (this: FakeDriver, elementId: any) => Promise<any>;
|
|
176
|
-
elementDisplayed: (this: FakeDriver, elementId: any) => Promise<any>;
|
|
177
|
-
elementEnabled: (this: FakeDriver, elementId: any) => Promise<any>;
|
|
178
|
-
elementSelected: (this: FakeDriver, elementId: any) => Promise<any>;
|
|
179
|
-
setValue: (this: FakeDriver, keys: any, elementId: any) => Promise<void>;
|
|
180
|
-
getText: (this: FakeDriver, elementId: any) => Promise<any>;
|
|
181
|
-
clear: (this: FakeDriver, elementId: any) => Promise<void>;
|
|
182
|
-
click: (this: FakeDriver, elementId: string) => Promise<void>;
|
|
183
|
-
getAttribute: (this: FakeDriver, attr: any, elementId: any) => Promise<any>;
|
|
184
|
-
getElementRect: (this: FakeDriver, elementId: any) => any;
|
|
185
|
-
getSize: (this: FakeDriver, elementId: any) => any;
|
|
186
|
-
equalsElement: (this: FakeDriver, el1Id: any, el2Id: any) => any;
|
|
187
|
-
getCssProperty: (this: FakeDriver, prop: any, elementId: any) => Promise<any>;
|
|
188
|
-
getLocation: (this: FakeDriver, elementId: string) => Promise<any>;
|
|
189
|
-
getLocationInView: (this: FakeDriver, elementId: any) => Promise<any>;
|
|
190
|
-
/********
|
|
191
|
-
* FIND *
|
|
192
|
-
********/
|
|
193
|
-
getExistingElementForNode: (this: FakeDriver, node: any) => string | null;
|
|
194
|
-
wrapNewEl: (this: FakeDriver, obj: any) => {
|
|
195
|
-
ELEMENT: string;
|
|
196
|
-
};
|
|
197
|
-
findElOrEls: <Mult extends boolean, Ctx = any>(this: FakeDriver, strategy: string, selector: string, mult: Mult, context?: Ctx | undefined) => Promise<Mult extends true ? import("@appium/types").Element[] : import("@appium/types").Element>;
|
|
198
|
-
findElements: (this: FakeDriver, strategy: any, selector: any) => Promise<import("@appium/types").Element[]>;
|
|
199
|
-
findElementFromElement: (this: FakeDriver, strategy: any, selector: any, elementId: any) => Promise<import("@appium/types").Element>;
|
|
200
|
-
findElementsFromElement: (this: FakeDriver, strategy: any, selector: any, elementId: any) => Promise<import("@appium/types").Element[]>;
|
|
201
|
-
/***********
|
|
202
|
-
* GENERAL *
|
|
203
|
-
***********/
|
|
204
|
-
title: (this: FakeDriver) => Promise<any>;
|
|
205
|
-
keys: (this: FakeDriver, value: any) => Promise<void>;
|
|
206
|
-
setGeoLocation: (this: FakeDriver, location: any) => Promise<void>;
|
|
207
|
-
getGeoLocation: (this: FakeDriver) => Promise<import("@appium/types").Location>;
|
|
208
|
-
getOrientation: (this: FakeDriver) => Promise<string>;
|
|
209
|
-
setOrientation: (this: FakeDriver, o: any) => Promise<void>;
|
|
210
|
-
getScreenshot: (this: FakeDriver) => Promise<string>;
|
|
211
|
-
getWindowSize: (this: FakeDriver) => Promise<{
|
|
212
|
-
width: number;
|
|
213
|
-
height: number;
|
|
214
|
-
}>;
|
|
215
|
-
getWindowRect: (this: FakeDriver) => Promise<{
|
|
216
|
-
width: number;
|
|
217
|
-
height: number;
|
|
218
|
-
x: number;
|
|
219
|
-
y: number;
|
|
220
|
-
}>;
|
|
221
|
-
performActions: (this: FakeDriver, actions: any) => Promise<void>;
|
|
222
|
-
getLog: (this: FakeDriver, type: any) => Promise<any[]>;
|
|
223
|
-
mobileShake: (this: FakeDriver) => Promise<void>;
|
|
224
|
-
doubleClick: (this: FakeDriver) => Promise<void>;
|
|
225
|
-
execute: (this: FakeDriver, script: any, args: any) => Promise<any>;
|
|
226
|
-
fakeAddition: (this: FakeDriver, num1: number, num2: number, num3?: number | undefined) => Promise<number>;
|
|
227
|
-
releaseActions: (this: FakeDriver) => Promise<void>;
|
|
228
167
|
}
|
|
168
|
+
export * from "./commands";
|
|
229
169
|
export default FakeDriver;
|
|
170
|
+
/**
|
|
171
|
+
* Constraints for {@linkcode FakeDriver }'s capabilites
|
|
172
|
+
*/
|
|
230
173
|
export type FakeDriverConstraints = typeof FAKE_DRIVER_CONSTRAINTS;
|
|
231
174
|
export type FakeDriverCaps = import('./types').FakeDriverCaps;
|
|
232
175
|
export type W3CFakeDriverCaps = import('./types').W3CFakeDriverCaps;
|
|
233
|
-
export type
|
|
176
|
+
export type Element = import('@appium/types').Element;
|
|
177
|
+
export type DriverClass<D extends import("@appium/types").Driver<Readonly<Record<string, import("@appium/types").Constraint>>, import("@appium/types").StringRecord>> = import('@appium/types').DriverClass<D>;
|
|
234
178
|
export type ExternalDriver<C extends Readonly<Record<string, import("@appium/types").Constraint>>> = import('@appium/types').ExternalDriver<C>;
|
|
179
|
+
export type Orientation = import('@appium/types').Orientation;
|
|
235
180
|
import { BaseDriver } from "@appium/base-driver";
|
|
236
181
|
import { FakeApp } from "./fake-app";
|
|
237
182
|
declare namespace FAKE_DRIVER_CONSTRAINTS {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../lib/driver.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../lib/driver.js"],"names":[],"mappings":";;;;;AAeA;;;GAGG;AAEH;;;;GAIG;AACH;;;;;;;;gKAF+B,qBAAqB;IA8JlD;;;;;YAGI;;eAEG;;;;;;;;;;;;;;;;;;;;;;;;MAaJ;IAEH;;;;;;;;QAKE;;WAEG;;;;;;;;;;;;;MAWF;IAEH,2CAEC;IAED,mFAMC;IA/KD;;;;;;;;sCAcC;IA5CD;;;OAGG;IACH,gCAHU,qBAAqB,CAGT;IAEtB,qBAAqB;IACrB,YADW,MAAM,CACN;IAEX,sBAAsB;IACtB,UADW,OAAO,CACT;IAET,sBAAsB;IACtB,cADW,OAAO,CACL;IAEb,sBAAsB;IACtB,OADW,OAAO,CACZ;IAEN,sBAAsB;IACtB,aADW,MAAM,QACL;IAEZ,qBAAqB;IACrB,WADW,KAAK,QACN;IAEV,qBAAqB;IACrB,SADW,MAAM,CACT;IAER,kEAAkE;IAClE,OADW,OAAO,MAAM,EAAC,OAAO,gBAAgB,EAAE,WAAW,CAAC,CACxD;IAkBN,uBAEC;IAED,oBAEC;IAED,sCAOC;IAED;;;OAGG;IACH,oCAEC;IAED;;;;;;;;OAQG;IACH,yCAPW,iBAAiB;;;;;;;;iBA4B3B;IAED;;MAIC;IAED,sCAGC;IAED;;;;;OAKG;IACH,oBAHW,KAAK,GACH,QAAQ,IAAI,CAAC,CAMzB;IAED;;;;OAIG;IACH,qBAFa,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC,CAKxC;IAED;;;;OAIG;IACH,+BAFa,QAAQ,MAAM,EAAE,CAAC,CAK7B;IAED;;;;OAIG;IACH,yBAFa,QAAQ,IAAI,CAAC,CAIzB;CAqDF;;;;;;oCAvNY,8BAA8B;6BA+N9B,OAAO,SAAS,EAAE,cAAc;gCAChC,OAAO,SAAS,EAAE,iBAAiB;sBACnC,OAAO,eAAe,EAAE,OAAO;wKAK/B,OAAO,eAAe,EAAE,WAAW,CAAC,CAAC,CAAC;qGAKtC,OAAO,eAAe,EAAE,cAAc,CAAC,CAAC,CAAC;0BAIzC,OAAO,eAAe,EAAE,WAAW"}
|
package/build/lib/driver.js
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
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);
|
|
15
|
+
};
|
|
2
16
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
18
|
};
|
|
@@ -8,7 +22,6 @@ const bluebird_1 = __importDefault(require("bluebird"));
|
|
|
8
22
|
const driver_1 = require("appium/driver");
|
|
9
23
|
const protocol_1 = require("@appium/base-driver/build/lib/protocol/protocol");
|
|
10
24
|
const fake_app_1 = require("./fake-app");
|
|
11
|
-
const commands_1 = require("./commands");
|
|
12
25
|
const FAKE_DRIVER_CONSTRAINTS = /** @type {const} */ ({
|
|
13
26
|
app: {
|
|
14
27
|
presence: true,
|
|
@@ -19,85 +32,17 @@ const FAKE_DRIVER_CONSTRAINTS = /** @type {const} */ ({
|
|
|
19
32
|
},
|
|
20
33
|
});
|
|
21
34
|
/**
|
|
35
|
+
* Constraints for {@linkcode FakeDriver}'s capabilites
|
|
22
36
|
* @typedef {typeof FAKE_DRIVER_CONSTRAINTS} FakeDriverConstraints
|
|
23
37
|
*/
|
|
24
38
|
/**
|
|
39
|
+
* @template [Thing=any]
|
|
25
40
|
* @extends {BaseDriver<FakeDriverConstraints>}
|
|
26
41
|
* @implements {ExternalDriver<FakeDriverConstraints>}
|
|
27
42
|
*/
|
|
28
43
|
class FakeDriver extends driver_1.BaseDriver {
|
|
29
|
-
constructor(opts = {}, shouldValidateCaps = true) {
|
|
44
|
+
constructor(opts = /** @type {import('@appium/types').DriverOpts<FakeDriverConstraints>} */ ({}), shouldValidateCaps = true) {
|
|
30
45
|
super(opts, shouldValidateCaps);
|
|
31
|
-
this.desiredCapConstraints = FAKE_DRIVER_CONSTRAINTS;
|
|
32
|
-
this.appModel = new fake_app_1.FakeApp();
|
|
33
|
-
/*********
|
|
34
|
-
* ALERT *
|
|
35
|
-
*********/
|
|
36
|
-
this.assertNoAlert = commands_1.alert.assertNoAlert;
|
|
37
|
-
this.assertAlert = commands_1.alert.assertAlert;
|
|
38
|
-
this.getAlertText = commands_1.alert.getAlertText;
|
|
39
|
-
this.setAlertText = commands_1.alert.setAlertText;
|
|
40
|
-
this.postAcceptAlert = commands_1.alert.postAcceptAlert;
|
|
41
|
-
this.postDismissAlert = commands_1.alert.postDismissAlert;
|
|
42
|
-
/************
|
|
43
|
-
* CONTEXTS *
|
|
44
|
-
************/
|
|
45
|
-
this.getRawContexts = commands_1.contexts.getRawContexts;
|
|
46
|
-
this.assertWebviewContext = commands_1.contexts.assertWebviewContext;
|
|
47
|
-
this.getCurrentContext = commands_1.contexts.getCurrentContext;
|
|
48
|
-
this.getContexts = commands_1.contexts.getContexts;
|
|
49
|
-
this.setContext = commands_1.contexts.setContext;
|
|
50
|
-
this.setFrame = commands_1.contexts.setFrame;
|
|
51
|
-
/************
|
|
52
|
-
* ELEMENTS *
|
|
53
|
-
************/
|
|
54
|
-
this.getElements = commands_1.element.getElements;
|
|
55
|
-
this.getElement = commands_1.element.getElement;
|
|
56
|
-
this.getName = commands_1.element.getName;
|
|
57
|
-
this.elementDisplayed = commands_1.element.elementDisplayed;
|
|
58
|
-
this.elementEnabled = commands_1.element.elementEnabled;
|
|
59
|
-
this.elementSelected = commands_1.element.elementSelected;
|
|
60
|
-
this.setValue = commands_1.element.setValue;
|
|
61
|
-
this.getText = commands_1.element.getText;
|
|
62
|
-
this.clear = commands_1.element.clear;
|
|
63
|
-
this.click = commands_1.element.click;
|
|
64
|
-
this.getAttribute = commands_1.element.getAttribute;
|
|
65
|
-
this.getElementRect = commands_1.element.getElementRect;
|
|
66
|
-
this.getSize = commands_1.element.getSize;
|
|
67
|
-
this.equalsElement = commands_1.element.equalsElement;
|
|
68
|
-
this.getCssProperty = commands_1.element.getCssProperty;
|
|
69
|
-
this.getLocation = commands_1.element.getLocation;
|
|
70
|
-
this.getLocationInView = commands_1.element.getLocationInView;
|
|
71
|
-
/********
|
|
72
|
-
* FIND *
|
|
73
|
-
********/
|
|
74
|
-
this.getExistingElementForNode = commands_1.find.getExistingElementForNode;
|
|
75
|
-
this.wrapNewEl = commands_1.find.wrapNewEl;
|
|
76
|
-
this.findElOrEls = commands_1.find.findElOrEls;
|
|
77
|
-
this.findElement = commands_1.find.findElement;
|
|
78
|
-
this.findElements = commands_1.find.findElements;
|
|
79
|
-
this.findElementFromElement = commands_1.find.findElementFromElement;
|
|
80
|
-
this.findElementsFromElement = commands_1.find.findElementsFromElement;
|
|
81
|
-
/***********
|
|
82
|
-
* GENERAL *
|
|
83
|
-
***********/
|
|
84
|
-
this.title = commands_1.general.title;
|
|
85
|
-
this.keys = commands_1.general.keys;
|
|
86
|
-
this.setGeoLocation = commands_1.general.setGeoLocation;
|
|
87
|
-
this.getGeoLocation = commands_1.general.getGeoLocation;
|
|
88
|
-
this.getPageSource = commands_1.general.getPageSource;
|
|
89
|
-
this.getOrientation = commands_1.general.getOrientation;
|
|
90
|
-
this.setOrientation = commands_1.general.setOrientation;
|
|
91
|
-
this.getScreenshot = commands_1.general.getScreenshot;
|
|
92
|
-
this.getWindowSize = commands_1.general.getWindowSize;
|
|
93
|
-
this.getWindowRect = commands_1.general.getWindowRect;
|
|
94
|
-
this.performActions = commands_1.general.performActions;
|
|
95
|
-
this.getLog = commands_1.general.getLog;
|
|
96
|
-
this.mobileShake = commands_1.general.mobileShake;
|
|
97
|
-
this.doubleClick = commands_1.general.doubleClick;
|
|
98
|
-
this.execute = commands_1.general.execute;
|
|
99
|
-
this.fakeAddition = commands_1.general.fakeAddition;
|
|
100
|
-
this.releaseActions = commands_1.general.releaseActions;
|
|
101
46
|
this.curContext = 'NATIVE_APP';
|
|
102
47
|
this.elMap = {};
|
|
103
48
|
this.focusedElId = null;
|
|
@@ -105,6 +50,8 @@ class FakeDriver extends driver_1.BaseDriver {
|
|
|
105
50
|
this.fakeThing = null;
|
|
106
51
|
this._proxyActive = false;
|
|
107
52
|
this.shook = false;
|
|
53
|
+
this.appModel = new fake_app_1.FakeApp();
|
|
54
|
+
this.desiredCapConstraints = FAKE_DRIVER_CONSTRAINTS;
|
|
108
55
|
}
|
|
109
56
|
proxyActive() {
|
|
110
57
|
return this._proxyActive;
|
|
@@ -134,7 +81,7 @@ class FakeDriver extends driver_1.BaseDriver {
|
|
|
134
81
|
* @param {W3CFakeDriverCaps} [w3cCapabilities3] W3C Capabilities
|
|
135
82
|
* @param {import('@appium/types').DriverData[]} [driverData] Other session data
|
|
136
83
|
* @override
|
|
137
|
-
* @returns {Promise<[string,FakeDriverCaps]>}
|
|
84
|
+
* @returns {Promise<[string,FakeDriverCaps]>}
|
|
138
85
|
*/
|
|
139
86
|
async createSession(w3cCapabilities1, w3cCapabilities2, w3cCapabilities3, driverData = []) {
|
|
140
87
|
// TODO add validation on caps.app that we will get for free from
|
|
@@ -164,7 +111,7 @@ class FakeDriver extends driver_1.BaseDriver {
|
|
|
164
111
|
/**
|
|
165
112
|
* Set the 'thing' value (so that it can be retrieved later)
|
|
166
113
|
*
|
|
167
|
-
* @param {
|
|
114
|
+
* @param {Thing} thing
|
|
168
115
|
* @returns {Promise<null>}
|
|
169
116
|
*/
|
|
170
117
|
async setFakeThing(thing) {
|
|
@@ -248,10 +195,13 @@ FakeDriver.executeMethodMap = ({
|
|
|
248
195
|
command: 'getDeprecatedCommandsCalled',
|
|
249
196
|
},
|
|
250
197
|
});
|
|
198
|
+
// eslint-disable-next-line import/no-unresolved
|
|
199
|
+
__exportStar(require("./commands"), exports);
|
|
251
200
|
exports.default = FakeDriver;
|
|
252
201
|
/**
|
|
253
202
|
* @typedef {import('./types').FakeDriverCaps} FakeDriverCaps
|
|
254
203
|
* @typedef {import('./types').W3CFakeDriverCaps} W3CFakeDriverCaps
|
|
204
|
+
* @typedef {import('@appium/types').Element} Element
|
|
255
205
|
*/
|
|
256
206
|
/**
|
|
257
207
|
* @template {import('@appium/types').Driver} D
|
|
@@ -261,4 +211,7 @@ exports.default = FakeDriver;
|
|
|
261
211
|
* @template {import('@appium/types').Constraints} C
|
|
262
212
|
* @typedef {import('@appium/types').ExternalDriver<C>} ExternalDriver
|
|
263
213
|
*/
|
|
214
|
+
/**
|
|
215
|
+
* @typedef {import('@appium/types').Orientation} Orientation
|
|
216
|
+
*/
|
|
264
217
|
//# sourceMappingURL=driver.js.map
|