playwright-ts-automationframework 1.1.37 → 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.
- package/lib/core/assertion.core.d.ts +39 -13
- package/lib/core/assertion.core.js +73 -15
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@ export declare class Assertion extends Actions {
|
|
|
20
20
|
verifyIsEquals(object1: any, object2: any, controlDescription?: string): void;
|
|
21
21
|
/**
|
|
22
22
|
* Verify first value contains substring as second.
|
|
23
|
-
* If expected value is present in actual value then test case gets
|
|
23
|
+
* If expected value is present in actual value then test case gets passed else failed..
|
|
24
24
|
*
|
|
25
25
|
* @param expected First object which has .
|
|
26
26
|
* @param actual Second object.
|
|
@@ -72,7 +72,7 @@ export declare class Assertion extends Actions {
|
|
|
72
72
|
verifyAttributeValue(control: WebControl, attributeName: string, expectedAttributeValue: string): Promise<void>;
|
|
73
73
|
/**
|
|
74
74
|
* Verify element's attribute value contains expected value
|
|
75
|
-
* If element's attribute value contains expected value then test case gets
|
|
75
|
+
* If element's attribute value contains expected value then test case gets passed else failed..
|
|
76
76
|
*
|
|
77
77
|
* @param control Control of which attribute value need to verify.
|
|
78
78
|
* @param attributeName Attribute name
|
|
@@ -87,7 +87,7 @@ export declare class Assertion extends Actions {
|
|
|
87
87
|
verifyAttributeValueContains(control: WebControl, attributeName: string, attributeValue: string): Promise<void>;
|
|
88
88
|
/**
|
|
89
89
|
* Verify element's enabled/disabled status as per expected value
|
|
90
|
-
* If expected element's enabled status is as per expected then test case gets
|
|
90
|
+
* If expected element's enabled status is as per expected then test case gets passed else failed..
|
|
91
91
|
*
|
|
92
92
|
* @param control Control of which enable or disable status.
|
|
93
93
|
* @param expValue Expected value enabled as true or disabled as false.
|
|
@@ -110,7 +110,7 @@ export declare class Assertion extends Actions {
|
|
|
110
110
|
verifyIsSelected(control: WebControl, expValue?: boolean): Promise<void>;
|
|
111
111
|
/**
|
|
112
112
|
* Verify element's text as per expected value
|
|
113
|
-
* If expected element's text is as per expected value then test case gets
|
|
113
|
+
* If expected element's text is as per expected value then test case gets passed else failed..
|
|
114
114
|
*
|
|
115
115
|
* @param control Control of which text need to verify.
|
|
116
116
|
* @param expectedText Expected value.
|
|
@@ -123,7 +123,7 @@ export declare class Assertion extends Actions {
|
|
|
123
123
|
verifyDisplayedText(control: WebControl, expectedText: string): Promise<void>;
|
|
124
124
|
/**
|
|
125
125
|
* Verify element's text contains partial expected value
|
|
126
|
-
* If expected element's text contains expected value then test case gets
|
|
126
|
+
* If expected element's text contains expected value then test case gets passed else failed..
|
|
127
127
|
*
|
|
128
128
|
* @param control Control of which text need to verify.
|
|
129
129
|
* @param expectedText Expected partial value.
|
|
@@ -136,7 +136,7 @@ export declare class Assertion extends Actions {
|
|
|
136
136
|
verifyDisplayedTextContains(control: WebControl, expectedText: string): Promise<void>;
|
|
137
137
|
/**
|
|
138
138
|
* Verify element's text does not contains expected value
|
|
139
|
-
* If expected element's text does not contains expected value then test case gets
|
|
139
|
+
* If expected element's text does not contains expected value then test case gets passed else failed..
|
|
140
140
|
*
|
|
141
141
|
* @param control Control of which text need to verify.
|
|
142
142
|
* @param expectedText Expected partial value.
|
|
@@ -149,7 +149,7 @@ export declare class Assertion extends Actions {
|
|
|
149
149
|
verifyDisplayedTextDoesNotContains(control: WebControl, expectedText: string): Promise<void>;
|
|
150
150
|
/**
|
|
151
151
|
* Verify element's textbox is equal to expected value
|
|
152
|
-
* If expected element's textbox value to be expected value then test case gets
|
|
152
|
+
* If expected element's textbox value to be expected value then test case gets passed else failed..
|
|
153
153
|
*
|
|
154
154
|
* @param control Textbox control.
|
|
155
155
|
* @param expectedText Expected value.
|
|
@@ -161,8 +161,34 @@ export declare class Assertion extends Actions {
|
|
|
161
161
|
*/
|
|
162
162
|
verifyTextboxValue(control: WebControl, expectedText: string): Promise<void>;
|
|
163
163
|
/**
|
|
164
|
+
* Verify element's inner text is equal to expected value
|
|
165
|
+
* If expected element's inner value to be expected value then test case gets passed else failed..
|
|
166
|
+
*
|
|
167
|
+
* @param control Textbox control.
|
|
168
|
+
* @param expectedText Expected value.
|
|
169
|
+
* Example:
|
|
170
|
+
*
|
|
171
|
+
* usernameTxtbx = new WebControl(this.page.locator('#username'), 'Username textbox');
|
|
172
|
+
*
|
|
173
|
+
* verifyTextboxValue(usernameTxtbx, "Test@Adactin");
|
|
174
|
+
*/
|
|
175
|
+
verifyInnerText(control: WebControl, expectedText: string): Promise<void>;
|
|
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
|
+
/**
|
|
164
190
|
* Verify element's checkbox/radio value is equal to expected value
|
|
165
|
-
* If expected element's checkbox/radio value to be expected value then test case gets
|
|
191
|
+
* If expected element's checkbox/radio value to be expected value then test case gets passed else failed..
|
|
166
192
|
*
|
|
167
193
|
* @param control Checkbox/radio control.
|
|
168
194
|
* @param expectedText Expected checkbox/radio value.
|
|
@@ -175,7 +201,7 @@ export declare class Assertion extends Actions {
|
|
|
175
201
|
verifyCheckboxValue(control: WebControl, value: boolean): Promise<void>;
|
|
176
202
|
/**
|
|
177
203
|
* Verify element's tagname is equal to expected value
|
|
178
|
-
* If expected element's Tagname is equal to expected value then test case gets
|
|
204
|
+
* If expected element's Tagname is equal to expected value then test case gets passed else failed..
|
|
179
205
|
*
|
|
180
206
|
* @param control Checkbox/radio control.
|
|
181
207
|
* @param expectedText Expected checkbox/radio value.
|
|
@@ -191,7 +217,7 @@ export declare class Assertion extends Actions {
|
|
|
191
217
|
verifyListForMultipleValues(control: WebControl, listOfValueToVerify: string[], waitTillElementIsDisplayed?: boolean): Promise<void>;
|
|
192
218
|
/**
|
|
193
219
|
* Verify Alert text is equal to expected value
|
|
194
|
-
* If alert text is equal to expected value then test case gets
|
|
220
|
+
* If alert text is equal to expected value then test case gets passed else failed..
|
|
195
221
|
*
|
|
196
222
|
* @param expectedText Expected alert text.
|
|
197
223
|
* Example:
|
|
@@ -201,7 +227,7 @@ export declare class Assertion extends Actions {
|
|
|
201
227
|
verifyAlertText(expectedText: string): Promise<void>;
|
|
202
228
|
/**
|
|
203
229
|
* Verify URL contains expected value
|
|
204
|
-
* If URL contains expected value then test case gets
|
|
230
|
+
* If URL contains expected value then test case gets passed else failed..
|
|
205
231
|
*
|
|
206
232
|
* @param expectedText Expected partial URL.
|
|
207
233
|
* Example:
|
|
@@ -211,7 +237,7 @@ export declare class Assertion extends Actions {
|
|
|
211
237
|
verifyURLContains(subString: string): Promise<void>;
|
|
212
238
|
/**
|
|
213
239
|
* Verify count of elements which matched the control
|
|
214
|
-
* If count of elements is equal to expected value then test case will get
|
|
240
|
+
* If count of elements is equal to expected value then test case will get passed else failed..
|
|
215
241
|
*
|
|
216
242
|
* @param control Control element.
|
|
217
243
|
* @param expectedCount Expected count of elements matching criteria
|
|
@@ -225,7 +251,7 @@ export declare class Assertion extends Actions {
|
|
|
225
251
|
verifyCountOfElementsIsLesseOrEqual(control: WebControl, expectedCount: number): Promise<void>;
|
|
226
252
|
/**
|
|
227
253
|
* Verify title of web page contains expected value
|
|
228
|
-
* If title contains expected value then test case will get
|
|
254
|
+
* If title contains expected value then test case will get passed else failed..
|
|
229
255
|
*
|
|
230
256
|
* @param expectedText Expected partial Title.
|
|
231
257
|
* Example:
|
|
@@ -88,7 +88,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
88
88
|
};
|
|
89
89
|
/**
|
|
90
90
|
* Verify first value contains substring as second.
|
|
91
|
-
* If expected value is present in actual value then test case gets
|
|
91
|
+
* If expected value is present in actual value then test case gets passed else failed..
|
|
92
92
|
*
|
|
93
93
|
* @param expected First object which has .
|
|
94
94
|
* @param actual Second object.
|
|
@@ -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);
|
|
@@ -236,7 +236,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
236
236
|
};
|
|
237
237
|
/**
|
|
238
238
|
* Verify element's attribute value contains expected value
|
|
239
|
-
* If element's attribute value contains expected value then test case gets
|
|
239
|
+
* If element's attribute value contains expected value then test case gets passed else failed..
|
|
240
240
|
*
|
|
241
241
|
* @param control Control of which attribute value need to verify.
|
|
242
242
|
* @param attributeName Attribute name
|
|
@@ -287,7 +287,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
287
287
|
};
|
|
288
288
|
/**
|
|
289
289
|
* Verify element's enabled/disabled status as per expected value
|
|
290
|
-
* If expected element's enabled status is as per expected then test case gets
|
|
290
|
+
* If expected element's enabled status is as per expected then test case gets passed else failed..
|
|
291
291
|
*
|
|
292
292
|
* @param control Control of which enable or disable status.
|
|
293
293
|
* @param expValue Expected value enabled as true or disabled as false.
|
|
@@ -356,7 +356,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
356
356
|
};
|
|
357
357
|
/**
|
|
358
358
|
* Verify element's text as per expected value
|
|
359
|
-
* If expected element's text is as per expected value then test case gets
|
|
359
|
+
* If expected element's text is as per expected value then test case gets passed else failed..
|
|
360
360
|
*
|
|
361
361
|
* @param control Control of which text need to verify.
|
|
362
362
|
* @param expectedText Expected value.
|
|
@@ -385,7 +385,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
385
385
|
};
|
|
386
386
|
/**
|
|
387
387
|
* Verify element's text contains partial expected value
|
|
388
|
-
* If expected element's text contains expected value then test case gets
|
|
388
|
+
* If expected element's text contains expected value then test case gets passed else failed..
|
|
389
389
|
*
|
|
390
390
|
* @param control Control of which text need to verify.
|
|
391
391
|
* @param expectedText Expected partial value.
|
|
@@ -414,7 +414,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
414
414
|
};
|
|
415
415
|
/**
|
|
416
416
|
* Verify element's text does not contains expected value
|
|
417
|
-
* If expected element's text does not contains expected value then test case gets
|
|
417
|
+
* If expected element's text does not contains expected value then test case gets passed else failed..
|
|
418
418
|
*
|
|
419
419
|
* @param control Control of which text need to verify.
|
|
420
420
|
* @param expectedText Expected partial value.
|
|
@@ -443,7 +443,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
443
443
|
};
|
|
444
444
|
/**
|
|
445
445
|
* Verify element's textbox is equal to expected value
|
|
446
|
-
* If expected element's textbox value to be expected value then test case gets
|
|
446
|
+
* If expected element's textbox value to be expected value then test case gets passed else failed..
|
|
447
447
|
*
|
|
448
448
|
* @param control Textbox control.
|
|
449
449
|
* @param expectedText Expected value.
|
|
@@ -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);
|
|
@@ -471,8 +471,66 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
471
471
|
});
|
|
472
472
|
};
|
|
473
473
|
/**
|
|
474
|
+
* Verify element's inner text is equal to expected value
|
|
475
|
+
* If expected element's inner value to be expected value then test case gets passed else failed..
|
|
476
|
+
*
|
|
477
|
+
* @param control Textbox control.
|
|
478
|
+
* @param expectedText Expected value.
|
|
479
|
+
* Example:
|
|
480
|
+
*
|
|
481
|
+
* usernameTxtbx = new WebControl(this.page.locator('#username'), 'Username textbox');
|
|
482
|
+
*
|
|
483
|
+
* verifyTextboxValue(usernameTxtbx, "Test@Adactin");
|
|
484
|
+
*/
|
|
485
|
+
Assertion.prototype.verifyInnerText = function (control, expectedText) {
|
|
486
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
487
|
+
return __generator(this, function (_a) {
|
|
488
|
+
switch (_a.label) {
|
|
489
|
+
case 0: return [4 /*yield*/, control.controlLocator.first().innerText().then(function (value) {
|
|
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";
|
|
520
|
+
var logText = "VERIFICATION: ".concat(verificationResult, " Verify value of ").concat(control.controlDescription, ". Expected: '").concat(expectedText, "' Actual: '").concat(value, "'");
|
|
521
|
+
(0, logs_core_1.logVerification)(logText);
|
|
522
|
+
(0, test_1.expect)(value, logText).toEqual(expectedText);
|
|
523
|
+
})];
|
|
524
|
+
case 1:
|
|
525
|
+
_a.sent();
|
|
526
|
+
return [2 /*return*/];
|
|
527
|
+
}
|
|
528
|
+
});
|
|
529
|
+
});
|
|
530
|
+
};
|
|
531
|
+
/**
|
|
474
532
|
* Verify element's checkbox/radio value is equal to expected value
|
|
475
|
-
* If expected element's checkbox/radio value to be expected value then test case gets
|
|
533
|
+
* If expected element's checkbox/radio value to be expected value then test case gets passed else failed..
|
|
476
534
|
*
|
|
477
535
|
* @param control Checkbox/radio control.
|
|
478
536
|
* @param expectedText Expected checkbox/radio value.
|
|
@@ -501,7 +559,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
501
559
|
};
|
|
502
560
|
/**
|
|
503
561
|
* Verify element's tagname is equal to expected value
|
|
504
|
-
* If expected element's Tagname is equal to expected value then test case gets
|
|
562
|
+
* If expected element's Tagname is equal to expected value then test case gets passed else failed..
|
|
505
563
|
*
|
|
506
564
|
* @param control Checkbox/radio control.
|
|
507
565
|
* @param expectedText Expected checkbox/radio value.
|
|
@@ -663,7 +721,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
663
721
|
};
|
|
664
722
|
/**
|
|
665
723
|
* Verify Alert text is equal to expected value
|
|
666
|
-
* If alert text is equal to expected value then test case gets
|
|
724
|
+
* If alert text is equal to expected value then test case gets passed else failed..
|
|
667
725
|
*
|
|
668
726
|
* @param expectedText Expected alert text.
|
|
669
727
|
* Example:
|
|
@@ -690,7 +748,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
690
748
|
};
|
|
691
749
|
/**
|
|
692
750
|
* Verify URL contains expected value
|
|
693
|
-
* If URL contains expected value then test case gets
|
|
751
|
+
* If URL contains expected value then test case gets passed else failed..
|
|
694
752
|
*
|
|
695
753
|
* @param expectedText Expected partial URL.
|
|
696
754
|
* Example:
|
|
@@ -716,7 +774,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
716
774
|
};
|
|
717
775
|
/**
|
|
718
776
|
* Verify count of elements which matched the control
|
|
719
|
-
* If count of elements is equal to expected value then test case will get
|
|
777
|
+
* If count of elements is equal to expected value then test case will get passed else failed..
|
|
720
778
|
*
|
|
721
779
|
* @param control Control element.
|
|
722
780
|
* @param expectedCount Expected count of elements matching criteria
|
|
@@ -778,7 +836,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
778
836
|
};
|
|
779
837
|
/**
|
|
780
838
|
* Verify title of web page contains expected value
|
|
781
|
-
* If title contains expected value then test case will get
|
|
839
|
+
* If title contains expected value then test case will get passed else failed..
|
|
782
840
|
*
|
|
783
841
|
* @param expectedText Expected partial Title.
|
|
784
842
|
* Example:
|