playwright-ts-automationframework 1.1.47 → 1.1.49
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.
|
@@ -333,6 +333,8 @@ export declare class Actions extends BasePage {
|
|
|
333
333
|
*/
|
|
334
334
|
sleep(timeInSeconds?: number): Promise<void>;
|
|
335
335
|
waitForPageTimeout(timeoutInSeconds?: number): Promise<void>;
|
|
336
|
+
waitForPageLoad(): Promise<void>;
|
|
337
|
+
waitForPageDOMcontentLoaded(): Promise<void>;
|
|
336
338
|
waitForNetworkIdle(): Promise<void>;
|
|
337
339
|
refreshWebPage(): Promise<void>;
|
|
338
340
|
/**
|
package/lib/core/actions.core.js
CHANGED
|
@@ -570,7 +570,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
570
570
|
case 2:
|
|
571
571
|
error_4 = _a.sent();
|
|
572
572
|
(0, logs_core_1.logError)("Unable to read attribute value from '".concat(control.controlDescription, "' - Reason: ").concat(error_4));
|
|
573
|
-
return [2 /*return*/, null];
|
|
573
|
+
return [2 /*return*/, null];
|
|
574
574
|
case 3: return [2 /*return*/];
|
|
575
575
|
}
|
|
576
576
|
});
|
|
@@ -920,6 +920,30 @@ var Actions = /** @class */ (function (_super) {
|
|
|
920
920
|
});
|
|
921
921
|
});
|
|
922
922
|
};
|
|
923
|
+
Actions.prototype.waitForPageLoad = function () {
|
|
924
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
925
|
+
return __generator(this, function (_a) {
|
|
926
|
+
switch (_a.label) {
|
|
927
|
+
case 0: return [4 /*yield*/, this.page.waitForLoadState("load")];
|
|
928
|
+
case 1:
|
|
929
|
+
_a.sent();
|
|
930
|
+
return [2 /*return*/];
|
|
931
|
+
}
|
|
932
|
+
});
|
|
933
|
+
});
|
|
934
|
+
};
|
|
935
|
+
Actions.prototype.waitForPageDOMcontentLoaded = function () {
|
|
936
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
937
|
+
return __generator(this, function (_a) {
|
|
938
|
+
switch (_a.label) {
|
|
939
|
+
case 0: return [4 /*yield*/, this.page.waitForLoadState("domcontentloaded")];
|
|
940
|
+
case 1:
|
|
941
|
+
_a.sent();
|
|
942
|
+
return [2 /*return*/];
|
|
943
|
+
}
|
|
944
|
+
});
|
|
945
|
+
});
|
|
946
|
+
};
|
|
923
947
|
Actions.prototype.waitForNetworkIdle = function () {
|
|
924
948
|
return __awaiter(this, void 0, void 0, function () {
|
|
925
949
|
return __generator(this, function (_a) {
|
|
@@ -160,6 +160,7 @@ export declare class Assertion extends Actions {
|
|
|
160
160
|
* verifyTextboxValue(usernameTxtbx, "Test@Adactin");
|
|
161
161
|
*/
|
|
162
162
|
verifyTextboxValue(control: WebControl, expectedText: string): Promise<void>;
|
|
163
|
+
verifyTextboxValueContains(control: WebControl, expectedText: string): Promise<void>;
|
|
163
164
|
/**
|
|
164
165
|
* Verify element's inner text is equal to expected value
|
|
165
166
|
* If expected element's inner value to be expected value then test case gets passed else failed..
|
|
@@ -173,6 +174,7 @@ export declare class Assertion extends Actions {
|
|
|
173
174
|
* verifyTextboxValue(usernameTxtbx, "Test@Adactin");
|
|
174
175
|
*/
|
|
175
176
|
verifyInnerText(control: WebControl, expectedText: string): Promise<void>;
|
|
177
|
+
verifyInnerTextContains(control: WebControl, expectedText: string): Promise<void>;
|
|
176
178
|
/**
|
|
177
179
|
* Verify element's input text is equal to expected value
|
|
178
180
|
* If expected element's inner value to be expected value then test case gets passed else failed..
|
|
@@ -186,6 +188,7 @@ export declare class Assertion extends Actions {
|
|
|
186
188
|
* verifyTextboxValue(usernameTxtbx, "Test@Adactin");
|
|
187
189
|
*/
|
|
188
190
|
verifyInputValue(control: WebControl, expectedText: string): Promise<void>;
|
|
191
|
+
verifyInputValueContains(control: WebControl, expectedText: string): Promise<void>;
|
|
189
192
|
/**
|
|
190
193
|
* Verify element's checkbox/radio value is equal to expected value
|
|
191
194
|
* If expected element's checkbox/radio value to be expected value then test case gets passed else failed..
|
|
@@ -466,6 +466,23 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
466
466
|
});
|
|
467
467
|
});
|
|
468
468
|
};
|
|
469
|
+
Assertion.prototype.verifyTextboxValueContains = function (control, expectedText) {
|
|
470
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
471
|
+
return __generator(this, function (_a) {
|
|
472
|
+
switch (_a.label) {
|
|
473
|
+
case 0: return [4 /*yield*/, control.controlLocator.first().getAttribute("value").then(function (value) {
|
|
474
|
+
var verificationResult = (value === null || value === void 0 ? void 0 : value.trim().includes(expectedText)) ? "PASSED" : "FAILED";
|
|
475
|
+
var logText = "VERIFICATION: ".concat(verificationResult, " Verify textbox value of ").concat(control.controlDescription, ". Expected: '").concat(expectedText, "' Actual: '").concat(value, "'");
|
|
476
|
+
(0, logs_core_1.logVerification)(logText);
|
|
477
|
+
(0, test_1.expect)(value, logText).toContain(expectedText);
|
|
478
|
+
})];
|
|
479
|
+
case 1:
|
|
480
|
+
_a.sent();
|
|
481
|
+
return [2 /*return*/];
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
});
|
|
485
|
+
};
|
|
469
486
|
/**
|
|
470
487
|
* Verify element's inner text is equal to expected value
|
|
471
488
|
* If expected element's inner value to be expected value then test case gets passed else failed..
|
|
@@ -495,6 +512,23 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
495
512
|
});
|
|
496
513
|
});
|
|
497
514
|
};
|
|
515
|
+
Assertion.prototype.verifyInnerTextContains = function (control, expectedText) {
|
|
516
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
517
|
+
return __generator(this, function (_a) {
|
|
518
|
+
switch (_a.label) {
|
|
519
|
+
case 0: return [4 /*yield*/, control.controlLocator.first().innerText().then(function (value) {
|
|
520
|
+
var verificationResult = value.trim().includes(expectedText) ? "PASSED" : "FAILED";
|
|
521
|
+
var logText = "VERIFICATION: ".concat(verificationResult, " Verify value of ").concat(control.controlDescription, ". Expected: '").concat(expectedText, "' Actual: '").concat(value, "'");
|
|
522
|
+
(0, logs_core_1.logVerification)(logText);
|
|
523
|
+
(0, test_1.expect)(value, logText).toContain(expectedText);
|
|
524
|
+
})];
|
|
525
|
+
case 1:
|
|
526
|
+
_a.sent();
|
|
527
|
+
return [2 /*return*/];
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
});
|
|
531
|
+
};
|
|
498
532
|
/**
|
|
499
533
|
* Verify element's input text is equal to expected value
|
|
500
534
|
* If expected element's inner value to be expected value then test case gets passed else failed..
|
|
@@ -524,6 +558,23 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
524
558
|
});
|
|
525
559
|
});
|
|
526
560
|
};
|
|
561
|
+
Assertion.prototype.verifyInputValueContains = function (control, expectedText) {
|
|
562
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
563
|
+
return __generator(this, function (_a) {
|
|
564
|
+
switch (_a.label) {
|
|
565
|
+
case 0: return [4 /*yield*/, control.controlLocator.first().inputValue().then(function (value) {
|
|
566
|
+
var verificationResult = value.trim().includes(expectedText) ? "PASSED" : "FAILED";
|
|
567
|
+
var logText = "VERIFICATION: ".concat(verificationResult, " Verify value of ").concat(control.controlDescription, ". Expected: '").concat(expectedText, "' Actual: '").concat(value, "'");
|
|
568
|
+
(0, logs_core_1.logVerification)(logText);
|
|
569
|
+
(0, test_1.expect)(value, logText).toContain(expectedText);
|
|
570
|
+
})];
|
|
571
|
+
case 1:
|
|
572
|
+
_a.sent();
|
|
573
|
+
return [2 /*return*/];
|
|
574
|
+
}
|
|
575
|
+
});
|
|
576
|
+
});
|
|
577
|
+
};
|
|
527
578
|
/**
|
|
528
579
|
* Verify element's checkbox/radio value is equal to expected value
|
|
529
580
|
* If expected element's checkbox/radio value to be expected value then test case gets passed else failed..
|