playwright-ts-automationframework 1.1.58 → 1.1.60

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.
@@ -360,30 +360,33 @@ var Actions = /** @class */ (function (_super) {
360
360
  */
361
361
  Actions.prototype.selectCheckbox = function (control_1) {
362
362
  return __awaiter(this, arguments, void 0, function (control, expectedCheckboxValue) {
363
+ var error_1;
363
364
  if (expectedCheckboxValue === void 0) { expectedCheckboxValue = true; }
364
365
  return __generator(this, function (_a) {
365
366
  switch (_a.label) {
366
367
  case 0: return [4 /*yield*/, this.waitTillElementIsPresent(control)];
367
368
  case 1:
368
369
  _a.sent();
369
- if (!(expectedCheckboxValue == true)) return [3 /*break*/, 2];
370
- control.controlLocator.first().check().then(function () {
371
- (0, logs_core_1.logAction)("Set checkbox value of '" + control.controlDescription + "' as checked");
372
- }, function (error) {
373
- (0, logs_core_1.logError)("\u274C Unable to set checkbox value of '".concat(control.controlDescription, "' as checked"));
374
- throw error;
375
- });
376
- return [3 /*break*/, 4];
377
- case 2: return [4 /*yield*/, control.controlLocator.first().uncheck().then(function () {
378
- (0, logs_core_1.logAction)("Set checkbox value of '" + control.controlDescription + "' as unchecked");
379
- }, function (error) {
380
- (0, logs_core_1.logError)("\u274C Unable to set checkbox value of '".concat(control.controlDescription, "' as unchecked"));
381
- throw error;
382
- })];
370
+ _a.label = 2;
371
+ case 2:
372
+ _a.trys.push([2, 7, , 8]);
373
+ if (!expectedCheckboxValue) return [3 /*break*/, 4];
374
+ return [4 /*yield*/, control.controlLocator.first().check()];
383
375
  case 3:
384
376
  _a.sent();
385
- _a.label = 4;
386
- case 4: return [2 /*return*/];
377
+ (0, logs_core_1.logAction)("Set checkbox value of '" + control.controlDescription + "' as checked");
378
+ return [3 /*break*/, 6];
379
+ case 4: return [4 /*yield*/, control.controlLocator.first().uncheck()];
380
+ case 5:
381
+ _a.sent();
382
+ (0, logs_core_1.logAction)("Set checkbox value of '" + control.controlDescription + "' as unchecked");
383
+ _a.label = 6;
384
+ case 6: return [3 /*break*/, 8];
385
+ case 7:
386
+ error_1 = _a.sent();
387
+ (0, logs_core_1.logError)("\u274C Unable to set checkbox value of '".concat(control.controlDescription, "' as ").concat(expectedCheckboxValue ? "checked" : "unchecked"));
388
+ throw error_1;
389
+ case 8: return [2 /*return*/];
387
390
  }
388
391
  });
389
392
  });
@@ -487,7 +490,7 @@ var Actions = /** @class */ (function (_super) {
487
490
  */
488
491
  Actions.prototype.getText = function (control) {
489
492
  return __awaiter(this, void 0, void 0, function () {
490
- var text, error_1;
493
+ var text, error_2;
491
494
  return __generator(this, function (_a) {
492
495
  switch (_a.label) {
493
496
  case 0:
@@ -498,8 +501,8 @@ var Actions = /** @class */ (function (_super) {
498
501
  (0, logs_core_1.logConsole)("Value read from '".concat(control.controlDescription, "' is: '").concat(text, "'"));
499
502
  return [2 /*return*/, text];
500
503
  case 2:
501
- error_1 = _a.sent();
502
- (0, logs_core_1.logError)("\u274C Unable to read the text from '".concat(control.controlDescription, "' due to reason: ").concat(error_1));
504
+ error_2 = _a.sent();
505
+ (0, logs_core_1.logError)("\u274C Unable to read the text from '".concat(control.controlDescription, "' due to reason: ").concat(error_2));
503
506
  return [2 /*return*/, '']; // Return an empty string or handle it as needed
504
507
  case 3: return [2 /*return*/];
505
508
  }
@@ -519,7 +522,7 @@ var Actions = /** @class */ (function (_super) {
519
522
  */
520
523
  Actions.prototype.getTextboxValue = function (control) {
521
524
  return __awaiter(this, void 0, void 0, function () {
522
- var value, error_2;
525
+ var value, error_3;
523
526
  return __generator(this, function (_a) {
524
527
  switch (_a.label) {
525
528
  case 0:
@@ -530,8 +533,8 @@ var Actions = /** @class */ (function (_super) {
530
533
  (0, logs_core_1.logConsole)("Value read from textbox '".concat(control.controlDescription, "' is: '").concat(value, "'"));
531
534
  return [2 /*return*/, value];
532
535
  case 2:
533
- error_2 = _a.sent();
534
- (0, logs_core_1.logError)("\u274C Unable to read the value from '".concat(control.controlDescription, "' due to reason: ").concat(error_2));
536
+ error_3 = _a.sent();
537
+ (0, logs_core_1.logError)("\u274C Unable to read the value from '".concat(control.controlDescription, "' due to reason: ").concat(error_3));
535
538
  return [2 /*return*/, '']; // Return an empty string or handle it as needed
536
539
  case 3: return [2 /*return*/];
537
540
  }
@@ -551,7 +554,7 @@ var Actions = /** @class */ (function (_super) {
551
554
  */
552
555
  Actions.prototype.getSelectedItemFromDropdown = function (control) {
553
556
  return __awaiter(this, void 0, void 0, function () {
554
- var value, error_3;
557
+ var value, error_4;
555
558
  return __generator(this, function (_a) {
556
559
  switch (_a.label) {
557
560
  case 0:
@@ -562,8 +565,8 @@ var Actions = /** @class */ (function (_super) {
562
565
  (0, logs_core_1.logConsole)("Value read from '".concat(control.controlDescription, "' is: '").concat(value, "'"));
563
566
  return [2 /*return*/, value];
564
567
  case 2:
565
- error_3 = _a.sent();
566
- (0, logs_core_1.logError)("\u274C Unable to read the value from '".concat(control.controlDescription, "' due to reason: ").concat(error_3));
568
+ error_4 = _a.sent();
569
+ (0, logs_core_1.logError)("\u274C Unable to read the value from '".concat(control.controlDescription, "' due to reason: ").concat(error_4));
567
570
  return [2 /*return*/, '']; // Return an empty string or handle it as needed
568
571
  case 3: return [2 /*return*/];
569
572
  }
@@ -584,7 +587,7 @@ var Actions = /** @class */ (function (_super) {
584
587
  */
585
588
  Actions.prototype.getAttributeValue = function (control, attributeName) {
586
589
  return __awaiter(this, void 0, void 0, function () {
587
- var value, error_4;
590
+ var value, error_5;
588
591
  return __generator(this, function (_a) {
589
592
  switch (_a.label) {
590
593
  case 0:
@@ -595,8 +598,8 @@ var Actions = /** @class */ (function (_super) {
595
598
  (0, logs_core_1.logConsole)("Attribute value for '".concat(control.controlDescription, "' - Attribute Name: '").concat(attributeName, "', Value: '").concat(value, "'"));
596
599
  return [2 /*return*/, value];
597
600
  case 2:
598
- error_4 = _a.sent();
599
- (0, logs_core_1.logError)("\u274C Unable to read attribute value from '".concat(control.controlDescription, "' - Reason: ").concat(error_4));
601
+ error_5 = _a.sent();
602
+ (0, logs_core_1.logError)("\u274C Unable to read attribute value from '".concat(control.controlDescription, "' - Reason: ").concat(error_5));
600
603
  return [2 /*return*/, ''];
601
604
  case 3: return [2 /*return*/];
602
605
  }
@@ -815,7 +818,7 @@ var Actions = /** @class */ (function (_super) {
815
818
  */
816
819
  Actions.prototype.waitTillPageURLContains = function (url_1) {
817
820
  return __awaiter(this, arguments, void 0, function (url, timeoutInSeconds) {
818
- var error_5;
821
+ var error_6;
819
822
  if (timeoutInSeconds === void 0) { timeoutInSeconds = 60; }
820
823
  return __generator(this, function (_a) {
821
824
  switch (_a.label) {
@@ -827,7 +830,7 @@ var Actions = /** @class */ (function (_super) {
827
830
  })];
828
831
  case 1: return [2 /*return*/, _a.sent()];
829
832
  case 2:
830
- error_5 = _a.sent();
833
+ error_6 = _a.sent();
831
834
  return [3 /*break*/, 3];
832
835
  case 3: return [2 /*return*/];
833
836
  }
@@ -847,7 +850,7 @@ var Actions = /** @class */ (function (_super) {
847
850
  */
848
851
  Actions.prototype.waitTillElementIsPresent = function (control_1) {
849
852
  return __awaiter(this, arguments, void 0, function (control, timeoutInSeconds) {
850
- var error_6;
853
+ var error_7;
851
854
  if (timeoutInSeconds === void 0) { timeoutInSeconds = 60; }
852
855
  return __generator(this, function (_a) {
853
856
  switch (_a.label) {
@@ -865,7 +868,7 @@ var Actions = /** @class */ (function (_super) {
865
868
  _a.sent();
866
869
  return [3 /*break*/, 5];
867
870
  case 4:
868
- error_6 = _a.sent();
871
+ error_7 = _a.sent();
869
872
  return [3 /*break*/, 5];
870
873
  case 5: return [2 /*return*/];
871
874
  }
@@ -885,7 +888,7 @@ var Actions = /** @class */ (function (_super) {
885
888
  */
886
889
  Actions.prototype.waitTillElementIsAttached = function (control_1) {
887
890
  return __awaiter(this, arguments, void 0, function (control, timeoutInSeconds) {
888
- var error_7;
891
+ var error_8;
889
892
  if (timeoutInSeconds === void 0) { timeoutInSeconds = 60; }
890
893
  return __generator(this, function (_a) {
891
894
  switch (_a.label) {
@@ -903,7 +906,7 @@ var Actions = /** @class */ (function (_super) {
903
906
  _a.sent();
904
907
  return [3 /*break*/, 5];
905
908
  case 4:
906
- error_7 = _a.sent();
909
+ error_8 = _a.sent();
907
910
  return [3 /*break*/, 5];
908
911
  case 5: return [2 /*return*/];
909
912
  }
@@ -923,7 +926,7 @@ var Actions = /** @class */ (function (_super) {
923
926
  */
924
927
  Actions.prototype.waitTillElementIsNotPresent = function (control_1) {
925
928
  return __awaiter(this, arguments, void 0, function (control, timeoutInSeconds) {
926
- var error_8;
929
+ var error_9;
927
930
  if (timeoutInSeconds === void 0) { timeoutInSeconds = 60; }
928
931
  return __generator(this, function (_a) {
929
932
  switch (_a.label) {
@@ -937,7 +940,7 @@ var Actions = /** @class */ (function (_super) {
937
940
  _a.sent();
938
941
  return [3 /*break*/, 3];
939
942
  case 2:
940
- error_8 = _a.sent();
943
+ error_9 = _a.sent();
941
944
  return [3 /*break*/, 3];
942
945
  case 3: return [2 /*return*/];
943
946
  }
@@ -40,7 +40,7 @@ export declare class Assertion extends Actions {
40
40
  *
41
41
  * loginBtn = new WebControl(this.page.locator('#login'), 'Login button');
42
42
  *
43
- * verifyIsEnabled(loginBtn, true);
43
+ * verifyIsDisplayed(loginBtn, true);
44
44
  */
45
45
  verifyIsDisplayed(control: WebControl, expectedIsDisplayed?: boolean): Promise<void>;
46
46
  /**
@@ -144,7 +144,7 @@ var Assertion = /** @class */ (function (_super) {
144
144
  *
145
145
  * loginBtn = new WebControl(this.page.locator('#login'), 'Login button');
146
146
  *
147
- * verifyIsEnabled(loginBtn, true);
147
+ * verifyIsDisplayed(loginBtn, true);
148
148
  */
149
149
  Assertion.prototype.verifyIsDisplayed = function (control_1) {
150
150
  return __awaiter(this, arguments, void 0, function (control, expectedIsDisplayed) {
@@ -315,23 +315,20 @@ var Assertion = /** @class */ (function (_super) {
315
315
  */
316
316
  Assertion.prototype.verifyIsEnabled = function (control_1) {
317
317
  return __awaiter(this, arguments, void 0, function (control, expValue) {
318
+ var value, verificationResult, logText;
318
319
  if (expValue === void 0) { expValue = true; }
319
320
  return __generator(this, function (_a) {
320
321
  switch (_a.label) {
321
- case 0:
322
- if (!(expValue == true)) return [3 /*break*/, 2];
323
- return [4 /*yield*/, this.page.waitForLoadState("load")];
322
+ case 0: return [4 /*yield*/, this.page.waitForLoadState("load")];
324
323
  case 1:
325
324
  _a.sent();
326
- _a.label = 2;
327
- case 2: return [4 /*yield*/, control.controlLocator.first().isEnabled().then(function (value) {
328
- var verificationResult = value === expValue ? "✅ PASSED" : "❌ FAILED";
329
- var logText = "VERIFICATION: '".concat(verificationResult, "' '").concat(control.controlDescription, "' enabled status is: '").concat(value, "' Expected: ").concat(expValue);
330
- (0, logs_core_1.logVerification)(logText);
331
- test_1.expect.soft(value, logText).toBe(expValue);
332
- })];
333
- case 3:
334
- _a.sent();
325
+ return [4 /*yield*/, control.controlLocator.first().isEnabled()];
326
+ case 2:
327
+ value = _a.sent();
328
+ verificationResult = value === expValue ? " PASSED" : " FAILED";
329
+ logText = "VERIFICATION: '".concat(verificationResult, "' '").concat(control.controlDescription, "' enabled status is: '").concat(value, "' Expected: ").concat(expValue);
330
+ (0, logs_core_1.logVerification)(logText);
331
+ test_1.expect.soft(value, logText).toBe(expValue);
335
332
  return [2 /*return*/];
336
333
  }
337
334
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playwright-ts-automationframework",
3
- "version": "1.1.58",
3
+ "version": "1.1.60",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -19,11 +19,11 @@
19
19
  "ignore-case": "^0.1.0"
20
20
  },
21
21
  "dependencies": {
22
- "@playwright/test": "^1.53.0",
23
- "@types/node": "^24.0.0",
22
+ "@playwright/test": "^1.53.2",
23
+ "@types/node": "^24.0.8",
24
24
  "log4js": "^6.9.1",
25
- "nodemailer": "^7.0.3",
26
- "npm": "^11.4.1",
25
+ "nodemailer": "^7.0.4",
26
+ "npm": "^11.4.2",
27
27
  "path": "^0.12.7",
28
28
  "typescript": "^5.8.3"
29
29
  },