playwright-ts-automationframework 1.1.55 → 1.1.57
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
CHANGED
|
@@ -82,8 +82,8 @@ var Actions = /** @class */ (function (_super) {
|
|
|
82
82
|
case 0: return [4 /*yield*/, control.controlLocator.first().click({ force: isforceful }).then(function () {
|
|
83
83
|
(0, logs_core_1.logAction)("Clicked on '" + control.controlDescription + "'");
|
|
84
84
|
}, function (error) {
|
|
85
|
-
(0, logs_core_1.logError)("
|
|
86
|
-
(0, logs_core_1.logConsole)("Error: '"
|
|
85
|
+
(0, logs_core_1.logError)("\u274C Unable to click on '".concat(control.controlDescription, "'"));
|
|
86
|
+
(0, logs_core_1.logConsole)("Error: '".concat(error, "'"));
|
|
87
87
|
throw error;
|
|
88
88
|
})];
|
|
89
89
|
case 1:
|
|
@@ -111,8 +111,8 @@ var Actions = /** @class */ (function (_super) {
|
|
|
111
111
|
case 0: return [4 /*yield*/, control.controlLocator.first().hover().then(function () {
|
|
112
112
|
(0, logs_core_1.logAction)("Mouse hover to '" + control.controlDescription + "'");
|
|
113
113
|
}, function (error) {
|
|
114
|
-
(0, logs_core_1.logError)("
|
|
115
|
-
(0, logs_core_1.logConsole)("Error: '"
|
|
114
|
+
(0, logs_core_1.logError)("\u274C Unable to mouse hover on '".concat(control.controlDescription, "'"));
|
|
115
|
+
(0, logs_core_1.logConsole)("Error: '".concat(error, "'"));
|
|
116
116
|
})];
|
|
117
117
|
case 1:
|
|
118
118
|
_a.sent();
|
|
@@ -165,13 +165,13 @@ var Actions = /** @class */ (function (_super) {
|
|
|
165
165
|
switch (_a.label) {
|
|
166
166
|
case 0: return [4 /*yield*/, control.controlLocator.first().fill(textTobeEntered).then(function () {
|
|
167
167
|
if (control.controlDescription.trim().toLowerCase().endsWith('textbox')) {
|
|
168
|
-
(0, logs_core_1.logAction)("Entered '"
|
|
168
|
+
(0, logs_core_1.logAction)("Entered '".concat(textTobeEntered, "' in '").concat(control.controlDescription, "'"));
|
|
169
169
|
}
|
|
170
170
|
else {
|
|
171
|
-
(0, logs_core_1.logAction)("Entered '"
|
|
171
|
+
(0, logs_core_1.logAction)("Entered '".concat(textTobeEntered, "' in '").concat(control.controlDescription, "' textbox"));
|
|
172
172
|
}
|
|
173
173
|
}, function (error) {
|
|
174
|
-
(0, logs_core_1.logError)("
|
|
174
|
+
(0, logs_core_1.logError)("\u274C Unable to enter text in '".concat(control.controlDescription, "' textbox due to reason: ").concat(error));
|
|
175
175
|
throw error;
|
|
176
176
|
})];
|
|
177
177
|
case 1:
|
|
@@ -187,13 +187,13 @@ var Actions = /** @class */ (function (_super) {
|
|
|
187
187
|
switch (_a.label) {
|
|
188
188
|
case 0: return [4 /*yield*/, control.controlLocator.first().fill(textTobeEntered).then(function () {
|
|
189
189
|
if (control.controlDescription.trim().toLowerCase().endsWith('textbox')) {
|
|
190
|
-
(0, logs_core_1.logAction)("Entered '********' in '"
|
|
190
|
+
(0, logs_core_1.logAction)("Entered '********' in '".concat(control.controlDescription, "'"));
|
|
191
191
|
}
|
|
192
192
|
else {
|
|
193
|
-
(0, logs_core_1.logAction)("Entered '********' in '"
|
|
193
|
+
(0, logs_core_1.logAction)("Entered '********' in '".concat(control.controlDescription, "' textbox"));
|
|
194
194
|
}
|
|
195
195
|
}, function (error) {
|
|
196
|
-
(0, logs_core_1.logError)("
|
|
196
|
+
(0, logs_core_1.logError)("\u274C Unable to enter text in '".concat(control.controlDescription, "' textbox due to reason: ").concat(error));
|
|
197
197
|
throw error;
|
|
198
198
|
})];
|
|
199
199
|
case 1:
|
|
@@ -220,7 +220,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
220
220
|
return __generator(this, function (_a) {
|
|
221
221
|
switch (_a.label) {
|
|
222
222
|
case 0: return [4 /*yield*/, control.controlLocator.first().press(key).then(function () {
|
|
223
|
-
(0, logs_core_1.logAction)("Press Key '"
|
|
223
|
+
(0, logs_core_1.logAction)("Press Key '".concat(key.toUpperCase(), "' on '").concat(control.controlDescription, "'"));
|
|
224
224
|
})];
|
|
225
225
|
case 1:
|
|
226
226
|
_a.sent();
|
|
@@ -248,8 +248,8 @@ var Actions = /** @class */ (function (_super) {
|
|
|
248
248
|
case 0: return [4 /*yield*/, control.controlLocator.first().selectOption({ value: optionTobeSelcted }).then(function () {
|
|
249
249
|
(0, logs_core_1.logAction)("Selected '" + optionTobeSelcted + "' from '" + control.controlDescription + "'");
|
|
250
250
|
}, function (error) {
|
|
251
|
-
(0, logs_core_1.logError)("
|
|
252
|
-
(0, logs_core_1.logConsole)("Error: '"
|
|
251
|
+
(0, logs_core_1.logError)("\u274C Unable to select '".concat(optionTobeSelcted, "' from '").concat(control.controlDescription, "'"));
|
|
252
|
+
(0, logs_core_1.logConsole)("Error: '".concat(error, "'"));
|
|
253
253
|
throw error;
|
|
254
254
|
})];
|
|
255
255
|
case 1:
|
|
@@ -276,10 +276,10 @@ var Actions = /** @class */ (function (_super) {
|
|
|
276
276
|
return __generator(this, function (_a) {
|
|
277
277
|
switch (_a.label) {
|
|
278
278
|
case 0: return [4 /*yield*/, control.controlLocator.first().selectOption({ label: optionTobeSelcted }).then(function () {
|
|
279
|
-
(0, logs_core_1.logAction)("Selected '"
|
|
279
|
+
(0, logs_core_1.logAction)("Selected '".concat(optionTobeSelcted, "' from '").concat(control.controlDescription, "'"));
|
|
280
280
|
}, function (error) {
|
|
281
|
-
(0, logs_core_1.logError)("
|
|
282
|
-
(0, logs_core_1.logConsole)("Error: '"
|
|
281
|
+
(0, logs_core_1.logError)("\u274C Unable to select '".concat(optionTobeSelcted, "' from '").concat(control.controlDescription, "'"));
|
|
282
|
+
(0, logs_core_1.logConsole)("Error: '".concat(error, "'"));
|
|
283
283
|
throw error;
|
|
284
284
|
})];
|
|
285
285
|
case 1:
|
|
@@ -335,8 +335,8 @@ var Actions = /** @class */ (function (_super) {
|
|
|
335
335
|
case 0: return [4 /*yield*/, control.controlLocator.first().selectOption({ index: index }).then(function () {
|
|
336
336
|
(0, logs_core_1.logAction)("Selected '" + index + "' option from '" + control.controlDescription + "'");
|
|
337
337
|
}, function (error) {
|
|
338
|
-
(0, logs_core_1.logError)("
|
|
339
|
-
(0, logs_core_1.
|
|
338
|
+
(0, logs_core_1.logError)("\u274C Unable to select '".concat(index, "' option from '").concat(control.controlDescription, "'"));
|
|
339
|
+
(0, logs_core_1.logConsole)("Error: '".concat(error, "'"));
|
|
340
340
|
throw error;
|
|
341
341
|
})];
|
|
342
342
|
case 1:
|
|
@@ -370,14 +370,14 @@ var Actions = /** @class */ (function (_super) {
|
|
|
370
370
|
control.controlLocator.first().check().then(function () {
|
|
371
371
|
(0, logs_core_1.logAction)("Set checkbox value of '" + control.controlDescription + "' as checked");
|
|
372
372
|
}, function (error) {
|
|
373
|
-
(0, logs_core_1.logError)("
|
|
373
|
+
(0, logs_core_1.logError)("\u274C Unable to set checkbox value of '".concat(control.controlDescription, "' as checked"));
|
|
374
374
|
throw error;
|
|
375
375
|
});
|
|
376
376
|
return [3 /*break*/, 4];
|
|
377
377
|
case 2: return [4 /*yield*/, control.controlLocator.first().uncheck().then(function () {
|
|
378
378
|
(0, logs_core_1.logAction)("Set checkbox value of '" + control.controlDescription + "' as unchecked");
|
|
379
379
|
}, function (error) {
|
|
380
|
-
(0, logs_core_1.logError)("
|
|
380
|
+
(0, logs_core_1.logError)("\u274C Unable to set checkbox value of '".concat(control.controlDescription, "' as unchecked"));
|
|
381
381
|
throw error;
|
|
382
382
|
})];
|
|
383
383
|
case 3:
|
|
@@ -499,7 +499,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
499
499
|
return [2 /*return*/, text];
|
|
500
500
|
case 2:
|
|
501
501
|
error_1 = _a.sent();
|
|
502
|
-
(0, logs_core_1.logError)("
|
|
502
|
+
(0, logs_core_1.logError)("\u274C Unable to read the text from '".concat(control.controlDescription, "' due to reason: ").concat(error_1));
|
|
503
503
|
return [2 /*return*/, '']; // Return an empty string or handle it as needed
|
|
504
504
|
case 3: return [2 /*return*/];
|
|
505
505
|
}
|
|
@@ -531,7 +531,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
531
531
|
return [2 /*return*/, value];
|
|
532
532
|
case 2:
|
|
533
533
|
error_2 = _a.sent();
|
|
534
|
-
(0, logs_core_1.logError)("
|
|
534
|
+
(0, logs_core_1.logError)("\u274C Unable to read the value from '".concat(control.controlDescription, "' due to reason: ").concat(error_2));
|
|
535
535
|
return [2 /*return*/, '']; // Return an empty string or handle it as needed
|
|
536
536
|
case 3: return [2 /*return*/];
|
|
537
537
|
}
|
|
@@ -563,7 +563,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
563
563
|
return [2 /*return*/, value];
|
|
564
564
|
case 2:
|
|
565
565
|
error_3 = _a.sent();
|
|
566
|
-
(0, logs_core_1.logError)("
|
|
566
|
+
(0, logs_core_1.logError)("\u274C Unable to read the value from '".concat(control.controlDescription, "' due to reason: ").concat(error_3));
|
|
567
567
|
return [2 /*return*/, '']; // Return an empty string or handle it as needed
|
|
568
568
|
case 3: return [2 /*return*/];
|
|
569
569
|
}
|
|
@@ -596,7 +596,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
596
596
|
return [2 /*return*/, value];
|
|
597
597
|
case 2:
|
|
598
598
|
error_4 = _a.sent();
|
|
599
|
-
(0, logs_core_1.logError)("
|
|
599
|
+
(0, logs_core_1.logError)("\u274C Unable to read attribute value from '".concat(control.controlDescription, "' - Reason: ").concat(error_4));
|
|
600
600
|
return [2 /*return*/, null];
|
|
601
601
|
case 3: return [2 /*return*/];
|
|
602
602
|
}
|
|
@@ -667,7 +667,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
667
667
|
(0, logs_core_1.logAction)('Alert is accepted');
|
|
668
668
|
return true;
|
|
669
669
|
}, function (error) {
|
|
670
|
-
(0, logs_core_1.logError)("
|
|
670
|
+
(0, logs_core_1.logError)("\u274C Unable to accept alert: ".concat(error));
|
|
671
671
|
throw error;
|
|
672
672
|
})];
|
|
673
673
|
case 1:
|
|
@@ -677,7 +677,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
677
677
|
(0, logs_core_1.logAction)('Alert is dismissed');
|
|
678
678
|
return false;
|
|
679
679
|
}, function (error) {
|
|
680
|
-
(0, logs_core_1.logError)("
|
|
680
|
+
(0, logs_core_1.logError)("\u274C Unable to dismiss alert: ".concat(error));
|
|
681
681
|
throw error;
|
|
682
682
|
})];
|
|
683
683
|
case 3:
|
|
@@ -704,7 +704,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
704
704
|
return __generator(this, function (_a) {
|
|
705
705
|
this.page.on('dialog', function (dialog) { return __awaiter(_this, void 0, void 0, function () {
|
|
706
706
|
return __generator(this, function (_a) {
|
|
707
|
-
(0, logs_core_1.logConsole)(
|
|
707
|
+
(0, logs_core_1.logConsole)("Alert is Displayed with text: ".concat(dialog.message()));
|
|
708
708
|
return [2 /*return*/];
|
|
709
709
|
});
|
|
710
710
|
}); });
|
|
@@ -816,7 +816,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
816
816
|
Actions.prototype.waitTillPageURLContains = function (url_1) {
|
|
817
817
|
return __awaiter(this, arguments, void 0, function (url, timeoutInSeconds) {
|
|
818
818
|
var error_5;
|
|
819
|
-
if (timeoutInSeconds === void 0) { timeoutInSeconds =
|
|
819
|
+
if (timeoutInSeconds === void 0) { timeoutInSeconds = 60; }
|
|
820
820
|
return __generator(this, function (_a) {
|
|
821
821
|
switch (_a.label) {
|
|
822
822
|
case 0:
|
|
@@ -848,7 +848,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
848
848
|
Actions.prototype.waitTillElementIsPresent = function (control_1) {
|
|
849
849
|
return __awaiter(this, arguments, void 0, function (control, timeoutInSeconds) {
|
|
850
850
|
var error_6;
|
|
851
|
-
if (timeoutInSeconds === void 0) { timeoutInSeconds =
|
|
851
|
+
if (timeoutInSeconds === void 0) { timeoutInSeconds = 60; }
|
|
852
852
|
return __generator(this, function (_a) {
|
|
853
853
|
switch (_a.label) {
|
|
854
854
|
case 0: return [4 /*yield*/, this.page.waitForLoadState("domcontentloaded")];
|
|
@@ -886,7 +886,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
886
886
|
Actions.prototype.waitTillElementIsAttached = function (control_1) {
|
|
887
887
|
return __awaiter(this, arguments, void 0, function (control, timeoutInSeconds) {
|
|
888
888
|
var error_7;
|
|
889
|
-
if (timeoutInSeconds === void 0) { timeoutInSeconds =
|
|
889
|
+
if (timeoutInSeconds === void 0) { timeoutInSeconds = 60; }
|
|
890
890
|
return __generator(this, function (_a) {
|
|
891
891
|
switch (_a.label) {
|
|
892
892
|
case 0: return [4 /*yield*/, this.page.waitForLoadState("domcontentloaded")];
|
|
@@ -924,7 +924,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
924
924
|
Actions.prototype.waitTillElementIsNotPresent = function (control_1) {
|
|
925
925
|
return __awaiter(this, arguments, void 0, function (control, timeoutInSeconds) {
|
|
926
926
|
var error_8;
|
|
927
|
-
if (timeoutInSeconds === void 0) { timeoutInSeconds =
|
|
927
|
+
if (timeoutInSeconds === void 0) { timeoutInSeconds = 60; }
|
|
928
928
|
return __generator(this, function (_a) {
|
|
929
929
|
switch (_a.label) {
|
|
930
930
|
case 0:
|
|
@@ -18,6 +18,7 @@ export declare class Assertion extends Actions {
|
|
|
18
18
|
* verifyIsEquals("Invalid username", "Invalid username");
|
|
19
19
|
*/
|
|
20
20
|
verifyIsEquals(object1: any, object2: any, controlDescription?: string): void;
|
|
21
|
+
verifyIsEqualIgnorecase(object1: any, object2: any, controlDescription?: string, caseInsensitive?: boolean): void;
|
|
21
22
|
/**
|
|
22
23
|
* Verify first value contains substring as second.
|
|
23
24
|
* If expected value is present in actual value then test case gets passed else failed..
|
|
@@ -86,6 +86,31 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
86
86
|
throw error1;
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
|
+
Assertion.prototype.verifyIsEqualIgnorecase = function (object1, object2, controlDescription, caseInsensitive) {
|
|
90
|
+
if (controlDescription === void 0) { controlDescription = ""; }
|
|
91
|
+
if (caseInsensitive === void 0) { caseInsensitive = false; }
|
|
92
|
+
try {
|
|
93
|
+
var expected = object1;
|
|
94
|
+
var actual = object2;
|
|
95
|
+
if (caseInsensitive && typeof object1 === 'string' && typeof object2 === 'string') {
|
|
96
|
+
expected = object1.toLowerCase();
|
|
97
|
+
actual = object2.toLowerCase();
|
|
98
|
+
}
|
|
99
|
+
var verificationResult = expected === actual ? "✅ PASSED" : "❌ FAILED";
|
|
100
|
+
(0, logs_core_1.logVerification)("VERIFICATION: ".concat(verificationResult, ". ").concat(controlDescription, " Expected: '").concat(object1, "' Actual: '").concat(object2, "'"));
|
|
101
|
+
// Perform assertion based on case sensitivity
|
|
102
|
+
if (caseInsensitive && typeof object1 === 'string' && typeof object2 === 'string') {
|
|
103
|
+
test_1.expect.soft(object1.toLowerCase()).toEqual(object2.toLowerCase());
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
test_1.expect.soft(object1).toEqual(object2);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
catch (error1) {
|
|
110
|
+
(0, logs_core_1.logError)("VERIFICATION: '❌ FAILED'. Expected: '" + object1 + "' Actual: '" + object2 + "'");
|
|
111
|
+
throw error1;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
89
114
|
/**
|
|
90
115
|
* Verify first value contains substring as second.
|
|
91
116
|
* If expected value is present in actual value then test case gets passed else failed..
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "playwright-ts-automationframework",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.57",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@playwright/test": "^1.52.0",
|
|
23
|
-
"@types/node": "^22.15.
|
|
23
|
+
"@types/node": "^22.15.19",
|
|
24
24
|
"log4js": "^6.9.1",
|
|
25
25
|
"nodemailer": "^7.0.3",
|
|
26
26
|
"npm": "^11.4.0",
|