@sap_oss/wdio-qmate-service 1.0.0 → 1.0.2
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/README.md +2 -1
- package/{test/core/package-lock.json → docs/bestPractices/spec.md} +0 -0
- package/docs/doc.md +176 -353
- package/docs/gettingStarted/setup.md +2 -2
- package/docs/index.md +1 -1
- package/docs/sections/bestPractices/authentication.md +151 -0
- package/docs/sections/bestPractices/dataHandling.md +61 -0
- package/docs/sections/bestPractices/selectors.md +44 -0
- package/docs/{contact.md → sections/contact.md} +0 -0
- package/docs/sections/features/advancedDataHandling.md +252 -0
- package/docs/sections/features/config.md +171 -0
- package/docs/sections/features/dataHandling.md +83 -0
- package/docs/{gettingStarted → sections/features}/selectors.md +0 -0
- package/docs/sections/features/spec.md +0 -0
- package/docs/sections/gettingStarted/config.md +18 -0
- package/docs/sections/gettingStarted/execution.md +7 -0
- package/docs/sections/gettingStarted/setup.md +9 -0
- package/docs/sections/gettingStarted/spec.md +31 -0
- package/docs/sections/gettingStarted/specs.md +19 -0
- package/docs/sections/support/bugReporting.md +19 -0
- package/docs/sections/support/knownIssuesAndLimitations.md +0 -0
- package/docs/sections/support/troubleshooting.md +16 -0
- package/docs/sources/images/fiori_form.PNG +0 -0
- package/docs/sources/images/sapCloud_form.PNG +0 -0
- package/lib/index.js +59 -82
- package/lib/index.js.map +1 -1
- package/lib/reuse/authenticator/authHandler.js +12 -23
- package/lib/reuse/authenticator/authHandler.js.map +1 -1
- package/lib/reuse/authenticator/basicUrlAuthenticator.js +21 -32
- package/lib/reuse/authenticator/basicUrlAuthenticator.js.map +1 -1
- package/lib/reuse/authenticator/customAuthenticator.js +42 -55
- package/lib/reuse/authenticator/customAuthenticator.js.map +1 -1
- package/lib/reuse/authenticator/formAuthenticator.js +37 -50
- package/lib/reuse/authenticator/formAuthenticator.js.map +1 -1
- package/lib/reuse/authenticator/plainAuthenticator.js +5 -16
- package/lib/reuse/authenticator/plainAuthenticator.js.map +1 -1
- package/lib/reuse/helper/jsDocGen.js +4 -12
- package/lib/reuse/helper/jsDocGen.js.map +1 -1
- package/lib/reuse/index.js +20 -5
- package/lib/reuse/index.js.map +1 -1
- package/lib/reuse/modules/common/navigation.js +10 -23
- package/lib/reuse/modules/common/navigation.js.map +1 -1
- package/lib/reuse/modules/common/userInteraction.js +40 -73
- package/lib/reuse/modules/common/userInteraction.js.map +1 -1
- package/lib/reuse/modules/nonUi5/assertion.js +31 -52
- package/lib/reuse/modules/nonUi5/assertion.js.map +1 -1
- package/lib/reuse/modules/nonUi5/element.js +266 -331
- package/lib/reuse/modules/nonUi5/element.js.map +1 -1
- package/lib/reuse/modules/nonUi5/navigation.js +10 -21
- package/lib/reuse/modules/nonUi5/navigation.js.map +1 -1
- package/lib/reuse/modules/nonUi5/userInteraction.js +176 -215
- package/lib/reuse/modules/nonUi5/userInteraction.js.map +1 -1
- package/lib/reuse/modules/service/odata.d.ts +106 -94
- package/lib/reuse/modules/service/odata.js +209 -204
- package/lib/reuse/modules/service/odata.js.map +1 -1
- package/lib/reuse/modules/service/rest.js +64 -81
- package/lib/reuse/modules/service/rest.js.map +1 -1
- package/lib/reuse/modules/ui5/assertion.js +217 -268
- package/lib/reuse/modules/ui5/assertion.js.map +1 -1
- package/lib/reuse/modules/ui5/confirmationDialog.js +17 -42
- package/lib/reuse/modules/ui5/confirmationDialog.js.map +1 -1
- package/lib/reuse/modules/ui5/control.js +12 -33
- package/lib/reuse/modules/ui5/control.js.map +1 -1
- package/lib/reuse/modules/ui5/date.js +70 -89
- package/lib/reuse/modules/ui5/date.js.map +1 -1
- package/lib/reuse/modules/ui5/element.js +121 -156
- package/lib/reuse/modules/ui5/element.js.map +1 -1
- package/lib/reuse/modules/ui5/errorDialog.js +4 -17
- package/lib/reuse/modules/ui5/errorDialog.js.map +1 -1
- package/lib/reuse/modules/ui5/footerBar.js +28 -63
- package/lib/reuse/modules/ui5/footerBar.js.map +1 -1
- package/lib/reuse/modules/ui5/mockserver.js +390 -427
- package/lib/reuse/modules/ui5/mockserver.js.map +1 -1
- package/lib/reuse/modules/ui5/navigation.js +105 -132
- package/lib/reuse/modules/ui5/navigation.js.map +1 -1
- package/lib/reuse/modules/ui5/navigationBar.js +58 -77
- package/lib/reuse/modules/ui5/navigationBar.js.map +1 -1
- package/lib/reuse/modules/ui5/qunit.js +16 -27
- package/lib/reuse/modules/ui5/qunit.js.map +1 -1
- package/lib/reuse/modules/ui5/session.js +200 -236
- package/lib/reuse/modules/ui5/session.js.map +1 -1
- package/lib/reuse/modules/ui5/table.js +79 -98
- package/lib/reuse/modules/ui5/table.js.map +1 -1
- package/lib/reuse/modules/ui5/userInteraction.js +264 -335
- package/lib/reuse/modules/ui5/userInteraction.js.map +1 -1
- package/lib/reuse/modules/util/browser.js +131 -178
- package/lib/reuse/modules/util/browser.js.map +1 -1
- package/lib/reuse/modules/util/data.js +3 -2
- package/lib/reuse/modules/util/data.js.map +1 -1
- package/lib/reuse/modules/util/file.js +71 -90
- package/lib/reuse/modules/util/file.js.map +1 -1
- package/lib/reuse/modules/util/function.js +68 -87
- package/lib/reuse/modules/util/function.js.map +1 -1
- package/lib/reuse/modules/util/system.js +22 -33
- package/lib/reuse/modules/util/system.js.map +1 -1
- package/lib/scripts/dataExchange/dataExchange.js +145 -160
- package/lib/scripts/dataExchange/dataExchange.js.map +1 -1
- package/lib/scripts/dataExchange/dataExchangeUtil.js +93 -114
- package/lib/scripts/dataExchange/dataExchangeUtil.js.map +1 -1
- package/lib/scripts/hooks/after.js +3 -14
- package/lib/scripts/hooks/after.js.map +1 -1
- package/lib/scripts/hooks/before.js +9 -20
- package/lib/scripts/hooks/before.js.map +1 -1
- package/lib/scripts/hooks/beforeSession.js +7 -18
- package/lib/scripts/hooks/beforeSession.js.map +1 -1
- package/lib/scripts/hooks/onComplete.js +2 -13
- package/lib/scripts/hooks/onComplete.js.map +1 -1
- package/lib/scripts/hooks/onPrepare.js +9 -20
- package/lib/scripts/hooks/onPrepare.js.map +1 -1
- package/lib/scripts/hooks/utils/addLocatorCommands.js +109 -172
- package/lib/scripts/hooks/utils/addLocatorCommands.js.map +1 -1
- package/lib/scripts/hooks/utils/browserLog.js +18 -31
- package/lib/scripts/hooks/utils/browserLog.js.map +1 -1
- package/lib/scripts/hooks/utils/dataExchangeCommands.js +13 -24
- package/lib/scripts/hooks/utils/dataExchangeCommands.js.map +1 -1
- package/lib/scripts/hooks/utils/decryption.d.ts +1 -1
- package/lib/scripts/hooks/utils/decryption.js +33 -14
- package/lib/scripts/hooks/utils/decryption.js.map +1 -1
- package/lib/scripts/hooks/utils/lib.js +249 -272
- package/lib/scripts/hooks/utils/lib.js.map +1 -1
- package/lib/scripts/hooks/utils/locatorCommands.js +154 -183
- package/lib/scripts/hooks/utils/locatorCommands.js.map +1 -1
- package/mkdocs.yml +16 -3
- package/package.json +14 -11
- package/test/authenticator/staticLogin/specs/custom.spec.js +30 -1
- package/test/reuse/nonUi5/element/getById.spec.js +17 -0
- package/test/reuse/service/odata/get.spec.js +61 -0
- package/test/reuse/service/odata/getEntitySet.spec.js +87 -0
- package/test/reuse/service/odata/test.odata.conf.js +15 -0
- package/test/reuse/ui5/confirmationDialog/clickButton.spec.js +87 -0
- package/test/reuse/ui5/confirmationDialog/test.confirmationDialog.conf.js +2 -1
- package/test/reuse/ui5/element/test.element.conf.js +2 -1
- package/test/reuse/ui5/element/waitForAll.spec.js +46 -0
- package/test/reuse/ui5/userInteraction/clearAndFillSmartFieldInputAndRetry.spec.js +28 -0
- package/test/reuse/ui5/userInteraction/test.userInteraction.conf.js +1 -0
- package/test/reuse/util/browser/switchToNewWindow.spec.js +2 -2
- package/test/reuse/util/console/console.spec.js +27 -0
- package/test/reuse/util/console/test.console.conf.js +12 -0
- package/test/reuse/util/data/data/test.secure.json +7 -3
- package/test/reuse/util/data/getSecureData.spec.js +9 -3
- package/test/reuse/util/file/pdfParser.spec.js +33 -8
- package/test/reuse/util/system/system.spec.js +16 -0
- package/test/reuse/util/system/test.system.conf.js +12 -0
- package/tsconfig.json +1 -1
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.UserInteraction = void 0;
|
|
13
4
|
const userInteraction_constants_1 = require("./constants/userInteraction.constants");
|
|
@@ -24,22 +15,20 @@ class UserInteraction {
|
|
|
24
15
|
* @param {String} value - The value with witch the input should be filled.
|
|
25
16
|
* @example await common.userInteraction.fillActive("My Value");
|
|
26
17
|
*/
|
|
27
|
-
fillActive(value) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
yield elem.addValue(value); //TODO: open issue on wdio github for different behavior in terms of the active element of addValue() and setValue()
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
throw new Error("Function 'fillActive' failed: Please provide a value as argument.");
|
|
36
|
-
}
|
|
18
|
+
async fillActive(value) {
|
|
19
|
+
try {
|
|
20
|
+
if (value !== null) {
|
|
21
|
+
const elem = await $(await browser.getActiveElement());
|
|
22
|
+
await elem.addValue(value); //TODO: open issue on wdio github for different behavior in terms of the active element of addValue() and setValue()
|
|
37
23
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
throw new Error("Function 'fillActive' failed: ", error);
|
|
24
|
+
else {
|
|
25
|
+
throw new Error("Function 'fillActive' failed: Please provide a value as argument.");
|
|
41
26
|
}
|
|
42
|
-
}
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
throw new Error("Function 'fillActive' failed: ", error);
|
|
31
|
+
}
|
|
43
32
|
}
|
|
44
33
|
;
|
|
45
34
|
/**
|
|
@@ -51,10 +40,8 @@ class UserInteraction {
|
|
|
51
40
|
* @param {Number} [interval=5000] - The delay between the retries (ms). Can be set in config for all functions under params.stepRetriesIntervals.
|
|
52
41
|
* @example await common.userInteraction.fillActiveAndRetry("My Value");
|
|
53
42
|
*/
|
|
54
|
-
fillActiveAndRetry(value, retries = 3, interval = 5000) {
|
|
55
|
-
|
|
56
|
-
yield util.function.retry(this.fillActive, [value], retries, interval, this);
|
|
57
|
-
});
|
|
43
|
+
async fillActiveAndRetry(value, retries = 3, interval = 5000) {
|
|
44
|
+
await util.function.retry(this.fillActive, [value], retries, interval, this);
|
|
58
45
|
}
|
|
59
46
|
;
|
|
60
47
|
/**
|
|
@@ -64,16 +51,14 @@ class UserInteraction {
|
|
|
64
51
|
* @param {String} value - The value to fill.
|
|
65
52
|
* @example await common.userInteraction.clearAndFillActive("My Value");
|
|
66
53
|
*/
|
|
67
|
-
clearAndFillActive(value) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
});
|
|
54
|
+
async clearAndFillActive(value) {
|
|
55
|
+
if (value !== null) {
|
|
56
|
+
const elem = await $(await browser.getActiveElement());
|
|
57
|
+
await elem.setValue(value);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
throw new Error("Function 'clearAndFillActive' failed. Please provide a value as argument.");
|
|
61
|
+
}
|
|
77
62
|
}
|
|
78
63
|
;
|
|
79
64
|
/**
|
|
@@ -85,10 +70,8 @@ class UserInteraction {
|
|
|
85
70
|
* @param {Number} [interval=5000] - The delay between the retries (ms). Can be set in config for all functions under params.stepRetriesIntervals.
|
|
86
71
|
* @example await common.userInteraction.clearAndFillActiveAndRetry("My Value");
|
|
87
72
|
*/
|
|
88
|
-
clearAndFillActiveAndRetry(value, retries = 3, interval = 5000) {
|
|
89
|
-
|
|
90
|
-
yield util.function.retry(this.clearAndFillActive, [value], retries, interval, this);
|
|
91
|
-
});
|
|
73
|
+
async clearAndFillActiveAndRetry(value, retries = 3, interval = 5000) {
|
|
74
|
+
await util.function.retry(this.clearAndFillActive, [value], retries, interval, this);
|
|
92
75
|
}
|
|
93
76
|
;
|
|
94
77
|
// =================================== KEYS ===================================
|
|
@@ -101,10 +84,8 @@ class UserInteraction {
|
|
|
101
84
|
* @example await common.userInteraction.pressKey("\uE004");
|
|
102
85
|
* @example await common.userInteraction.pressKey(["\uE009", "Alt"]);
|
|
103
86
|
*/
|
|
104
|
-
pressKey(keys) {
|
|
105
|
-
|
|
106
|
-
yield browser.keys(keys);
|
|
107
|
-
});
|
|
87
|
+
async pressKey(keys) {
|
|
88
|
+
await browser.keys(keys);
|
|
108
89
|
}
|
|
109
90
|
;
|
|
110
91
|
/**
|
|
@@ -113,10 +94,8 @@ class UserInteraction {
|
|
|
113
94
|
* @description Performs the Enter keypress.
|
|
114
95
|
* @example await common.userInteraction.pressEnter();
|
|
115
96
|
*/
|
|
116
|
-
pressEnter() {
|
|
117
|
-
|
|
118
|
-
yield browser.keys(userInteraction_constants_1.KeyCodes.ENTER);
|
|
119
|
-
});
|
|
97
|
+
async pressEnter() {
|
|
98
|
+
await browser.keys(userInteraction_constants_1.KeyCodes.ENTER);
|
|
120
99
|
}
|
|
121
100
|
;
|
|
122
101
|
/**
|
|
@@ -125,10 +104,8 @@ class UserInteraction {
|
|
|
125
104
|
* @description Performs the Tab keypress.
|
|
126
105
|
* @example await common.userInteraction.pressTab();
|
|
127
106
|
*/
|
|
128
|
-
pressTab() {
|
|
129
|
-
|
|
130
|
-
yield browser.keys(userInteraction_constants_1.KeyCodes.TAB);
|
|
131
|
-
});
|
|
107
|
+
async pressTab() {
|
|
108
|
+
await browser.keys(userInteraction_constants_1.KeyCodes.TAB);
|
|
132
109
|
}
|
|
133
110
|
;
|
|
134
111
|
/**
|
|
@@ -137,10 +114,8 @@ class UserInteraction {
|
|
|
137
114
|
* @description Performs the F4 keypress.
|
|
138
115
|
* @example await common.userInteraction.pressF4();
|
|
139
116
|
*/
|
|
140
|
-
pressF4() {
|
|
141
|
-
|
|
142
|
-
yield browser.keys(userInteraction_constants_1.KeyCodes.F4);
|
|
143
|
-
});
|
|
117
|
+
async pressF4() {
|
|
118
|
+
await browser.keys(userInteraction_constants_1.KeyCodes.F4);
|
|
144
119
|
}
|
|
145
120
|
;
|
|
146
121
|
/**
|
|
@@ -149,10 +124,8 @@ class UserInteraction {
|
|
|
149
124
|
* @description Performs the Backspace keypress.
|
|
150
125
|
* @example await common.userInteraction.pressBackspace();
|
|
151
126
|
*/
|
|
152
|
-
pressBackspace() {
|
|
153
|
-
|
|
154
|
-
yield browser.keys(userInteraction_constants_1.KeyCodes.BACKSPACE);
|
|
155
|
-
});
|
|
127
|
+
async pressBackspace() {
|
|
128
|
+
await browser.keys(userInteraction_constants_1.KeyCodes.BACKSPACE);
|
|
156
129
|
}
|
|
157
130
|
;
|
|
158
131
|
/**
|
|
@@ -162,10 +135,8 @@ class UserInteraction {
|
|
|
162
135
|
* @description Performs the Escape keypress.
|
|
163
136
|
* @example await common.userInteraction.pressEscape();
|
|
164
137
|
*/
|
|
165
|
-
pressEscape() {
|
|
166
|
-
|
|
167
|
-
yield browser.keys(userInteraction_constants_1.KeyCodes.ESCAPE);
|
|
168
|
-
});
|
|
138
|
+
async pressEscape() {
|
|
139
|
+
await browser.keys(userInteraction_constants_1.KeyCodes.ESCAPE);
|
|
169
140
|
}
|
|
170
141
|
;
|
|
171
142
|
/**
|
|
@@ -174,10 +145,8 @@ class UserInteraction {
|
|
|
174
145
|
* @description Performs the Arrow Left keypress.
|
|
175
146
|
* @example await common.userInteraction.pressArrowLeft();
|
|
176
147
|
*/
|
|
177
|
-
pressArrowLeft() {
|
|
178
|
-
|
|
179
|
-
yield browser.keys(userInteraction_constants_1.KeyCodes.ARROW_LEFT);
|
|
180
|
-
});
|
|
148
|
+
async pressArrowLeft() {
|
|
149
|
+
await browser.keys(userInteraction_constants_1.KeyCodes.ARROW_LEFT);
|
|
181
150
|
}
|
|
182
151
|
;
|
|
183
152
|
/**
|
|
@@ -186,10 +155,8 @@ class UserInteraction {
|
|
|
186
155
|
* @description Performs the Arrow Right keypress.
|
|
187
156
|
* @example await common.userInteraction.pressArrowRight();
|
|
188
157
|
*/
|
|
189
|
-
pressArrowRight() {
|
|
190
|
-
|
|
191
|
-
yield browser.keys(userInteraction_constants_1.KeyCodes.ARROW_RIGHT);
|
|
192
|
-
});
|
|
158
|
+
async pressArrowRight() {
|
|
159
|
+
await browser.keys(userInteraction_constants_1.KeyCodes.ARROW_RIGHT);
|
|
193
160
|
}
|
|
194
161
|
;
|
|
195
162
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userInteraction.js","sourceRoot":"","sources":["../../../../src/reuse/modules/common/userInteraction.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"userInteraction.js","sourceRoot":"","sources":["../../../../src/reuse/modules/common/userInteraction.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAEb,qFAAiE;AAEjE;;;GAGG;AACH,MAAa,eAAe;IAE1B,+EAA+E;IAC/E;;;;;;OAMG;IACH,KAAK,CAAC,UAAU,CAAE,KAAa;QAC7B,IAAI;YACF,IAAI,KAAK,KAAK,IAAI,EAAE;gBAClB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,MAAM,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;gBACvD,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,oHAAoH;aACjJ;iBAAM;gBACL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d,MAAM,OAAO,CAAC,IAAI,CAAC,oCAAQ,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAAA,CAAC;IAEF;;;;;OAKG;IACH,KAAK,CAAC,QAAQ;QACZ,MAAM,OAAO,CAAC,IAAI,CAAC,oCAAQ,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC;IAAA,CAAC;IAEF;;;;;OAKG;IACH,KAAK,CAAC,OAAO;QACX,MAAM,OAAO,CAAC,IAAI,CAAC,oCAAQ,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;IAAA,CAAC;IAEF;;;;;OAKG;IACH,KAAK,CAAC,cAAc;QAClB,MAAM,OAAO,CAAC,IAAI,CAAC,oCAAQ,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;IAAA,CAAC;IAEF;;;;;;OAMG;IACH,KAAK,CAAC,WAAW;QACf,MAAM,OAAO,CAAC,IAAI,CAAC,oCAAQ,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAAA,CAAC;IAEF;;;;;OAKG;IACH,KAAK,CAAC,cAAc;QAClB,MAAM,OAAO,CAAC,IAAI,CAAC,oCAAQ,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;IAAA,CAAC;IAEF;;;;;OAKG;IACH,KAAK,CAAC,eAAe;QACnB,MAAM,OAAO,CAAC,IAAI,CAAC,oCAAQ,CAAC,WAAW,CAAC,CAAC;IAC3C,CAAC;IAAA,CAAC;CAEH;AA1JD,0CA0JC;AAAA,CAAC;AACF,kBAAe,IAAI,eAAe,EAAE,CAAC"}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.Assertion = void 0;
|
|
13
4
|
/**
|
|
@@ -28,11 +19,9 @@ class Assertion {
|
|
|
28
19
|
* @example const elem = await nonUi5.element.getById("button01");
|
|
29
20
|
* await nonUi5.assertion.expectAttributeToBe(element, "Save", "title");
|
|
30
21
|
*/
|
|
31
|
-
expectAttributeToBe(elem, compareValue, attribute) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return common.assertion.expectEqual(value, compareValue);
|
|
35
|
-
});
|
|
22
|
+
async expectAttributeToBe(elem, compareValue, attribute) {
|
|
23
|
+
const value = await nonUi5.element.getAttributeValue(elem, attribute);
|
|
24
|
+
return common.assertion.expectEqual(value, compareValue);
|
|
36
25
|
}
|
|
37
26
|
;
|
|
38
27
|
/**
|
|
@@ -45,11 +34,9 @@ class Assertion {
|
|
|
45
34
|
* @example const elem = await nonUi5.element.getById("button01");
|
|
46
35
|
* await nonUi5.assertion.expectAttributeToContain(element, "Save", "title");
|
|
47
36
|
*/
|
|
48
|
-
expectAttributeToContain(elem, compareValue, attribute) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return expect(value).toContain(compareValue);
|
|
52
|
-
});
|
|
37
|
+
async expectAttributeToContain(elem, compareValue, attribute) {
|
|
38
|
+
const value = await nonUi5.element.getAttributeValue(elem, attribute);
|
|
39
|
+
return expect(value).toContain(compareValue);
|
|
53
40
|
}
|
|
54
41
|
;
|
|
55
42
|
/**
|
|
@@ -61,12 +48,10 @@ class Assertion {
|
|
|
61
48
|
* @example const elem = await nonUi5.element.getById("button01");
|
|
62
49
|
* await nonUi5.assertion.expectValueToBe(elem, "Save");
|
|
63
50
|
*/
|
|
64
|
-
expectValueToBe(elem, compareValue) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
yield this.expectAttributeToBe(elem, compareValue);
|
|
69
|
-
});
|
|
51
|
+
async expectValueToBe(elem, compareValue) {
|
|
52
|
+
// Note: it is not required to send 'value' here, because 'expectAttributeToBe' is calling 'getValue' inside
|
|
53
|
+
// @ts-ignore
|
|
54
|
+
await this.expectAttributeToBe(elem, compareValue);
|
|
70
55
|
}
|
|
71
56
|
;
|
|
72
57
|
// =================================== VISIBILITY ===================================
|
|
@@ -78,22 +63,18 @@ class Assertion {
|
|
|
78
63
|
* @example const elem = await nonUi5.element.getById("button01");
|
|
79
64
|
* await nonUi5.assertion.expectToBeVisible(elem);
|
|
80
65
|
*/
|
|
81
|
-
expectToBeVisible(element) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
interval: 100,
|
|
94
|
-
timeout: 30000,
|
|
95
|
-
timeoutMsg: "Function 'expectToBeVisible' failed. Timeout by waiting for element to be visible."
|
|
96
|
-
});
|
|
66
|
+
async expectToBeVisible(element) {
|
|
67
|
+
if (!element) {
|
|
68
|
+
throw new Error("Function 'expectToBeVisible' failed. Please provide an element as argument.");
|
|
69
|
+
}
|
|
70
|
+
await browser.waitUntil(async function () {
|
|
71
|
+
const isPresent = await element.isExisting();
|
|
72
|
+
const isDisplayed = await element.isDisplayed();
|
|
73
|
+
return isPresent && isDisplayed;
|
|
74
|
+
}, {
|
|
75
|
+
interval: 100,
|
|
76
|
+
timeout: 30000,
|
|
77
|
+
timeoutMsg: "Function 'expectToBeVisible' failed. Timeout by waiting for element to be visible."
|
|
97
78
|
});
|
|
98
79
|
}
|
|
99
80
|
;
|
|
@@ -106,17 +87,15 @@ class Assertion {
|
|
|
106
87
|
* @example const elem = await nonUi5.element.getById("button01");
|
|
107
88
|
* await nonUi5.assertion.expectToBeNotVisible(elem, 5000);
|
|
108
89
|
*/
|
|
109
|
-
expectToBeNotVisible(element, timeout = process.env.QMATE_CUSTOM_TIMEOUT || 30000) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
interval: 100
|
|
119
|
-
});
|
|
90
|
+
async expectToBeNotVisible(element, timeout = process.env.QMATE_CUSTOM_TIMEOUT || 30000) {
|
|
91
|
+
if (!element) {
|
|
92
|
+
throw new Error("Function 'expectToBeNotVisible' failed. Please provide an element as argument.");
|
|
93
|
+
}
|
|
94
|
+
await element.waitForDisplayed({
|
|
95
|
+
timeout: +timeout,
|
|
96
|
+
reverse: true,
|
|
97
|
+
timeoutMsg: "Function 'expectToBeNotVisible' failed. Element is visible but was expected to be not.",
|
|
98
|
+
interval: 100
|
|
120
99
|
});
|
|
121
100
|
}
|
|
122
101
|
;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertion.js","sourceRoot":"","sources":["../../../../src/reuse/modules/nonUi5/assertion.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"assertion.js","sourceRoot":"","sources":["../../../../src/reuse/modules/nonUi5/assertion.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAIb;;;GAGG;AACH,MAAa,SAAS;IAEpB,qFAAqF;IACrF;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,mBAAmB,CAAE,IAAa,EAAE,YAAoB,EAAE,SAAiB;QAC/E,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QACtE,OAAO,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IAC3D,CAAC;IAAA,CAAC;IAEF;;;;;;;;;O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