playwright-ts-automationframework 1.1.51 → 1.1.53
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.
|
@@ -95,8 +95,8 @@ export declare class Actions extends BasePage {
|
|
|
95
95
|
*
|
|
96
96
|
* selectDropDownByText(cityDrpdwn, "Sydney");
|
|
97
97
|
*/
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
selectFromDropdownByText(control: WebControl, optionTobeSelcted: string): Promise<void>;
|
|
99
|
+
selectFromDropdownByPartialText(control: WebControl, partialText: string): Promise<void>;
|
|
100
100
|
/**
|
|
101
101
|
* Select dropdown element by index.
|
|
102
102
|
*
|
package/lib/core/actions.core.js
CHANGED
|
@@ -271,7 +271,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
271
271
|
*
|
|
272
272
|
* selectDropDownByText(cityDrpdwn, "Sydney");
|
|
273
273
|
*/
|
|
274
|
-
Actions.prototype.
|
|
274
|
+
Actions.prototype.selectFromDropdownByText = function (control, optionTobeSelcted) {
|
|
275
275
|
return __awaiter(this, void 0, void 0, function () {
|
|
276
276
|
return __generator(this, function (_a) {
|
|
277
277
|
switch (_a.label) {
|
|
@@ -289,7 +289,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
289
289
|
});
|
|
290
290
|
});
|
|
291
291
|
};
|
|
292
|
-
Actions.prototype.
|
|
292
|
+
Actions.prototype.selectFromDropdownByPartialText = function (control, partialText) {
|
|
293
293
|
return __awaiter(this, void 0, void 0, function () {
|
|
294
294
|
var options, matchingOption;
|
|
295
295
|
return __generator(this, function (_a) {
|
|
@@ -217,6 +217,7 @@ export declare class Assertion extends Actions {
|
|
|
217
217
|
verifyTagName(control: WebControl, expectedTagName: string): Promise<void>;
|
|
218
218
|
verifyListContainsValue(control: WebControl, valueToVerify: string): Promise<void>;
|
|
219
219
|
verifyListContainsMultipleValues(control: WebControl, listOfValueToVerify: string[], waitTillElementIsDisplayed?: boolean): Promise<void>;
|
|
220
|
+
verifyDropdownOptions(control: WebControl, listOfValueToVerify: string[], waitTillElementIsDisplayed?: boolean): Promise<void>;
|
|
220
221
|
verifyListForMultipleValues(control: WebControl, listOfValueToVerify: string[], waitTillElementIsDisplayed?: boolean): Promise<void>;
|
|
221
222
|
/**
|
|
222
223
|
* Verify Alert text is equal to expected value
|
|
@@ -175,16 +175,11 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
175
175
|
return [4 /*yield*/, control.controlLocator.isHidden().then(function (value) { return __awaiter(_this, void 0, void 0, function () {
|
|
176
176
|
var verificationResult, logText;
|
|
177
177
|
return __generator(this, function (_a) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
return [4 /*yield*/, (0, test_1.expect)(element, logText).toBeHidden()];
|
|
184
|
-
case 1:
|
|
185
|
-
_a.sent();
|
|
186
|
-
return [2 /*return*/];
|
|
187
|
-
}
|
|
178
|
+
verificationResult = value === true ? "PASSED" : "FAILED";
|
|
179
|
+
logText = "VERIFICATION: ".concat(verificationResult, ". '").concat(control.controlDescription, "' hidden status is '").concat(value, "' Expected: true");
|
|
180
|
+
(0, logs_core_1.logVerification)(logText);
|
|
181
|
+
(0, test_1.expect)(value, logText).toBe(true);
|
|
182
|
+
return [2 /*return*/];
|
|
188
183
|
});
|
|
189
184
|
}); })];
|
|
190
185
|
case 1:
|
|
@@ -718,6 +713,68 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
718
713
|
});
|
|
719
714
|
});
|
|
720
715
|
};
|
|
716
|
+
Assertion.prototype.verifyDropdownOptions = function (control_1, listOfValueToVerify_1) {
|
|
717
|
+
return __awaiter(this, arguments, void 0, function (control, listOfValueToVerify, waitTillElementIsDisplayed) {
|
|
718
|
+
var options, listOfOptions, _i, options_1, option, value;
|
|
719
|
+
var _this = this;
|
|
720
|
+
if (waitTillElementIsDisplayed === void 0) { waitTillElementIsDisplayed = true; }
|
|
721
|
+
return __generator(this, function (_a) {
|
|
722
|
+
switch (_a.label) {
|
|
723
|
+
case 0: return [4 /*yield*/, control.controlLocator.locator('option').all()];
|
|
724
|
+
case 1:
|
|
725
|
+
options = _a.sent();
|
|
726
|
+
listOfOptions = [];
|
|
727
|
+
_i = 0, options_1 = options;
|
|
728
|
+
_a.label = 2;
|
|
729
|
+
case 2:
|
|
730
|
+
if (!(_i < options_1.length)) return [3 /*break*/, 5];
|
|
731
|
+
option = options_1[_i];
|
|
732
|
+
return [4 /*yield*/, option.innerText()];
|
|
733
|
+
case 3:
|
|
734
|
+
value = _a.sent();
|
|
735
|
+
if (value) {
|
|
736
|
+
listOfOptions.push(value);
|
|
737
|
+
}
|
|
738
|
+
_a.label = 4;
|
|
739
|
+
case 4:
|
|
740
|
+
_i++;
|
|
741
|
+
return [3 /*break*/, 2];
|
|
742
|
+
case 5:
|
|
743
|
+
listOfValueToVerify.forEach(function (expectedValue) { return __awaiter(_this, void 0, void 0, function () {
|
|
744
|
+
var listOfElements, count, verificationResult;
|
|
745
|
+
return __generator(this, function (_a) {
|
|
746
|
+
switch (_a.label) {
|
|
747
|
+
case 0: return [4 /*yield*/, control.controlLocator.all()];
|
|
748
|
+
case 1:
|
|
749
|
+
listOfElements = _a.sent();
|
|
750
|
+
count = listOfElements.filter(function (element) {
|
|
751
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
752
|
+
return __generator(this, function (_a) {
|
|
753
|
+
switch (_a.label) {
|
|
754
|
+
case 0: return [4 /*yield*/, element.innerText().then(function (text) {
|
|
755
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
756
|
+
return __generator(this, function (_a) {
|
|
757
|
+
return [2 /*return*/, text.trim().includes(expectedValue)];
|
|
758
|
+
});
|
|
759
|
+
});
|
|
760
|
+
})];
|
|
761
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
762
|
+
}
|
|
763
|
+
});
|
|
764
|
+
});
|
|
765
|
+
}).length;
|
|
766
|
+
verificationResult = count >= 1 ? "PASSED" : "FAILED";
|
|
767
|
+
(0, logs_core_1.logVerification)("VERIFICATION: ".concat(verificationResult, ". '").concat(expectedValue, "' is Present in list '").concat(control.controlDescription, "'"));
|
|
768
|
+
(0, test_1.expect)(count).toBeGreaterThanOrEqual(1);
|
|
769
|
+
return [2 /*return*/];
|
|
770
|
+
}
|
|
771
|
+
});
|
|
772
|
+
}); });
|
|
773
|
+
return [2 /*return*/];
|
|
774
|
+
}
|
|
775
|
+
});
|
|
776
|
+
});
|
|
777
|
+
};
|
|
721
778
|
Assertion.prototype.verifyListForMultipleValues = function (control_1, listOfValueToVerify_1) {
|
|
722
779
|
return __awaiter(this, arguments, void 0, function (control, listOfValueToVerify, waitTillElementIsDisplayed) {
|
|
723
780
|
var list, _loop_1, i;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "playwright-ts-automationframework",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.53",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"ignore-case": "^0.1.0"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@playwright/test": "^1.
|
|
23
|
-
"@types/node": "^22.
|
|
22
|
+
"@playwright/test": "^1.52.0",
|
|
23
|
+
"@types/node": "^22.15.17",
|
|
24
24
|
"log4js": "^6.9.1",
|
|
25
|
-
"nodemailer": "^
|
|
26
|
-
"npm": "^11.
|
|
25
|
+
"nodemailer": "^7.0.3",
|
|
26
|
+
"npm": "^11.3.0",
|
|
27
27
|
"path": "^0.12.7",
|
|
28
|
-
"typescript": "^5.8.
|
|
28
|
+
"typescript": "^5.8.3"
|
|
29
29
|
},
|
|
30
30
|
"files": [
|
|
31
31
|
"lib/**/**"
|