playwright-ts-automationframework 1.1.36 → 1.1.38
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 +2 -2
- package/lib/core/assertion.core.d.ts +26 -13
- package/lib/core/assertion.core.js +46 -17
- package/package.json +1 -1
package/lib/core/actions.core.js
CHANGED
|
@@ -774,7 +774,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
774
774
|
_a.label = 2;
|
|
775
775
|
case 2:
|
|
776
776
|
_a.trys.push([2, 4, , 5]);
|
|
777
|
-
return [4 /*yield*/, control.controlLocator.waitFor({
|
|
777
|
+
return [4 /*yield*/, control.controlLocator.first().waitFor({
|
|
778
778
|
state: "visible",
|
|
779
779
|
timeout: timeoutInSeconds * 1000,
|
|
780
780
|
})];
|
|
@@ -812,7 +812,7 @@ var Actions = /** @class */ (function (_super) {
|
|
|
812
812
|
_a.label = 2;
|
|
813
813
|
case 2:
|
|
814
814
|
_a.trys.push([2, 4, , 5]);
|
|
815
|
-
return [4 /*yield*/, control.controlLocator.waitFor({
|
|
815
|
+
return [4 /*yield*/, control.controlLocator.first().waitFor({
|
|
816
816
|
state: "attached",
|
|
817
817
|
timeout: timeoutInSeconds * 1000,
|
|
818
818
|
})];
|
|
@@ -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,21 @@ 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
|
+
/**
|
|
164
177
|
* 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
|
|
178
|
+
* If expected element's checkbox/radio value to be expected value then test case gets passed else failed..
|
|
166
179
|
*
|
|
167
180
|
* @param control Checkbox/radio control.
|
|
168
181
|
* @param expectedText Expected checkbox/radio value.
|
|
@@ -175,7 +188,7 @@ export declare class Assertion extends Actions {
|
|
|
175
188
|
verifyCheckboxValue(control: WebControl, value: boolean): Promise<void>;
|
|
176
189
|
/**
|
|
177
190
|
* Verify element's tagname is equal to expected value
|
|
178
|
-
* If expected element's Tagname is equal to expected value then test case gets
|
|
191
|
+
* If expected element's Tagname is equal to expected value then test case gets passed else failed..
|
|
179
192
|
*
|
|
180
193
|
* @param control Checkbox/radio control.
|
|
181
194
|
* @param expectedText Expected checkbox/radio value.
|
|
@@ -191,7 +204,7 @@ export declare class Assertion extends Actions {
|
|
|
191
204
|
verifyListForMultipleValues(control: WebControl, listOfValueToVerify: string[], waitTillElementIsDisplayed?: boolean): Promise<void>;
|
|
192
205
|
/**
|
|
193
206
|
* Verify Alert text is equal to expected value
|
|
194
|
-
* If alert text is equal to expected value then test case gets
|
|
207
|
+
* If alert text is equal to expected value then test case gets passed else failed..
|
|
195
208
|
*
|
|
196
209
|
* @param expectedText Expected alert text.
|
|
197
210
|
* Example:
|
|
@@ -201,7 +214,7 @@ export declare class Assertion extends Actions {
|
|
|
201
214
|
verifyAlertText(expectedText: string): Promise<void>;
|
|
202
215
|
/**
|
|
203
216
|
* Verify URL contains expected value
|
|
204
|
-
* If URL contains expected value then test case gets
|
|
217
|
+
* If URL contains expected value then test case gets passed else failed..
|
|
205
218
|
*
|
|
206
219
|
* @param expectedText Expected partial URL.
|
|
207
220
|
* Example:
|
|
@@ -211,7 +224,7 @@ export declare class Assertion extends Actions {
|
|
|
211
224
|
verifyURLContains(subString: string): Promise<void>;
|
|
212
225
|
/**
|
|
213
226
|
* Verify count of elements which matched the control
|
|
214
|
-
* If count of elements is equal to expected value then test case will get
|
|
227
|
+
* If count of elements is equal to expected value then test case will get passed else failed..
|
|
215
228
|
*
|
|
216
229
|
* @param control Control element.
|
|
217
230
|
* @param expectedCount Expected count of elements matching criteria
|
|
@@ -225,7 +238,7 @@ export declare class Assertion extends Actions {
|
|
|
225
238
|
verifyCountOfElementsIsLesseOrEqual(control: WebControl, expectedCount: number): Promise<void>;
|
|
226
239
|
/**
|
|
227
240
|
* Verify title of web page contains expected value
|
|
228
|
-
* If title contains expected value then test case will get
|
|
241
|
+
* If title contains expected value then test case will get passed else failed..
|
|
229
242
|
*
|
|
230
243
|
* @param expectedText Expected partial Title.
|
|
231
244
|
* 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.
|
|
@@ -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.
|
|
@@ -308,7 +308,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
308
308
|
case 1:
|
|
309
309
|
_a.sent();
|
|
310
310
|
_a.label = 2;
|
|
311
|
-
case 2: return [4 /*yield*/, control.controlLocator.isEnabled().then(function (value) {
|
|
311
|
+
case 2: return [4 /*yield*/, control.controlLocator.first().isEnabled().then(function (value) {
|
|
312
312
|
var verificationResult = value === expValue ? "PASSED" : "FAILED";
|
|
313
313
|
var logText = "VERIFICATION: ".concat(verificationResult, " '").concat(control.controlDescription, "' enabled status is: '").concat(value, "' Expected: ").concat(expValue);
|
|
314
314
|
(0, logs_core_1.logVerification)(logText);
|
|
@@ -341,7 +341,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
341
341
|
case 1:
|
|
342
342
|
_a.sent();
|
|
343
343
|
_a.label = 2;
|
|
344
|
-
case 2: return [4 /*yield*/, control.controlLocator.isChecked().then(function (isChecked) {
|
|
344
|
+
case 2: return [4 /*yield*/, control.controlLocator.first().isChecked().then(function (isChecked) {
|
|
345
345
|
var verificationResult = isChecked === expValue ? "PASSED" : "FAILED";
|
|
346
346
|
var logText = "VERIFICATION: ".concat(verificationResult, " '").concat(control.controlDescription, "' selected status is: '").concat(isChecked, "' Expected: ").concat(expValue);
|
|
347
347
|
(0, logs_core_1.logVerification)(logText);
|
|
@@ -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.
|
|
@@ -457,7 +457,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
457
457
|
return __awaiter(this, void 0, void 0, function () {
|
|
458
458
|
return __generator(this, function (_a) {
|
|
459
459
|
switch (_a.label) {
|
|
460
|
-
case 0: return [4 /*yield*/, control.controlLocator.getAttribute("value").then(function (value) {
|
|
460
|
+
case 0: return [4 /*yield*/, control.controlLocator.first().getAttribute("value").then(function (value) {
|
|
461
461
|
var verificationResult = value === 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);
|
|
@@ -471,8 +471,37 @@ 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 === 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
|
+
/**
|
|
474
503
|
* 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
|
|
504
|
+
* If expected element's checkbox/radio value to be expected value then test case gets passed else failed..
|
|
476
505
|
*
|
|
477
506
|
* @param control Checkbox/radio control.
|
|
478
507
|
* @param expectedText Expected checkbox/radio value.
|
|
@@ -501,7 +530,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
501
530
|
};
|
|
502
531
|
/**
|
|
503
532
|
* Verify element's tagname is equal to expected value
|
|
504
|
-
* If expected element's Tagname is equal to expected value then test case gets
|
|
533
|
+
* If expected element's Tagname is equal to expected value then test case gets passed else failed..
|
|
505
534
|
*
|
|
506
535
|
* @param control Checkbox/radio control.
|
|
507
536
|
* @param expectedText Expected checkbox/radio value.
|
|
@@ -517,7 +546,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
517
546
|
return __generator(this, function (_a) {
|
|
518
547
|
switch (_a.label) {
|
|
519
548
|
case 0:
|
|
520
|
-
parent = control.controlLocator;
|
|
549
|
+
parent = control.controlLocator.first();
|
|
521
550
|
if (!(parent != null)) return [3 /*break*/, 2];
|
|
522
551
|
return [4 /*yield*/, parent.evaluate(function (e) { return e.tagName; })];
|
|
523
552
|
case 1:
|
|
@@ -663,7 +692,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
663
692
|
};
|
|
664
693
|
/**
|
|
665
694
|
* Verify Alert text is equal to expected value
|
|
666
|
-
* If alert text is equal to expected value then test case gets
|
|
695
|
+
* If alert text is equal to expected value then test case gets passed else failed..
|
|
667
696
|
*
|
|
668
697
|
* @param expectedText Expected alert text.
|
|
669
698
|
* Example:
|
|
@@ -690,7 +719,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
690
719
|
};
|
|
691
720
|
/**
|
|
692
721
|
* Verify URL contains expected value
|
|
693
|
-
* If URL contains expected value then test case gets
|
|
722
|
+
* If URL contains expected value then test case gets passed else failed..
|
|
694
723
|
*
|
|
695
724
|
* @param expectedText Expected partial URL.
|
|
696
725
|
* Example:
|
|
@@ -716,7 +745,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
716
745
|
};
|
|
717
746
|
/**
|
|
718
747
|
* Verify count of elements which matched the control
|
|
719
|
-
* If count of elements is equal to expected value then test case will get
|
|
748
|
+
* If count of elements is equal to expected value then test case will get passed else failed..
|
|
720
749
|
*
|
|
721
750
|
* @param control Control element.
|
|
722
751
|
* @param expectedCount Expected count of elements matching criteria
|
|
@@ -778,7 +807,7 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
778
807
|
};
|
|
779
808
|
/**
|
|
780
809
|
* Verify title of web page contains expected value
|
|
781
|
-
* If title contains expected value then test case will get
|
|
810
|
+
* If title contains expected value then test case will get passed else failed..
|
|
782
811
|
*
|
|
783
812
|
* @param expectedText Expected partial Title.
|
|
784
813
|
* Example:
|