@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
package/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright OpenJS Foundation and other contributors, https://openjsf.org/
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
|
@@ -1,79 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*/
|
|
9
|
-
function assertNoAlert(this: import("../driver").FakeDriver): void;
|
|
10
|
-
/**
|
|
11
|
-
* @this {FakeDriver}
|
|
12
|
-
*/
|
|
13
|
-
function assertAlert(this: import("../driver").FakeDriver): void;
|
|
14
|
-
/**
|
|
15
|
-
* @this {FakeDriver}
|
|
16
|
-
*/
|
|
17
|
-
function assertAlert(this: import("../driver").FakeDriver): void;
|
|
18
|
-
/**
|
|
19
|
-
* Get the text of an alert
|
|
20
|
-
*
|
|
21
|
-
* @returns {Promise<string>}
|
|
22
|
-
* @this {FakeDriver}
|
|
23
|
-
*/
|
|
24
|
-
function getAlertText(this: import("../driver").FakeDriver): Promise<string>;
|
|
25
|
-
/**
|
|
26
|
-
* Get the text of an alert
|
|
27
|
-
*
|
|
28
|
-
* @returns {Promise<string>}
|
|
29
|
-
* @this {FakeDriver}
|
|
30
|
-
*/
|
|
31
|
-
function getAlertText(this: import("../driver").FakeDriver): Promise<string>;
|
|
32
|
-
/**
|
|
33
|
-
* Set the text of an alert
|
|
34
|
-
*
|
|
35
|
-
* @param {string} text
|
|
36
|
-
* @returns {Promise<void>}
|
|
37
|
-
* @this {FakeDriver}
|
|
38
|
-
*/
|
|
39
|
-
function setAlertText(this: import("../driver").FakeDriver, text: string): Promise<void>;
|
|
40
|
-
/**
|
|
41
|
-
* Set the text of an alert
|
|
42
|
-
*
|
|
43
|
-
* @param {string} text
|
|
44
|
-
* @returns {Promise<void>}
|
|
45
|
-
* @this {FakeDriver}
|
|
46
|
-
*/
|
|
47
|
-
function setAlertText(this: import("../driver").FakeDriver, text: string): Promise<void>;
|
|
48
|
-
/**
|
|
49
|
-
* Accept an alert
|
|
50
|
-
*
|
|
51
|
-
* @returns {Promise<void>}
|
|
52
|
-
* @this {FakeDriver}
|
|
53
|
-
*/
|
|
54
|
-
function postAcceptAlert(this: import("../driver").FakeDriver): Promise<void>;
|
|
55
|
-
/**
|
|
56
|
-
* Accept an alert
|
|
57
|
-
*
|
|
58
|
-
* @returns {Promise<void>}
|
|
59
|
-
* @this {FakeDriver}
|
|
60
|
-
*/
|
|
61
|
-
function postAcceptAlert(this: import("../driver").FakeDriver): Promise<void>;
|
|
62
|
-
/**
|
|
63
|
-
* Dismiss an alert
|
|
64
|
-
*
|
|
65
|
-
* @returns {Promise<void>}
|
|
66
|
-
* @this {FakeDriver}
|
|
67
|
-
*/
|
|
68
|
-
function postDismissAlert(this: import("../driver").FakeDriver): Promise<void>;
|
|
69
|
-
/**
|
|
70
|
-
* Dismiss an alert
|
|
71
|
-
*
|
|
72
|
-
* @returns {Promise<void>}
|
|
73
|
-
* @this {FakeDriver}
|
|
74
|
-
*/
|
|
75
|
-
function postDismissAlert(this: import("../driver").FakeDriver): Promise<void>;
|
|
1
|
+
interface FakeDriverAlertMixin {
|
|
2
|
+
assertNoAlert(): void;
|
|
3
|
+
assertAlert(): void;
|
|
4
|
+
getAlertText(): Promise<string>;
|
|
5
|
+
setAlertText(text: string): Promise<void>;
|
|
6
|
+
postAcceptAlert(): Promise<void>;
|
|
7
|
+
postDismissAlert(): Promise<void>;
|
|
76
8
|
}
|
|
77
|
-
|
|
78
|
-
|
|
9
|
+
declare module '../driver' {
|
|
10
|
+
interface FakeDriver extends FakeDriverAlertMixin {
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
79
14
|
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../lib/commands/alert.
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../lib/commands/alert.ts"],"names":[],"mappings":"AAIA,UAAU,oBAAoB;IAC5B,aAAa,IAAI,IAAI,CAAC;IACtB,WAAW,IAAI,IAAI,CAAC;IAEpB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAEhC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1C,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACnC;AAED,OAAO,QAAQ,WAAW,CAAC;IACzB,UAAU,UAAW,SAAQ,oBAAoB;KAAG;CACrD"}
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const driver_1 = require("appium/driver");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* @this {FakeDriver}
|
|
7
|
-
*/
|
|
4
|
+
const mixin_1 = require("./mixin");
|
|
5
|
+
const AlertMixin = {
|
|
8
6
|
assertNoAlert() {
|
|
9
7
|
if (this.appModel.hasAlert()) {
|
|
10
8
|
throw new driver_1.errors.UnexpectedAlertOpenError();
|
|
11
9
|
}
|
|
12
10
|
},
|
|
13
|
-
/**
|
|
14
|
-
* @this {FakeDriver}
|
|
15
|
-
*/
|
|
16
11
|
assertAlert() {
|
|
17
12
|
if (!this.appModel.hasAlert()) {
|
|
18
13
|
throw new driver_1.errors.NoAlertOpenError();
|
|
@@ -20,9 +15,6 @@ exports.default = {
|
|
|
20
15
|
},
|
|
21
16
|
/**
|
|
22
17
|
* Get the text of an alert
|
|
23
|
-
*
|
|
24
|
-
* @returns {Promise<string>}
|
|
25
|
-
* @this {FakeDriver}
|
|
26
18
|
*/
|
|
27
19
|
async getAlertText() {
|
|
28
20
|
this.assertAlert();
|
|
@@ -30,10 +22,6 @@ exports.default = {
|
|
|
30
22
|
},
|
|
31
23
|
/**
|
|
32
24
|
* Set the text of an alert
|
|
33
|
-
*
|
|
34
|
-
* @param {string} text
|
|
35
|
-
* @returns {Promise<void>}
|
|
36
|
-
* @this {FakeDriver}
|
|
37
25
|
*/
|
|
38
26
|
async setAlertText(text) {
|
|
39
27
|
this.assertAlert();
|
|
@@ -46,9 +34,6 @@ exports.default = {
|
|
|
46
34
|
},
|
|
47
35
|
/**
|
|
48
36
|
* Accept an alert
|
|
49
|
-
*
|
|
50
|
-
* @returns {Promise<void>}
|
|
51
|
-
* @this {FakeDriver}
|
|
52
37
|
*/
|
|
53
38
|
async postAcceptAlert() {
|
|
54
39
|
this.assertAlert();
|
|
@@ -56,15 +41,10 @@ exports.default = {
|
|
|
56
41
|
},
|
|
57
42
|
/**
|
|
58
43
|
* Dismiss an alert
|
|
59
|
-
*
|
|
60
|
-
* @returns {Promise<void>}
|
|
61
|
-
* @this {FakeDriver}
|
|
62
44
|
*/
|
|
63
45
|
async postDismissAlert() {
|
|
64
46
|
return this.postAcceptAlert();
|
|
65
47
|
},
|
|
66
48
|
};
|
|
67
|
-
|
|
68
|
-
* @typedef {import('../driver').FakeDriver} FakeDriver
|
|
69
|
-
*/
|
|
49
|
+
(0, mixin_1.mixin)(AlertMixin);
|
|
70
50
|
//# sourceMappingURL=alert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.js","sourceRoot":"","sources":["../../../lib/commands/alert.
|
|
1
|
+
{"version":3,"file":"alert.js","sourceRoot":"","sources":["../../../lib/commands/alert.ts"],"names":[],"mappings":";;AACA,0CAAqC;AACrC,mCAA8B;AAkB9B,MAAM,UAAU,GAAyB;IACvC,aAAa;QACX,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE;YAC5B,MAAM,IAAI,eAAM,CAAC,wBAAwB,EAAE,CAAC;SAC7C;IACH,CAAC;IAED,WAAW;QACT,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE;YAC7B,MAAM,IAAI,eAAM,CAAC,gBAAgB,EAAE,CAAC;SACrC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY;QAChB,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY,CAAmB,IAAY;QAC/C,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI;YACF,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;SAClC;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,IAAI,eAAM,CAAC,wBAAwB,EAAE,CAAC;SAC7C;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,eAAe;QACnB,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,gBAAgB;QACpB,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC;IAChC,CAAC;CACF,CAAC;AAEF,IAAA,aAAK,EAAC,UAAU,CAAC,CAAC"}
|
|
@@ -1,83 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* @this {FakeDriver}
|
|
11
|
-
*/
|
|
12
|
-
function getRawContexts(this: import("../driver").FakeDriver): {
|
|
13
|
-
NATIVE_APP: null;
|
|
14
|
-
PROXY: null;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* @this {FakeDriver}
|
|
18
|
-
*/
|
|
19
|
-
function assertWebviewContext(this: import("../driver").FakeDriver): void;
|
|
20
|
-
/**
|
|
21
|
-
* @this {FakeDriver}
|
|
22
|
-
*/
|
|
23
|
-
function assertWebviewContext(this: import("../driver").FakeDriver): void;
|
|
24
|
-
/**
|
|
25
|
-
* @returns {Promise<string>}
|
|
26
|
-
* @this {FakeDriver}
|
|
27
|
-
*/
|
|
28
|
-
function getCurrentContext(this: import("../driver").FakeDriver): Promise<string>;
|
|
29
|
-
/**
|
|
30
|
-
* @returns {Promise<string>}
|
|
31
|
-
* @this {FakeDriver}
|
|
32
|
-
*/
|
|
33
|
-
function getCurrentContext(this: import("../driver").FakeDriver): Promise<string>;
|
|
34
|
-
/**
|
|
35
|
-
* Get the list of available contexts
|
|
36
|
-
*
|
|
37
|
-
* @returns {Promise<string[]>}
|
|
38
|
-
* @this {FakeDriver}
|
|
39
|
-
*/
|
|
40
|
-
function getContexts(this: import("../driver").FakeDriver): Promise<string[]>;
|
|
41
|
-
/**
|
|
42
|
-
* Get the list of available contexts
|
|
43
|
-
*
|
|
44
|
-
* @returns {Promise<string[]>}
|
|
45
|
-
* @this {FakeDriver}
|
|
46
|
-
*/
|
|
47
|
-
function getContexts(this: import("../driver").FakeDriver): Promise<string[]>;
|
|
48
|
-
/**
|
|
49
|
-
* Set the current context
|
|
50
|
-
*
|
|
51
|
-
* @param {string} context - name of the context
|
|
52
|
-
* @returns {Promise<void>}
|
|
53
|
-
* @this {FakeDriver}
|
|
54
|
-
*/
|
|
55
|
-
function setContext(this: import("../driver").FakeDriver, context: string): Promise<void>;
|
|
56
|
-
/**
|
|
57
|
-
* Set the current context
|
|
58
|
-
*
|
|
59
|
-
* @param {string} context - name of the context
|
|
60
|
-
* @returns {Promise<void>}
|
|
61
|
-
* @this {FakeDriver}
|
|
62
|
-
*/
|
|
63
|
-
function setContext(this: import("../driver").FakeDriver, context: string): Promise<void>;
|
|
64
|
-
/**
|
|
65
|
-
* Set the active frame
|
|
66
|
-
*
|
|
67
|
-
* @param {number} frameId
|
|
68
|
-
* @returns {Promise<void>}
|
|
69
|
-
* @this {FakeDriver}
|
|
70
|
-
*/
|
|
71
|
-
function setFrame(this: import("../driver").FakeDriver, frameId: number): Promise<void>;
|
|
72
|
-
/**
|
|
73
|
-
* Set the active frame
|
|
74
|
-
*
|
|
75
|
-
* @param {number} frameId
|
|
76
|
-
* @returns {Promise<void>}
|
|
77
|
-
* @this {FakeDriver}
|
|
78
|
-
*/
|
|
79
|
-
function setFrame(this: import("../driver").FakeDriver, frameId: number): Promise<void>;
|
|
1
|
+
interface FakeDriverContextsMixin {
|
|
2
|
+
getRawContexts(): Record<string, any>;
|
|
3
|
+
assertWebviewContext(): void;
|
|
4
|
+
getCurrentContext(): Promise<string>;
|
|
5
|
+
getContexts(): Promise<string[]>;
|
|
6
|
+
setContext(context: string): Promise<void>;
|
|
7
|
+
setFrame(frame: number | null): Promise<void>;
|
|
80
8
|
}
|
|
81
|
-
|
|
82
|
-
|
|
9
|
+
declare module '../driver' {
|
|
10
|
+
interface FakeDriver extends FakeDriverContextsMixin {
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
83
14
|
//# sourceMappingURL=contexts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contexts.d.ts","sourceRoot":"","sources":["../../../lib/commands/contexts.
|
|
1
|
+
{"version":3,"file":"contexts.d.ts","sourceRoot":"","sources":["../../../lib/commands/contexts.ts"],"names":[],"mappings":"AAIA,UAAU,uBAAuB;IAC/B,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACtC,oBAAoB,IAAI,IAAI,CAAC;IAC7B,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACrC,WAAW,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACjC,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/C;AACD,OAAO,QAAQ,WAAW,CAAC;IACzB,UAAU,UAAW,SAAQ,uBAAuB;KAAG;CACxD"}
|
|
@@ -5,38 +5,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const lodash_1 = __importDefault(require("lodash"));
|
|
7
7
|
const driver_1 = require("appium/driver");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* @this {FakeDriver}
|
|
11
|
-
*/
|
|
8
|
+
const mixin_1 = require("./mixin");
|
|
9
|
+
const ContextsMixin = {
|
|
12
10
|
getRawContexts() {
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
const contexts = { NATIVE_APP: null, PROXY: null };
|
|
12
|
+
const wvs = this.appModel.getWebviews() ?? [];
|
|
15
13
|
for (let i = 1; i < wvs.length + 1; i++) {
|
|
16
14
|
contexts[`WEBVIEW_${i}`] = wvs[i - 1];
|
|
17
15
|
}
|
|
18
16
|
return contexts;
|
|
19
17
|
},
|
|
20
|
-
/**
|
|
21
|
-
* @this {FakeDriver}
|
|
22
|
-
*/
|
|
23
18
|
assertWebviewContext() {
|
|
24
19
|
if (this.curContext === 'NATIVE_APP') {
|
|
25
20
|
throw new driver_1.errors.InvalidContextError();
|
|
26
21
|
}
|
|
27
22
|
},
|
|
28
|
-
/**
|
|
29
|
-
* @returns {Promise<string>}
|
|
30
|
-
* @this {FakeDriver}
|
|
31
|
-
*/
|
|
32
23
|
async getCurrentContext() {
|
|
33
24
|
return this.curContext;
|
|
34
25
|
},
|
|
35
26
|
/**
|
|
36
27
|
* Get the list of available contexts
|
|
37
|
-
*
|
|
38
|
-
* @returns {Promise<string[]>}
|
|
39
|
-
* @this {FakeDriver}
|
|
40
28
|
*/
|
|
41
29
|
async getContexts() {
|
|
42
30
|
return lodash_1.default.keys(this.getRawContexts());
|
|
@@ -44,12 +32,10 @@ exports.default = {
|
|
|
44
32
|
/**
|
|
45
33
|
* Set the current context
|
|
46
34
|
*
|
|
47
|
-
* @param
|
|
48
|
-
* @returns {Promise<void>}
|
|
49
|
-
* @this {FakeDriver}
|
|
35
|
+
* @param context - name of the context
|
|
50
36
|
*/
|
|
51
37
|
async setContext(context) {
|
|
52
|
-
|
|
38
|
+
const contexts = this.getRawContexts();
|
|
53
39
|
if (context in contexts) {
|
|
54
40
|
this.curContext = context;
|
|
55
41
|
if (context === 'NATIVE_APP') {
|
|
@@ -70,10 +56,6 @@ exports.default = {
|
|
|
70
56
|
},
|
|
71
57
|
/**
|
|
72
58
|
* Set the active frame
|
|
73
|
-
*
|
|
74
|
-
* @param {number} frameId
|
|
75
|
-
* @returns {Promise<void>}
|
|
76
|
-
* @this {FakeDriver}
|
|
77
59
|
*/
|
|
78
60
|
async setFrame(frameId) {
|
|
79
61
|
this.assertWebviewContext();
|
|
@@ -81,7 +63,7 @@ exports.default = {
|
|
|
81
63
|
this.appModel.deactivateFrame();
|
|
82
64
|
}
|
|
83
65
|
else {
|
|
84
|
-
|
|
66
|
+
const nodes = this.appModel.xpathQuery(`//iframe[@id="${frameId}"]`);
|
|
85
67
|
if (!nodes.length) {
|
|
86
68
|
throw new driver_1.errors.NoSuchFrameError();
|
|
87
69
|
}
|
|
@@ -89,7 +71,5 @@ exports.default = {
|
|
|
89
71
|
}
|
|
90
72
|
},
|
|
91
73
|
};
|
|
92
|
-
|
|
93
|
-
* @typedef {import('../driver').FakeDriver} FakeDriver
|
|
94
|
-
*/
|
|
74
|
+
(0, mixin_1.mixin)(ContextsMixin);
|
|
95
75
|
//# sourceMappingURL=contexts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contexts.js","sourceRoot":"","sources":["../../../lib/commands/contexts.
|
|
1
|
+
{"version":3,"file":"contexts.js","sourceRoot":"","sources":["../../../lib/commands/contexts.ts"],"names":[],"mappings":";;;;;AAAA,oDAAuB;AAEvB,0CAAqC;AACrC,mCAA8B;AAa9B,MAAM,aAAa,GAA4B;IAC7C,cAAc;QACZ,MAAM,QAAQ,GAAG,EAAC,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC;QACjD,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC;QAC9C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;YACvC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;SACvC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,oBAAoB;QAClB,IAAI,IAAI,CAAC,UAAU,KAAK,YAAY,EAAE;YACpC,MAAM,IAAI,eAAM,CAAC,mBA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aACrC;YACD,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;SACvC;IACH,CAAC;CACF,CAAC;AAEF,IAAA,aAAK,EAAC,aAAa,CAAC,CAAC"}
|
|
@@ -1,147 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
function getName(this: import("../driver").FakeDriver, elementId: any): Promise<any>;
|
|
22
|
-
/**
|
|
23
|
-
* @this {FakeDriver}
|
|
24
|
-
*/
|
|
25
|
-
function getName(this: import("../driver").FakeDriver, elementId: any): Promise<any>;
|
|
26
|
-
/**
|
|
27
|
-
* @this {FakeDriver}
|
|
28
|
-
*/
|
|
29
|
-
function elementDisplayed(this: import("../driver").FakeDriver, elementId: any): Promise<any>;
|
|
30
|
-
/**
|
|
31
|
-
* @this {FakeDriver}
|
|
32
|
-
*/
|
|
33
|
-
function elementDisplayed(this: import("../driver").FakeDriver, elementId: any): Promise<any>;
|
|
34
|
-
/**
|
|
35
|
-
* @this {FakeDriver}
|
|
36
|
-
*/
|
|
37
|
-
function elementEnabled(this: import("../driver").FakeDriver, elementId: any): Promise<any>;
|
|
38
|
-
/**
|
|
39
|
-
* @this {FakeDriver}
|
|
40
|
-
*/
|
|
41
|
-
function elementEnabled(this: import("../driver").FakeDriver, elementId: any): Promise<any>;
|
|
42
|
-
/**
|
|
43
|
-
* @this {FakeDriver}
|
|
44
|
-
*/
|
|
45
|
-
function elementSelected(this: import("../driver").FakeDriver, elementId: any): Promise<any>;
|
|
46
|
-
/**
|
|
47
|
-
* @this {FakeDriver}
|
|
48
|
-
*/
|
|
49
|
-
function elementSelected(this: import("../driver").FakeDriver, elementId: any): Promise<any>;
|
|
50
|
-
/**
|
|
51
|
-
* @this {FakeDriver}
|
|
52
|
-
*/
|
|
53
|
-
function setValue(this: import("../driver").FakeDriver, keys: any, elementId: any): Promise<void>;
|
|
54
|
-
/**
|
|
55
|
-
* @this {FakeDriver}
|
|
56
|
-
*/
|
|
57
|
-
function setValue(this: import("../driver").FakeDriver, keys: any, elementId: any): Promise<void>;
|
|
58
|
-
/**
|
|
59
|
-
* @this {FakeDriver}
|
|
60
|
-
*/
|
|
61
|
-
function getText(this: import("../driver").FakeDriver, elementId: any): Promise<any>;
|
|
62
|
-
/**
|
|
63
|
-
* @this {FakeDriver}
|
|
64
|
-
*/
|
|
65
|
-
function getText(this: import("../driver").FakeDriver, elementId: any): Promise<any>;
|
|
66
|
-
/**
|
|
67
|
-
* @this {FakeDriver}
|
|
68
|
-
*/
|
|
69
|
-
function clear(this: import("../driver").FakeDriver, elementId: any): Promise<void>;
|
|
70
|
-
/**
|
|
71
|
-
* @this {FakeDriver}
|
|
72
|
-
*/
|
|
73
|
-
function clear(this: import("../driver").FakeDriver, elementId: any): Promise<void>;
|
|
74
|
-
/**
|
|
75
|
-
* This comment should be displayed instead of the one from ExternalDriver
|
|
76
|
-
* @param {string} elementId
|
|
77
|
-
* @this {FakeDriver}
|
|
78
|
-
*/
|
|
79
|
-
function click(this: import("../driver").FakeDriver, elementId: string): Promise<void>;
|
|
80
|
-
/**
|
|
81
|
-
* This comment should be displayed instead of the one from ExternalDriver
|
|
82
|
-
* @param {string} elementId
|
|
83
|
-
* @this {FakeDriver}
|
|
84
|
-
*/
|
|
85
|
-
function click(this: import("../driver").FakeDriver, elementId: string): Promise<void>;
|
|
86
|
-
/**
|
|
87
|
-
* @this {FakeDriver}
|
|
88
|
-
*/
|
|
89
|
-
function getAttribute(this: import("../driver").FakeDriver, attr: any, elementId: any): Promise<any>;
|
|
90
|
-
/**
|
|
91
|
-
* @this {FakeDriver}
|
|
92
|
-
*/
|
|
93
|
-
function getAttribute(this: import("../driver").FakeDriver, attr: any, elementId: any): Promise<any>;
|
|
94
|
-
/**
|
|
95
|
-
* @this {FakeDriver}
|
|
96
|
-
*/
|
|
97
|
-
function getElementRect(this: import("../driver").FakeDriver, elementId: any): any;
|
|
98
|
-
/**
|
|
99
|
-
* @this {FakeDriver}
|
|
100
|
-
*/
|
|
101
|
-
function getElementRect(this: import("../driver").FakeDriver, elementId: any): any;
|
|
102
|
-
/**
|
|
103
|
-
* @this {FakeDriver}
|
|
104
|
-
*/
|
|
105
|
-
function getSize(this: import("../driver").FakeDriver, elementId: any): any;
|
|
106
|
-
/**
|
|
107
|
-
* @this {FakeDriver}
|
|
108
|
-
*/
|
|
109
|
-
function getSize(this: import("../driver").FakeDriver, elementId: any): any;
|
|
110
|
-
/**
|
|
111
|
-
* @this {FakeDriver}
|
|
112
|
-
*/
|
|
113
|
-
function equalsElement(this: import("../driver").FakeDriver, el1Id: any, el2Id: any): any;
|
|
114
|
-
/**
|
|
115
|
-
* @this {FakeDriver}
|
|
116
|
-
*/
|
|
117
|
-
function equalsElement(this: import("../driver").FakeDriver, el1Id: any, el2Id: any): any;
|
|
118
|
-
/**
|
|
119
|
-
* @this {FakeDriver}
|
|
120
|
-
*/
|
|
121
|
-
function getCssProperty(this: import("../driver").FakeDriver, prop: any, elementId: any): Promise<any>;
|
|
122
|
-
/**
|
|
123
|
-
* @this {FakeDriver}
|
|
124
|
-
*/
|
|
125
|
-
function getCssProperty(this: import("../driver").FakeDriver, prop: any, elementId: any): Promise<any>;
|
|
126
|
-
/**
|
|
127
|
-
* @param {string} elementId
|
|
128
|
-
* @this {FakeDriver}
|
|
129
|
-
*/
|
|
130
|
-
function getLocation(this: import("../driver").FakeDriver, elementId: string): Promise<any>;
|
|
131
|
-
/**
|
|
132
|
-
* @param {string} elementId
|
|
133
|
-
* @this {FakeDriver}
|
|
134
|
-
*/
|
|
135
|
-
function getLocation(this: import("../driver").FakeDriver, elementId: string): Promise<any>;
|
|
136
|
-
/**
|
|
137
|
-
* @this {FakeDriver}
|
|
138
|
-
*/
|
|
139
|
-
function getLocationInView(this: import("../driver").FakeDriver, elementId: any): Promise<any>;
|
|
140
|
-
/**
|
|
141
|
-
* @this {FakeDriver}
|
|
142
|
-
*/
|
|
143
|
-
function getLocationInView(this: import("../driver").FakeDriver, elementId: any): Promise<any>;
|
|
1
|
+
import { Position, Rect, Size } from '@appium/types';
|
|
2
|
+
import { FakeElement } from '../fake-element';
|
|
3
|
+
interface FakeDriverElementsMixin {
|
|
4
|
+
getElements(elementIds: string[]): FakeElement[];
|
|
5
|
+
getElement(elementId: string): FakeElement;
|
|
6
|
+
getName(elementId: string): Promise<string>;
|
|
7
|
+
elementDisplayed(elementId: string): Promise<boolean>;
|
|
8
|
+
elementEnabled(elementId: string): Promise<boolean>;
|
|
9
|
+
elementSelected(elementId: string): Promise<boolean>;
|
|
10
|
+
setValue(keys: string | string[], value: string): Promise<void>;
|
|
11
|
+
getText(elementId: string): Promise<string>;
|
|
12
|
+
clear(elementId: string): Promise<void>;
|
|
13
|
+
click(elementId: string): Promise<void>;
|
|
14
|
+
getAttribute(elementId: string, attributeName: string): Promise<string>;
|
|
15
|
+
getElementRect(elementId: string): Promise<Rect>;
|
|
16
|
+
getSize(elementId: string): Promise<Size>;
|
|
17
|
+
equalsElement(elementId: string, otherElementId: string): Promise<boolean>;
|
|
18
|
+
getCssProperty(elementId: string, propertyName: string): Promise<string>;
|
|
19
|
+
getLocation(elementId: string): Promise<Position>;
|
|
20
|
+
getLocationInView(elementId: string): Promise<Position>;
|
|
144
21
|
}
|
|
145
|
-
|
|
146
|
-
|
|
22
|
+
declare module '../driver' {
|
|
23
|
+
interface FakeDriver extends FakeDriverElementsMixin {
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
147
27
|
//# sourceMappingURL=element.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../../l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