playwright-ts-automationframework 1.1.38 → 1.1.39
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.
|
@@ -174,6 +174,19 @@ export declare class Assertion extends Actions {
|
|
|
174
174
|
*/
|
|
175
175
|
verifyInnerText(control: WebControl, expectedText: string): Promise<void>;
|
|
176
176
|
/**
|
|
177
|
+
* Verify element's input text is equal to expected value
|
|
178
|
+
* If expected element's inner value to be expected value then test case gets passed else failed..
|
|
179
|
+
*
|
|
180
|
+
* @param control Textbox control.
|
|
181
|
+
* @param expectedText Expected value.
|
|
182
|
+
* Example:
|
|
183
|
+
*
|
|
184
|
+
* usernameTxtbx = new WebControl(this.page.locator('#username'), 'Username textbox');
|
|
185
|
+
*
|
|
186
|
+
* verifyTextboxValue(usernameTxtbx, "Test@Adactin");
|
|
187
|
+
*/
|
|
188
|
+
verifyInputValue(control: WebControl, expectedText: string): Promise<void>;
|
|
189
|
+
/**
|
|
177
190
|
* Verify element's checkbox/radio value is equal to expected value
|
|
178
191
|
* If expected element's checkbox/radio value to be expected value then test case gets passed else failed..
|
|
179
192
|
*
|
|
@@ -220,7 +220,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
220
220
|
case 0: return [4 /*yield*/, this.getAttributeValue(control, attributeName).then(function (value) { return __awaiter(_this, void 0, void 0, function () {
|
|
221
221
|
var verificationResult, logText;
|
|
222
222
|
return __generator(this, function (_a) {
|
|
223
|
-
verificationResult = value === expectedAttributeValue ? "PASSED" : "FAILED";
|
|
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
226
|
(0, test_1.expect)(value, logText).toBe(expectedAttributeValue);
|
|
@@ -458,7 +458,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
458
458
|
return __generator(this, function (_a) {
|
|
459
459
|
switch (_a.label) {
|
|
460
460
|
case 0: return [4 /*yield*/, control.controlLocator.first().getAttribute("value").then(function (value) {
|
|
461
|
-
var verificationResult = value === expectedText ? "PASSED" : "FAILED";
|
|
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
464
|
(0, test_1.expect)(value, logText).toEqual(expectedText);
|
|
@@ -487,7 +487,36 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
487
487
|
return __generator(this, function (_a) {
|
|
488
488
|
switch (_a.label) {
|
|
489
489
|
case 0: return [4 /*yield*/, control.controlLocator.first().innerText().then(function (value) {
|
|
490
|
-
var verificationResult = value === expectedText ? "PASSED" : "FAILED";
|
|
490
|
+
var verificationResult = value.trim() === expectedText ? "PASSED" : "FAILED";
|
|
491
|
+
var logText = "VERIFICATION: ".concat(verificationResult, " Verify value of ").concat(control.controlDescription, ". Expected: '").concat(expectedText, "' Actual: '").concat(value, "'");
|
|
492
|
+
(0, logs_core_1.logVerification)(logText);
|
|
493
|
+
(0, test_1.expect)(value, logText).toEqual(expectedText);
|
|
494
|
+
})];
|
|
495
|
+
case 1:
|
|
496
|
+
_a.sent();
|
|
497
|
+
return [2 /*return*/];
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
});
|
|
501
|
+
};
|
|
502
|
+
/**
|
|
503
|
+
* Verify element's input text is equal to expected value
|
|
504
|
+
* If expected element's inner value to be expected value then test case gets passed else failed..
|
|
505
|
+
*
|
|
506
|
+
* @param control Textbox control.
|
|
507
|
+
* @param expectedText Expected value.
|
|
508
|
+
* Example:
|
|
509
|
+
*
|
|
510
|
+
* usernameTxtbx = new WebControl(this.page.locator('#username'), 'Username textbox');
|
|
511
|
+
*
|
|
512
|
+
* verifyTextboxValue(usernameTxtbx, "Test@Adactin");
|
|
513
|
+
*/
|
|
514
|
+
Assertion.prototype.verifyInputValue = function (control, expectedText) {
|
|
515
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
516
|
+
return __generator(this, function (_a) {
|
|
517
|
+
switch (_a.label) {
|
|
518
|
+
case 0: return [4 /*yield*/, control.controlLocator.first().inputValue().then(function (value) {
|
|
519
|
+
var verificationResult = value.trim() === expectedText ? "PASSED" : "FAILED";
|
|
491
520
|
var logText = "VERIFICATION: ".concat(verificationResult, " Verify value of ").concat(control.controlDescription, ". Expected: '").concat(expectedText, "' Actual: '").concat(value, "'");
|
|
492
521
|
(0, logs_core_1.logVerification)(logText);
|
|
493
522
|
(0, test_1.expect)(value, logText).toEqual(expectedText);
|