playwright-ts-automationframework 1.1.58 → 1.1.59
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.js +39 -36
- package/package.json +1 -1
package/lib/core/actions.core.js
CHANGED
|
@@ -360,30 +360,33 @@ var Actions = /** @class */ (function (_super) {
|
|
|
360
360
|
*/
|
|
361
361
|
Actions.prototype.selectCheckbox = function (control_1) {
|
|
362
362
|
return __awaiter(this, arguments, void 0, function (control, expectedCheckboxValue) {
|
|
363
|
+
var error_1;
|
|
363
364
|
if (expectedCheckboxValue === void 0) { expectedCheckboxValue = true; }
|
|
364
365
|
return __generator(this, function (_a) {
|
|
365
366
|
switch (_a.label) {
|
|
366
367
|
case 0: return [4 /*yield*/, this.waitTillElementIsPresent(control)];
|
|
367
368
|
case 1:
|
|
368
369
|
_a.sent();
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
throw error;
|
|
375
|
-
});
|
|
376
|
-
return [3 /*break*/, 4];
|
|
377
|
-
case 2: return [4 /*yield*/, control.controlLocator.first().uncheck().then(function () {
|
|
378
|
-
(0, logs_core_1.logAction)("Set checkbox value of '" + control.controlDescription + "' as unchecked");
|
|
379
|
-
}, function (error) {
|
|
380
|
-
(0, logs_core_1.logError)("\u274C Unable to set checkbox value of '".concat(control.controlDescription, "' as unchecked"));
|
|
381
|
-
throw error;
|
|
382
|
-
})];
|
|
370
|
+
_a.label = 2;
|
|
371
|
+
case 2:
|
|
372
|
+
_a.trys.push([2, 7, , 8]);
|
|
373
|
+
if (!expectedCheckboxValue) return [3 /*break*/, 4];
|
|
374
|
+
return [4 /*yield*/, control.controlLocator.first().check()];
|
|
383
375
|
case 3:
|
|
384
376
|
_a.sent();
|
|
385
|
-
|
|
386
|
-
|
|
377
|
+
(0, logs_core_1.logAction)("Set checkbox value of '" + control.controlDescription + "' as checked");
|
|
378
|
+
return [3 /*break*/, 6];
|
|
379
|
+
case 4: return [4 /*yield*/, control.controlLocator.first().uncheck()];
|
|
380
|
+
case 5:
|
|
381
|
+
_a.sent();
|
|
382
|
+
(0, logs_core_1.logAction)("Set checkbox value of '" + control.controlDescription + "' as unchecked");
|
|
383
|
+
_a.label = 6;
|
|
384
|
+
case 6: return [3 /*break*/, 8];
|
|
385
|
+
case 7:
|
|
386
|
+
error_1 = _a.sent();
|
|
387
|
+
(0, logs_core_1.logError)("\u274C Unable to set checkbox value of '".concat(control.controlDescription, "' as ").concat(expectedCheckboxValue ? "checked" : "unchecked"));
|
|
388
|
+
throw error_1;
|
|
389
|
+
case 8: return [2 /*return*/];
|
|
387
390
|
}
|
|
388
391
|
});
|
|
389
392
|
});
|
|
@@ -487,7 +490,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
487
490
|
*/
|
|
488
491
|
Actions.prototype.getText = function (control) {
|
|
489
492
|
return __awaiter(this, void 0, void 0, function () {
|
|
490
|
-
var text,
|
|
493
|
+
var text, error_2;
|
|
491
494
|
return __generator(this, function (_a) {
|
|
492
495
|
switch (_a.label) {
|
|
493
496
|
case 0:
|
|
@@ -498,8 +501,8 @@ var Actions = /** @class */ (function (_super) {
|
|
|
498
501
|
(0, logs_core_1.logConsole)("Value read from '".concat(control.controlDescription, "' is: '").concat(text, "'"));
|
|
499
502
|
return [2 /*return*/, text];
|
|
500
503
|
case 2:
|
|
501
|
-
|
|
502
|
-
(0, logs_core_1.logError)("\u274C Unable to read the text from '".concat(control.controlDescription, "' due to reason: ").concat(
|
|
504
|
+
error_2 = _a.sent();
|
|
505
|
+
(0, logs_core_1.logError)("\u274C Unable to read the text from '".concat(control.controlDescription, "' due to reason: ").concat(error_2));
|
|
503
506
|
return [2 /*return*/, '']; // Return an empty string or handle it as needed
|
|
504
507
|
case 3: return [2 /*return*/];
|
|
505
508
|
}
|
|
@@ -519,7 +522,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
519
522
|
*/
|
|
520
523
|
Actions.prototype.getTextboxValue = function (control) {
|
|
521
524
|
return __awaiter(this, void 0, void 0, function () {
|
|
522
|
-
var value,
|
|
525
|
+
var value, error_3;
|
|
523
526
|
return __generator(this, function (_a) {
|
|
524
527
|
switch (_a.label) {
|
|
525
528
|
case 0:
|
|
@@ -530,8 +533,8 @@ var Actions = /** @class */ (function (_super) {
|
|
|
530
533
|
(0, logs_core_1.logConsole)("Value read from textbox '".concat(control.controlDescription, "' is: '").concat(value, "'"));
|
|
531
534
|
return [2 /*return*/, value];
|
|
532
535
|
case 2:
|
|
533
|
-
|
|
534
|
-
(0, logs_core_1.logError)("\u274C Unable to read the value from '".concat(control.controlDescription, "' due to reason: ").concat(
|
|
536
|
+
error_3 = _a.sent();
|
|
537
|
+
(0, logs_core_1.logError)("\u274C Unable to read the value from '".concat(control.controlDescription, "' due to reason: ").concat(error_3));
|
|
535
538
|
return [2 /*return*/, '']; // Return an empty string or handle it as needed
|
|
536
539
|
case 3: return [2 /*return*/];
|
|
537
540
|
}
|
|
@@ -551,7 +554,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
551
554
|
*/
|
|
552
555
|
Actions.prototype.getSelectedItemFromDropdown = function (control) {
|
|
553
556
|
return __awaiter(this, void 0, void 0, function () {
|
|
554
|
-
var value,
|
|
557
|
+
var value, error_4;
|
|
555
558
|
return __generator(this, function (_a) {
|
|
556
559
|
switch (_a.label) {
|
|
557
560
|
case 0:
|
|
@@ -562,8 +565,8 @@ var Actions = /** @class */ (function (_super) {
|
|
|
562
565
|
(0, logs_core_1.logConsole)("Value read from '".concat(control.controlDescription, "' is: '").concat(value, "'"));
|
|
563
566
|
return [2 /*return*/, value];
|
|
564
567
|
case 2:
|
|
565
|
-
|
|
566
|
-
(0, logs_core_1.logError)("\u274C Unable to read the value from '".concat(control.controlDescription, "' due to reason: ").concat(
|
|
568
|
+
error_4 = _a.sent();
|
|
569
|
+
(0, logs_core_1.logError)("\u274C Unable to read the value from '".concat(control.controlDescription, "' due to reason: ").concat(error_4));
|
|
567
570
|
return [2 /*return*/, '']; // Return an empty string or handle it as needed
|
|
568
571
|
case 3: return [2 /*return*/];
|
|
569
572
|
}
|
|
@@ -584,7 +587,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
584
587
|
*/
|
|
585
588
|
Actions.prototype.getAttributeValue = function (control, attributeName) {
|
|
586
589
|
return __awaiter(this, void 0, void 0, function () {
|
|
587
|
-
var value,
|
|
590
|
+
var value, error_5;
|
|
588
591
|
return __generator(this, function (_a) {
|
|
589
592
|
switch (_a.label) {
|
|
590
593
|
case 0:
|
|
@@ -595,8 +598,8 @@ var Actions = /** @class */ (function (_super) {
|
|
|
595
598
|
(0, logs_core_1.logConsole)("Attribute value for '".concat(control.controlDescription, "' - Attribute Name: '").concat(attributeName, "', Value: '").concat(value, "'"));
|
|
596
599
|
return [2 /*return*/, value];
|
|
597
600
|
case 2:
|
|
598
|
-
|
|
599
|
-
(0, logs_core_1.logError)("\u274C Unable to read attribute value from '".concat(control.controlDescription, "' - Reason: ").concat(
|
|
601
|
+
error_5 = _a.sent();
|
|
602
|
+
(0, logs_core_1.logError)("\u274C Unable to read attribute value from '".concat(control.controlDescription, "' - Reason: ").concat(error_5));
|
|
600
603
|
return [2 /*return*/, ''];
|
|
601
604
|
case 3: return [2 /*return*/];
|
|
602
605
|
}
|
|
@@ -815,7 +818,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
815
818
|
*/
|
|
816
819
|
Actions.prototype.waitTillPageURLContains = function (url_1) {
|
|
817
820
|
return __awaiter(this, arguments, void 0, function (url, timeoutInSeconds) {
|
|
818
|
-
var
|
|
821
|
+
var error_6;
|
|
819
822
|
if (timeoutInSeconds === void 0) { timeoutInSeconds = 60; }
|
|
820
823
|
return __generator(this, function (_a) {
|
|
821
824
|
switch (_a.label) {
|
|
@@ -827,7 +830,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
827
830
|
})];
|
|
828
831
|
case 1: return [2 /*return*/, _a.sent()];
|
|
829
832
|
case 2:
|
|
830
|
-
|
|
833
|
+
error_6 = _a.sent();
|
|
831
834
|
return [3 /*break*/, 3];
|
|
832
835
|
case 3: return [2 /*return*/];
|
|
833
836
|
}
|
|
@@ -847,7 +850,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
847
850
|
*/
|
|
848
851
|
Actions.prototype.waitTillElementIsPresent = function (control_1) {
|
|
849
852
|
return __awaiter(this, arguments, void 0, function (control, timeoutInSeconds) {
|
|
850
|
-
var
|
|
853
|
+
var error_7;
|
|
851
854
|
if (timeoutInSeconds === void 0) { timeoutInSeconds = 60; }
|
|
852
855
|
return __generator(this, function (_a) {
|
|
853
856
|
switch (_a.label) {
|
|
@@ -865,7 +868,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
865
868
|
_a.sent();
|
|
866
869
|
return [3 /*break*/, 5];
|
|
867
870
|
case 4:
|
|
868
|
-
|
|
871
|
+
error_7 = _a.sent();
|
|
869
872
|
return [3 /*break*/, 5];
|
|
870
873
|
case 5: return [2 /*return*/];
|
|
871
874
|
}
|
|
@@ -885,7 +888,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
885
888
|
*/
|
|
886
889
|
Actions.prototype.waitTillElementIsAttached = function (control_1) {
|
|
887
890
|
return __awaiter(this, arguments, void 0, function (control, timeoutInSeconds) {
|
|
888
|
-
var
|
|
891
|
+
var error_8;
|
|
889
892
|
if (timeoutInSeconds === void 0) { timeoutInSeconds = 60; }
|
|
890
893
|
return __generator(this, function (_a) {
|
|
891
894
|
switch (_a.label) {
|
|
@@ -903,7 +906,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
903
906
|
_a.sent();
|
|
904
907
|
return [3 /*break*/, 5];
|
|
905
908
|
case 4:
|
|
906
|
-
|
|
909
|
+
error_8 = _a.sent();
|
|
907
910
|
return [3 /*break*/, 5];
|
|
908
911
|
case 5: return [2 /*return*/];
|
|
909
912
|
}
|
|
@@ -923,7 +926,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
923
926
|
*/
|
|
924
927
|
Actions.prototype.waitTillElementIsNotPresent = function (control_1) {
|
|
925
928
|
return __awaiter(this, arguments, void 0, function (control, timeoutInSeconds) {
|
|
926
|
-
var
|
|
929
|
+
var error_9;
|
|
927
930
|
if (timeoutInSeconds === void 0) { timeoutInSeconds = 60; }
|
|
928
931
|
return __generator(this, function (_a) {
|
|
929
932
|
switch (_a.label) {
|
|
@@ -937,7 +940,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
937
940
|
_a.sent();
|
|
938
941
|
return [3 /*break*/, 3];
|
|
939
942
|
case 2:
|
|
940
|
-
|
|
943
|
+
error_9 = _a.sent();
|
|
941
944
|
return [3 /*break*/, 3];
|
|
942
945
|
case 3: return [2 /*return*/];
|
|
943
946
|
}
|