playwright-ts-automationframework 1.1.40 → 1.1.42
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/lib/core/actions.core.d.ts +4 -4
- package/lib/core/actions.core.js +60 -36
- package/lib/core/assertion.core.js +32 -32
- package/package.json +1 -1
|
@@ -172,7 +172,7 @@ export declare class Actions extends BasePage {
|
|
|
172
172
|
*
|
|
173
173
|
* let errorMessage = getText(errorMsg);
|
|
174
174
|
*/
|
|
175
|
-
getText(control: WebControl): Promise<string
|
|
175
|
+
getText(control: WebControl): Promise<string>;
|
|
176
176
|
/**
|
|
177
177
|
* Read textbox value of an element
|
|
178
178
|
*
|
|
@@ -184,7 +184,7 @@ export declare class Actions extends BasePage {
|
|
|
184
184
|
*
|
|
185
185
|
* let textboxValue = getTextboxValue(usernameTxtbx);
|
|
186
186
|
*/
|
|
187
|
-
getTextboxValue(control: WebControl): Promise<string
|
|
187
|
+
getTextboxValue(control: WebControl): Promise<string>;
|
|
188
188
|
/**
|
|
189
189
|
* Read selected dropdown item.
|
|
190
190
|
*
|
|
@@ -196,7 +196,7 @@ export declare class Actions extends BasePage {
|
|
|
196
196
|
*
|
|
197
197
|
* let selectedItem = getSelectedItemFromDropdown(cityDrpdwn);
|
|
198
198
|
*/
|
|
199
|
-
getSelectedItemFromDropdown(control: WebControl): Promise<string
|
|
199
|
+
getSelectedItemFromDropdown(control: WebControl): Promise<string>;
|
|
200
200
|
/**
|
|
201
201
|
* Read attribute value of element.
|
|
202
202
|
*
|
|
@@ -209,7 +209,7 @@ export declare class Actions extends BasePage {
|
|
|
209
209
|
*
|
|
210
210
|
* let attributeValue = getAttributeValue(usernameTxtbx, "title");
|
|
211
211
|
*/
|
|
212
|
-
getAttributeValue(control: WebControl, attributeName: string): Promise<string |
|
|
212
|
+
getAttributeValue(control: WebControl, attributeName: string): Promise<string | null>;
|
|
213
213
|
/**
|
|
214
214
|
* Scroll to an element.
|
|
215
215
|
*
|
package/lib/core/actions.core.js
CHANGED
|
@@ -460,15 +460,21 @@ var Actions = /** @class */ (function (_super) {
|
|
|
460
460
|
*/
|
|
461
461
|
Actions.prototype.getText = function (control) {
|
|
462
462
|
return __awaiter(this, void 0, void 0, function () {
|
|
463
|
+
var text, error_1;
|
|
463
464
|
return __generator(this, function (_a) {
|
|
464
465
|
switch (_a.label) {
|
|
465
|
-
case 0:
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
466
|
+
case 0:
|
|
467
|
+
_a.trys.push([0, 2, , 3]);
|
|
468
|
+
return [4 /*yield*/, control.controlLocator.first().innerText()];
|
|
469
|
+
case 1:
|
|
470
|
+
text = _a.sent();
|
|
471
|
+
(0, logs_core_1.logConsole)("Value read from '".concat(control.controlDescription, "' is: '").concat(text, "'"));
|
|
472
|
+
return [2 /*return*/, text];
|
|
473
|
+
case 2:
|
|
474
|
+
error_1 = _a.sent();
|
|
475
|
+
(0, logs_core_1.logError)("Unable to read the text from '".concat(control.controlDescription, "' due to reason: ").concat(error_1));
|
|
476
|
+
return [2 /*return*/, '']; // Return an empty string or handle it as needed
|
|
477
|
+
case 3: return [2 /*return*/];
|
|
472
478
|
}
|
|
473
479
|
});
|
|
474
480
|
});
|
|
@@ -486,15 +492,21 @@ var Actions = /** @class */ (function (_super) {
|
|
|
486
492
|
*/
|
|
487
493
|
Actions.prototype.getTextboxValue = function (control) {
|
|
488
494
|
return __awaiter(this, void 0, void 0, function () {
|
|
495
|
+
var value, error_2;
|
|
489
496
|
return __generator(this, function (_a) {
|
|
490
497
|
switch (_a.label) {
|
|
491
|
-
case 0:
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
+
case 0:
|
|
499
|
+
_a.trys.push([0, 2, , 3]);
|
|
500
|
+
return [4 /*yield*/, control.controlLocator.first().inputValue()];
|
|
501
|
+
case 1:
|
|
502
|
+
value = _a.sent();
|
|
503
|
+
(0, logs_core_1.logConsole)("Value read from textbox '".concat(control.controlDescription, "' is: '").concat(value, "'"));
|
|
504
|
+
return [2 /*return*/, value];
|
|
505
|
+
case 2:
|
|
506
|
+
error_2 = _a.sent();
|
|
507
|
+
(0, logs_core_1.logError)("Unable to read the value from '".concat(control.controlDescription, "' due to reason: ").concat(error_2));
|
|
508
|
+
return [2 /*return*/, '']; // Return an empty string or handle it as needed
|
|
509
|
+
case 3: return [2 /*return*/];
|
|
498
510
|
}
|
|
499
511
|
});
|
|
500
512
|
});
|
|
@@ -512,15 +524,21 @@ var Actions = /** @class */ (function (_super) {
|
|
|
512
524
|
*/
|
|
513
525
|
Actions.prototype.getSelectedItemFromDropdown = function (control) {
|
|
514
526
|
return __awaiter(this, void 0, void 0, function () {
|
|
527
|
+
var value, error_3;
|
|
515
528
|
return __generator(this, function (_a) {
|
|
516
529
|
switch (_a.label) {
|
|
517
|
-
case 0:
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
530
|
+
case 0:
|
|
531
|
+
_a.trys.push([0, 2, , 3]);
|
|
532
|
+
return [4 /*yield*/, control.controlLocator.first().inputValue()];
|
|
533
|
+
case 1:
|
|
534
|
+
value = _a.sent();
|
|
535
|
+
(0, logs_core_1.logConsole)("Value read from '".concat(control.controlDescription, "' is: '").concat(value, "'"));
|
|
536
|
+
return [2 /*return*/, value];
|
|
537
|
+
case 2:
|
|
538
|
+
error_3 = _a.sent();
|
|
539
|
+
(0, logs_core_1.logError)("Unable to read the value from '".concat(control.controlDescription, "' due to reason: ").concat(error_3));
|
|
540
|
+
return [2 /*return*/, '']; // Return an empty string or handle it as needed
|
|
541
|
+
case 3: return [2 /*return*/];
|
|
524
542
|
}
|
|
525
543
|
});
|
|
526
544
|
});
|
|
@@ -539,15 +557,21 @@ var Actions = /** @class */ (function (_super) {
|
|
|
539
557
|
*/
|
|
540
558
|
Actions.prototype.getAttributeValue = function (control, attributeName) {
|
|
541
559
|
return __awaiter(this, void 0, void 0, function () {
|
|
560
|
+
var value, error_4;
|
|
542
561
|
return __generator(this, function (_a) {
|
|
543
562
|
switch (_a.label) {
|
|
544
|
-
case 0:
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
563
|
+
case 0:
|
|
564
|
+
_a.trys.push([0, 2, , 3]);
|
|
565
|
+
return [4 /*yield*/, control.controlLocator.first().getAttribute(attributeName)];
|
|
566
|
+
case 1:
|
|
567
|
+
value = _a.sent();
|
|
568
|
+
(0, logs_core_1.logConsole)("Attribute value for '".concat(control.controlDescription, "' - Attribute Name: '").concat(attributeName, "', Value: '").concat(value, "'"));
|
|
569
|
+
return [2 /*return*/, value];
|
|
570
|
+
case 2:
|
|
571
|
+
error_4 = _a.sent();
|
|
572
|
+
(0, logs_core_1.logError)("Unable to read attribute value from '".concat(control.controlDescription, "' - Reason: ").concat(error_4));
|
|
573
|
+
return [2 /*return*/, null]; // Return `null` instead of `undefined` if an error occurs
|
|
574
|
+
case 3: return [2 /*return*/];
|
|
551
575
|
}
|
|
552
576
|
});
|
|
553
577
|
});
|
|
@@ -732,7 +756,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
732
756
|
*/
|
|
733
757
|
Actions.prototype.waitTillPageURLContains = function (url_1) {
|
|
734
758
|
return __awaiter(this, arguments, void 0, function (url, timeoutInSeconds) {
|
|
735
|
-
var
|
|
759
|
+
var error_5;
|
|
736
760
|
if (timeoutInSeconds === void 0) { timeoutInSeconds = 30; }
|
|
737
761
|
return __generator(this, function (_a) {
|
|
738
762
|
switch (_a.label) {
|
|
@@ -744,7 +768,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
744
768
|
})];
|
|
745
769
|
case 1: return [2 /*return*/, _a.sent()];
|
|
746
770
|
case 2:
|
|
747
|
-
|
|
771
|
+
error_5 = _a.sent();
|
|
748
772
|
return [3 /*break*/, 3];
|
|
749
773
|
case 3: return [2 /*return*/];
|
|
750
774
|
}
|
|
@@ -764,7 +788,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
764
788
|
*/
|
|
765
789
|
Actions.prototype.waitTillElementIsPresent = function (control_1) {
|
|
766
790
|
return __awaiter(this, arguments, void 0, function (control, timeoutInSeconds) {
|
|
767
|
-
var
|
|
791
|
+
var error_6;
|
|
768
792
|
if (timeoutInSeconds === void 0) { timeoutInSeconds = 30; }
|
|
769
793
|
return __generator(this, function (_a) {
|
|
770
794
|
switch (_a.label) {
|
|
@@ -782,7 +806,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
782
806
|
_a.sent();
|
|
783
807
|
return [3 /*break*/, 5];
|
|
784
808
|
case 4:
|
|
785
|
-
|
|
809
|
+
error_6 = _a.sent();
|
|
786
810
|
return [3 /*break*/, 5];
|
|
787
811
|
case 5: return [2 /*return*/];
|
|
788
812
|
}
|
|
@@ -802,7 +826,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
802
826
|
*/
|
|
803
827
|
Actions.prototype.waitTillElementIsAttached = function (control_1) {
|
|
804
828
|
return __awaiter(this, arguments, void 0, function (control, timeoutInSeconds) {
|
|
805
|
-
var
|
|
829
|
+
var error_7;
|
|
806
830
|
if (timeoutInSeconds === void 0) { timeoutInSeconds = 30; }
|
|
807
831
|
return __generator(this, function (_a) {
|
|
808
832
|
switch (_a.label) {
|
|
@@ -820,7 +844,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
820
844
|
_a.sent();
|
|
821
845
|
return [3 /*break*/, 5];
|
|
822
846
|
case 4:
|
|
823
|
-
|
|
847
|
+
error_7 = _a.sent();
|
|
824
848
|
return [3 /*break*/, 5];
|
|
825
849
|
case 5: return [2 /*return*/];
|
|
826
850
|
}
|
|
@@ -840,7 +864,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
840
864
|
*/
|
|
841
865
|
Actions.prototype.waitTillElementIsNotPresent = function (control_1) {
|
|
842
866
|
return __awaiter(this, arguments, void 0, function (control, timeoutInSeconds) {
|
|
843
|
-
var
|
|
867
|
+
var error_8;
|
|
844
868
|
if (timeoutInSeconds === void 0) { timeoutInSeconds = 30; }
|
|
845
869
|
return __generator(this, function (_a) {
|
|
846
870
|
switch (_a.label) {
|
|
@@ -854,7 +878,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
854
878
|
_a.sent();
|
|
855
879
|
return [3 /*break*/, 3];
|
|
856
880
|
case 2:
|
|
857
|
-
|
|
881
|
+
error_8 = _a.sent();
|
|
858
882
|
return [3 /*break*/, 3];
|
|
859
883
|
case 3: return [2 /*return*/];
|
|
860
884
|
}
|
|
@@ -79,7 +79,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
79
79
|
try {
|
|
80
80
|
var verificationResult = object1 === object2 ? "PASSED" : "FAILED";
|
|
81
81
|
(0, logs_core_1.logVerification)("VERIFICATION: ".concat(verificationResult, ". ").concat(controlDescription, " Expected: '").concat(object1, "' Actual: '").concat(object2, "'"));
|
|
82
|
-
test_1.expect
|
|
82
|
+
(0, test_1.expect)(object1).toBe(object2);
|
|
83
83
|
}
|
|
84
84
|
catch (error1) {
|
|
85
85
|
(0, logs_core_1.logError)("VERIFICATION: FAILED. Expected: '" + object1 + "' Actual: '" + object2 + "'");
|
|
@@ -102,7 +102,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
102
102
|
var verificationResult = actual.trim().includes(expected.trim()) ? "PASSED" : "FAILED";
|
|
103
103
|
var logText = "VERIFICATION: ".concat(verificationResult, ". ").concat(controlDescription, " Actual: '").concat(actual, "' contains Expected: '").concat(expected.trim(), "'");
|
|
104
104
|
(0, logs_core_1.logVerification)(logText);
|
|
105
|
-
test_1.expect
|
|
105
|
+
(0, test_1.expect)(actual.trim(), logText).toContain(expected.trim());
|
|
106
106
|
}
|
|
107
107
|
catch (error1) {
|
|
108
108
|
(0, logs_core_1.logError)("VERIFICATION: FAILED. Actual: '" + expected + "' contains Expected: '" + actual + "'");
|
|
@@ -135,7 +135,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
135
135
|
var verificationResult = value === expectedIsDisplayed ? "PASSED" : "FAILED";
|
|
136
136
|
var logText = "VERIFICATION: ".concat(verificationResult, " '").concat(control.controlDescription, "' displayed status is '").concat(value, "' Expected: ").concat(expectedIsDisplayed);
|
|
137
137
|
(0, logs_core_1.logVerification)(logText);
|
|
138
|
-
test_1.expect
|
|
138
|
+
(0, test_1.expect)(value, logText).toBe(expectedIsDisplayed);
|
|
139
139
|
}, function (reason) {
|
|
140
140
|
(0, logs_core_1.logError)("VERIFICATION: FAILED. '" + control.controlDescription + "' displayed status is: '" + false + "' due to reason: " + reason);
|
|
141
141
|
})];
|
|
@@ -184,7 +184,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
184
184
|
verificationResult = value === true ? "PASSED" : "FAILED";
|
|
185
185
|
logText = "VERIFICATION: ".concat(verificationResult, ". '").concat(control.controlDescription, "' hidden status is '").concat(value, "' Expected: true");
|
|
186
186
|
(0, logs_core_1.logVerification)(logText);
|
|
187
|
-
return [4 /*yield*/, test_1.expect
|
|
187
|
+
return [4 /*yield*/, (0, test_1.expect)(element, logText).toBeHidden()];
|
|
188
188
|
case 1:
|
|
189
189
|
_a.sent();
|
|
190
190
|
return [2 /*return*/];
|
|
@@ -223,7 +223,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
223
223
|
verificationResult = (value === null || value === void 0 ? void 0 : value.trim()) === expectedAttributeValue ? "PASSED" : "FAILED";
|
|
224
224
|
logText = "VERIFICATION: ".concat(verificationResult, ". Attribute value of ").concat(control.controlDescription, " Expected: '").concat(expectedAttributeValue, "' Actual : '").concat(value, "'");
|
|
225
225
|
(0, logs_core_1.logVerification)(logText);
|
|
226
|
-
test_1.expect
|
|
226
|
+
(0, test_1.expect)(value, logText).toBe(expectedAttributeValue);
|
|
227
227
|
return [2 /*return*/];
|
|
228
228
|
});
|
|
229
229
|
}); })];
|
|
@@ -254,26 +254,26 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
254
254
|
return __generator(this, function (_a) {
|
|
255
255
|
switch (_a.label) {
|
|
256
256
|
case 0: return [4 /*yield*/, this.getAttributeValue(control, attributeName).then(function (value) { return __awaiter(_this, void 0, void 0, function () {
|
|
257
|
-
var verificationResult, logText, _a, _b
|
|
258
|
-
return __generator(this, function (
|
|
259
|
-
switch (
|
|
257
|
+
var verificationResult, logText, _a, _b;
|
|
258
|
+
return __generator(this, function (_c) {
|
|
259
|
+
switch (_c.label) {
|
|
260
260
|
case 0:
|
|
261
261
|
if (!(value != null)) return [3 /*break*/, 2];
|
|
262
262
|
verificationResult = value.includes(attributeValue) ? "PASSED" : "FAILED";
|
|
263
263
|
logText = "VERIFICATION: ".concat(verificationResult, ". Atribute value of ").concat(control.controlLocator, " Expected: '").concat(attributeValue, "' contains Actual : '").concat(value, "'");
|
|
264
264
|
(0, logs_core_1.logVerification)(logText);
|
|
265
|
-
|
|
265
|
+
_a = test_1.expect;
|
|
266
266
|
return [4 /*yield*/, this.getAttributeValue(control, attributeName)];
|
|
267
267
|
case 1:
|
|
268
|
-
|
|
268
|
+
_a.apply(void 0, [_c.sent(), logText]).toContain(attributeValue);
|
|
269
269
|
return [3 /*break*/, 4];
|
|
270
270
|
case 2:
|
|
271
271
|
(0, logs_core_1.logVerification)("VERIFICATION: FAILED. Expected: '".concat(attributeValue, "' does not contains Actual: '").concat(value, "'"));
|
|
272
|
-
|
|
272
|
+
_b = test_1.expect;
|
|
273
273
|
return [4 /*yield*/, this.getAttributeValue(control, attributeName)];
|
|
274
274
|
case 3:
|
|
275
|
-
|
|
276
|
-
|
|
275
|
+
_b.apply(void 0, [_c.sent(), "VERIFICATION: FAILED. Expected: '".concat(attributeValue, "' does not contains Actual: '").concat(value, "'")]).toContain(attributeValue);
|
|
276
|
+
_c.label = 4;
|
|
277
277
|
case 4: return [2 /*return*/];
|
|
278
278
|
}
|
|
279
279
|
});
|
|
@@ -312,7 +312,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
312
312
|
var verificationResult = value === expValue ? "PASSED" : "FAILED";
|
|
313
313
|
var logText = "VERIFICATION: ".concat(verificationResult, " '").concat(control.controlDescription, "' enabled status is: '").concat(value, "' Expected: ").concat(expValue);
|
|
314
314
|
(0, logs_core_1.logVerification)(logText);
|
|
315
|
-
test_1.expect
|
|
315
|
+
(0, test_1.expect)(value, logText).toBe(expValue);
|
|
316
316
|
})];
|
|
317
317
|
case 3:
|
|
318
318
|
_a.sent();
|
|
@@ -345,7 +345,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
345
345
|
var verificationResult = isChecked === expValue ? "PASSED" : "FAILED";
|
|
346
346
|
var logText = "VERIFICATION: ".concat(verificationResult, " '").concat(control.controlDescription, "' selected status is: '").concat(isChecked, "' Expected: ").concat(expValue);
|
|
347
347
|
(0, logs_core_1.logVerification)(logText);
|
|
348
|
-
test_1.expect
|
|
348
|
+
(0, test_1.expect)(isChecked, logText).toBe(expValue);
|
|
349
349
|
})];
|
|
350
350
|
case 3:
|
|
351
351
|
_a.sent();
|
|
@@ -374,7 +374,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
374
374
|
var verificationResult = (value === null || value === void 0 ? void 0 : value.trim()) === expectedText.trim() ? "PASSED" : "FAILED";
|
|
375
375
|
var logText = "VERIFICATION: '".concat(verificationResult, "' Verify text of ").concat(control.controlDescription, ". Expected: '").concat(expectedText, "' Actual: '").concat(value, "'");
|
|
376
376
|
(0, logs_core_1.logVerification)(logText);
|
|
377
|
-
test_1.expect
|
|
377
|
+
(0, test_1.expect)(value === null || value === void 0 ? void 0 : value.trim(), logText).toBe(expectedText.trim());
|
|
378
378
|
})];
|
|
379
379
|
case 1:
|
|
380
380
|
_a.sent();
|
|
@@ -403,7 +403,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
403
403
|
var verificationResult = (value === null || value === void 0 ? void 0 : value.trim().includes(expectedText.trim())) ? "PASSED" : "FAILED";
|
|
404
404
|
var logText = "VERIFICATION: ".concat(verificationResult, ". Verify text of ").concat(control.controlDescription, " .Expected: '").concat(expectedText.trim(), "' is present in Actual: '").concat(value === null || value === void 0 ? void 0 : value.trim(), "'");
|
|
405
405
|
(0, logs_core_1.logVerification)(logText);
|
|
406
|
-
test_1.expect
|
|
406
|
+
(0, test_1.expect)(value === null || value === void 0 ? void 0 : value.trim(), logText).toContain(expectedText.trim());
|
|
407
407
|
})];
|
|
408
408
|
case 1:
|
|
409
409
|
_a.sent();
|
|
@@ -432,7 +432,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
432
432
|
var verificationResult = (value === null || value === void 0 ? void 0 : value.trim().includes(expectedText)) ? "PASSED" : "FAILED";
|
|
433
433
|
var logText = "VERIFICATION: ".concat(verificationResult, ". Verify text of ").concat(control.controlDescription, " Expected: '").concat(expectedText, "' does not contains Actual: '").concat(value, "'");
|
|
434
434
|
(0, logs_core_1.logVerification)(logText);
|
|
435
|
-
test_1.expect
|
|
435
|
+
(0, test_1.expect)(false, logText).toBe(value === null || value === void 0 ? void 0 : value.trim().includes(expectedText.trim()));
|
|
436
436
|
})];
|
|
437
437
|
case 1:
|
|
438
438
|
_a.sent();
|
|
@@ -461,7 +461,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
461
461
|
var verificationResult = (value === null || value === void 0 ? void 0 : value.trim()) === expectedText ? "PASSED" : "FAILED";
|
|
462
462
|
var logText = "VERIFICATION: ".concat(verificationResult, " Verify textbox value of ").concat(control.controlDescription, ". Expected: '").concat(expectedText, "' Actual: '").concat(value, "'");
|
|
463
463
|
(0, logs_core_1.logVerification)(logText);
|
|
464
|
-
test_1.expect
|
|
464
|
+
(0, test_1.expect)(value, logText).toEqual(expectedText);
|
|
465
465
|
})];
|
|
466
466
|
case 1:
|
|
467
467
|
_a.sent();
|
|
@@ -490,7 +490,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
490
490
|
var verificationResult = value.trim() === expectedText ? "PASSED" : "FAILED";
|
|
491
491
|
var logText = "VERIFICATION: ".concat(verificationResult, " Verify value of ").concat(control.controlDescription, ". Expected: '").concat(expectedText, "' Actual: '").concat(value, "'");
|
|
492
492
|
(0, logs_core_1.logVerification)(logText);
|
|
493
|
-
test_1.expect
|
|
493
|
+
(0, test_1.expect)(value, logText).toEqual(expectedText);
|
|
494
494
|
})];
|
|
495
495
|
case 1:
|
|
496
496
|
_a.sent();
|
|
@@ -519,7 +519,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
519
519
|
var verificationResult = value.trim() === expectedText ? "PASSED" : "FAILED";
|
|
520
520
|
var logText = "VERIFICATION: ".concat(verificationResult, " Verify value of ").concat(control.controlDescription, ". Expected: '").concat(expectedText, "' Actual: '").concat(value, "'");
|
|
521
521
|
(0, logs_core_1.logVerification)(logText);
|
|
522
|
-
test_1.expect
|
|
522
|
+
(0, test_1.expect)(value, logText).toEqual(expectedText);
|
|
523
523
|
})];
|
|
524
524
|
case 1:
|
|
525
525
|
_a.sent();
|
|
@@ -548,7 +548,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
548
548
|
var verificationResult = value === isChecked ? "PASSED" : "FAILED";
|
|
549
549
|
var logText = "VERIFICATION: ".concat(verificationResult, " Verify checkbox value of ").concat(control.controlDescription, ". Expected: '").concat(value, "' Actual: '").concat(isChecked, "'");
|
|
550
550
|
(0, logs_core_1.logVerification)(logText);
|
|
551
|
-
test_1.expect
|
|
551
|
+
(0, test_1.expect)(isChecked, logText).toBe(value);
|
|
552
552
|
})];
|
|
553
553
|
case 1:
|
|
554
554
|
_a.sent();
|
|
@@ -585,7 +585,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
585
585
|
verificationResult = (tagName === null || tagName === void 0 ? void 0 : tagName.toLowerCase()) == expectedTagName.toLowerCase() ? "PASSED" : "FAILED";
|
|
586
586
|
logText = "VERIFICATION: ".concat(verificationResult, " Verify Tagname of ").concat(control.controlDescription, ". Expected: '").concat(expectedTagName.toLowerCase(), "' Actual: '").concat(tagName === null || tagName === void 0 ? void 0 : tagName.toLowerCase(), "'");
|
|
587
587
|
(0, logs_core_1.logVerification)(logText);
|
|
588
|
-
test_1.expect
|
|
588
|
+
(0, test_1.expect)(tagName === null || tagName === void 0 ? void 0 : tagName.toLowerCase(), logText).toBe(expectedTagName.toLowerCase());
|
|
589
589
|
return [2 /*return*/];
|
|
590
590
|
}
|
|
591
591
|
});
|
|
@@ -617,7 +617,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
617
617
|
}).length;
|
|
618
618
|
verificationResult = count >= 1 ? "PASSED" : "FAILED";
|
|
619
619
|
(0, logs_core_1.logVerification)("VERIFICATION: ".concat(verificationResult, ". '").concat(valueToVerify, "' is Present in list '").concat(control.controlDescription, "'"));
|
|
620
|
-
test_1.expect
|
|
620
|
+
(0, test_1.expect)(count).toBeGreaterThanOrEqual(1);
|
|
621
621
|
return [2 /*return*/];
|
|
622
622
|
}
|
|
623
623
|
});
|
|
@@ -661,7 +661,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
661
661
|
}).length;
|
|
662
662
|
verificationResult = count >= 1 ? "PASSED" : "FAILED";
|
|
663
663
|
(0, logs_core_1.logVerification)("VERIFICATION: ".concat(verificationResult, ". '").concat(expectedValue, "' is Present in list '").concat(control.controlDescription, "'"));
|
|
664
|
-
test_1.expect
|
|
664
|
+
(0, test_1.expect)(count).toBeGreaterThanOrEqual(1);
|
|
665
665
|
return [2 /*return*/];
|
|
666
666
|
}
|
|
667
667
|
});
|
|
@@ -695,7 +695,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
695
695
|
return [4 /*yield*/, list[i].innerText().then(function (value) {
|
|
696
696
|
var verificationResult = value.trim().includes(listOfValueToVerify[i]) ? "PASSED" : "FAILED";
|
|
697
697
|
(0, logs_core_1.logVerification)("VERIFICATION: ".concat(verificationResult, ". Expected: '").concat(listOfValueToVerify[i], "' Actual: '").concat(value, "'"));
|
|
698
|
-
test_1.expect
|
|
698
|
+
(0, test_1.expect)(value.trim()).toContain(listOfValueToVerify[i]);
|
|
699
699
|
})];
|
|
700
700
|
case 2:
|
|
701
701
|
_b.sent();
|
|
@@ -738,7 +738,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
738
738
|
verificationResult = dialog.message().includes(expectedText) ? "PASSED" : "FAILED";
|
|
739
739
|
logText = "VERIFICATION: ".concat(verificationResult, " Verify alert text. Expected: '").concat(expectedText, "' Actual: '").concat(dialog.message(), "'");
|
|
740
740
|
(0, logs_core_1.logVerification)(logText);
|
|
741
|
-
test_1.expect
|
|
741
|
+
(0, test_1.expect)(dialog.message(), logText).toContain(expectedText);
|
|
742
742
|
return [2 /*return*/];
|
|
743
743
|
});
|
|
744
744
|
}); });
|
|
@@ -763,7 +763,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
763
763
|
var verificationResult = value.includes(subString) ? "PASSED" : "FAILED";
|
|
764
764
|
var logText = "VERIFICATION: ".concat(verificationResult, " Verify URL contains. Expected: '").concat(subString, "' Actual: '").concat(value, "'");
|
|
765
765
|
(0, logs_core_1.logVerification)(logText);
|
|
766
|
-
test_1.expect
|
|
766
|
+
(0, test_1.expect)(value, logText).toContain(subString);
|
|
767
767
|
})];
|
|
768
768
|
case 1:
|
|
769
769
|
_a.sent();
|
|
@@ -791,7 +791,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
791
791
|
var verificationResult = value == expectedCount ? "PASSED" : "FAILED";
|
|
792
792
|
var logText = "VERIFICATION: ".concat(verificationResult, " Verify count of elements of ").concat(control.controlDescription, ". Expected: '").concat(expectedCount, "' Actual: '").concat(value, "'");
|
|
793
793
|
(0, logs_core_1.logVerification)(logText);
|
|
794
|
-
test_1.expect
|
|
794
|
+
(0, test_1.expect)(value, logText).toBe(expectedCount);
|
|
795
795
|
})];
|
|
796
796
|
case 1:
|
|
797
797
|
_a.sent();
|
|
@@ -808,7 +808,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
808
808
|
var verificationResult = value >= expectedCount ? "PASSED" : "FAILED";
|
|
809
809
|
var logText = "VERIFICATION: ".concat(verificationResult, " Verify count of elements of ").concat(control.controlDescription, ". Expected: '").concat(expectedCount, "' Actual: '").concat(value, "'");
|
|
810
810
|
(0, logs_core_1.logVerification)(logText);
|
|
811
|
-
test_1.expect
|
|
811
|
+
(0, test_1.expect)(value, logText).toBeGreaterThanOrEqual(expectedCount);
|
|
812
812
|
})];
|
|
813
813
|
case 1:
|
|
814
814
|
_a.sent();
|
|
@@ -825,7 +825,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
825
825
|
var verificationResult = value <= expectedCount ? "PASSED" : "FAILED";
|
|
826
826
|
var logText = "VERIFICATION: ".concat(verificationResult, " Verify count of elements of ").concat(control.controlDescription, ". Expected: '").concat(expectedCount, "' Actual: '").concat(value, "'");
|
|
827
827
|
(0, logs_core_1.logVerification)(logText);
|
|
828
|
-
test_1.expect
|
|
828
|
+
(0, test_1.expect)(value, logText).toBeLessThanOrEqual(expectedCount);
|
|
829
829
|
})];
|
|
830
830
|
case 1:
|
|
831
831
|
_a.sent();
|
|
@@ -854,7 +854,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
854
854
|
var verificationResult = value.trim().includes(expectedText) ? "PASSED" : "FAILED";
|
|
855
855
|
var logText = "VERIFICATION: ".concat(verificationResult, " Verify title contains. Expected: '").concat(expectedText, "' Actual: '").concat(value, "'");
|
|
856
856
|
(0, logs_core_1.logVerification)(logText);
|
|
857
|
-
test_1.expect
|
|
857
|
+
(0, test_1.expect)(value.trim(), logText).toContain(expectedText);
|
|
858
858
|
}, function (reason) {
|
|
859
859
|
(0, logs_core_1.logError)('Error : ' + reason);
|
|
860
860
|
})];
|