playwright-ts-automationframework 1.1.56 → 1.1.58

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.
@@ -336,10 +336,10 @@ export declare class Actions extends BasePage {
336
336
  */
337
337
  sleep(timeInSeconds?: number): Promise<void>;
338
338
  waitForPageTimeout(timeoutInSeconds?: number): Promise<void>;
339
- waitForPageLoad(): Promise<void>;
340
- waitForPageDOMcontentLoaded(): Promise<void>;
341
- waitForNetworkIdle(): Promise<void>;
342
- refreshWebPage(): Promise<void>;
339
+ waitForPageLoad(timeInSeconds?: number): Promise<void>;
340
+ waitForPageDOMcontentLoaded(timeInSeconds?: number): Promise<void>;
341
+ waitForNetworkIdle(timeInSeconds?: number): Promise<void>;
342
+ refreshWebPage(timeInSeconds?: number): Promise<void>;
343
343
  /**
344
344
  * Close the browser instance
345
345
  *
@@ -597,7 +597,7 @@ var Actions = /** @class */ (function (_super) {
597
597
  case 2:
598
598
  error_4 = _a.sent();
599
599
  (0, logs_core_1.logError)("\u274C Unable to read attribute value from '".concat(control.controlDescription, "' - Reason: ").concat(error_4));
600
- return [2 /*return*/, null];
600
+ return [2 /*return*/, ''];
601
601
  case 3: return [2 /*return*/];
602
602
  }
603
603
  });
@@ -816,7 +816,7 @@ var Actions = /** @class */ (function (_super) {
816
816
  Actions.prototype.waitTillPageURLContains = function (url_1) {
817
817
  return __awaiter(this, arguments, void 0, function (url, timeoutInSeconds) {
818
818
  var error_5;
819
- if (timeoutInSeconds === void 0) { timeoutInSeconds = 30; }
819
+ if (timeoutInSeconds === void 0) { timeoutInSeconds = 60; }
820
820
  return __generator(this, function (_a) {
821
821
  switch (_a.label) {
822
822
  case 0:
@@ -848,7 +848,7 @@ var Actions = /** @class */ (function (_super) {
848
848
  Actions.prototype.waitTillElementIsPresent = function (control_1) {
849
849
  return __awaiter(this, arguments, void 0, function (control, timeoutInSeconds) {
850
850
  var error_6;
851
- if (timeoutInSeconds === void 0) { timeoutInSeconds = 30; }
851
+ if (timeoutInSeconds === void 0) { timeoutInSeconds = 60; }
852
852
  return __generator(this, function (_a) {
853
853
  switch (_a.label) {
854
854
  case 0: return [4 /*yield*/, this.page.waitForLoadState("domcontentloaded")];
@@ -886,7 +886,7 @@ var Actions = /** @class */ (function (_super) {
886
886
  Actions.prototype.waitTillElementIsAttached = function (control_1) {
887
887
  return __awaiter(this, arguments, void 0, function (control, timeoutInSeconds) {
888
888
  var error_7;
889
- if (timeoutInSeconds === void 0) { timeoutInSeconds = 30; }
889
+ if (timeoutInSeconds === void 0) { timeoutInSeconds = 60; }
890
890
  return __generator(this, function (_a) {
891
891
  switch (_a.label) {
892
892
  case 0: return [4 /*yield*/, this.page.waitForLoadState("domcontentloaded")];
@@ -924,7 +924,7 @@ var Actions = /** @class */ (function (_super) {
924
924
  Actions.prototype.waitTillElementIsNotPresent = function (control_1) {
925
925
  return __awaiter(this, arguments, void 0, function (control, timeoutInSeconds) {
926
926
  var error_8;
927
- if (timeoutInSeconds === void 0) { timeoutInSeconds = 30; }
927
+ if (timeoutInSeconds === void 0) { timeoutInSeconds = 60; }
928
928
  return __generator(this, function (_a) {
929
929
  switch (_a.label) {
930
930
  case 0:
@@ -980,10 +980,11 @@ var Actions = /** @class */ (function (_super) {
980
980
  });
981
981
  };
982
982
  Actions.prototype.waitForPageLoad = function () {
983
- return __awaiter(this, void 0, void 0, function () {
983
+ return __awaiter(this, arguments, void 0, function (timeInSeconds) {
984
+ if (timeInSeconds === void 0) { timeInSeconds = 30; }
984
985
  return __generator(this, function (_a) {
985
986
  switch (_a.label) {
986
- case 0: return [4 /*yield*/, this.page.waitForLoadState("load")];
987
+ case 0: return [4 /*yield*/, this.page.waitForLoadState("load", { timeout: timeInSeconds * 1000 })];
987
988
  case 1:
988
989
  _a.sent();
989
990
  return [2 /*return*/];
@@ -992,10 +993,11 @@ var Actions = /** @class */ (function (_super) {
992
993
  });
993
994
  };
994
995
  Actions.prototype.waitForPageDOMcontentLoaded = function () {
995
- return __awaiter(this, void 0, void 0, function () {
996
+ return __awaiter(this, arguments, void 0, function (timeInSeconds) {
997
+ if (timeInSeconds === void 0) { timeInSeconds = 30; }
996
998
  return __generator(this, function (_a) {
997
999
  switch (_a.label) {
998
- case 0: return [4 /*yield*/, this.page.waitForLoadState("domcontentloaded")];
1000
+ case 0: return [4 /*yield*/, this.page.waitForLoadState("domcontentloaded", { timeout: timeInSeconds * 1000 })];
999
1001
  case 1:
1000
1002
  _a.sent();
1001
1003
  return [2 /*return*/];
@@ -1004,10 +1006,11 @@ var Actions = /** @class */ (function (_super) {
1004
1006
  });
1005
1007
  };
1006
1008
  Actions.prototype.waitForNetworkIdle = function () {
1007
- return __awaiter(this, void 0, void 0, function () {
1009
+ return __awaiter(this, arguments, void 0, function (timeInSeconds) {
1010
+ if (timeInSeconds === void 0) { timeInSeconds = 30; }
1008
1011
  return __generator(this, function (_a) {
1009
1012
  switch (_a.label) {
1010
- case 0: return [4 /*yield*/, this.page.waitForLoadState("networkidle")];
1013
+ case 0: return [4 /*yield*/, this.page.waitForLoadState("networkidle", { timeout: timeInSeconds * 1000 })];
1011
1014
  case 1:
1012
1015
  _a.sent();
1013
1016
  return [2 /*return*/];
@@ -1016,10 +1019,11 @@ var Actions = /** @class */ (function (_super) {
1016
1019
  });
1017
1020
  };
1018
1021
  Actions.prototype.refreshWebPage = function () {
1019
- return __awaiter(this, void 0, void 0, function () {
1022
+ return __awaiter(this, arguments, void 0, function (timeInSeconds) {
1023
+ if (timeInSeconds === void 0) { timeInSeconds = 30; }
1020
1024
  return __generator(this, function (_a) {
1021
1025
  switch (_a.label) {
1022
- case 0: return [4 /*yield*/, this.page.reload()];
1026
+ case 0: return [4 /*yield*/, this.page.reload({ waitUntil: "load", timeout: timeInSeconds * 1000 })];
1023
1027
  case 1:
1024
1028
  _a.sent();
1025
1029
  return [2 /*return*/];
@@ -1037,7 +1041,9 @@ var Actions = /** @class */ (function (_super) {
1037
1041
  return __generator(this, function (_a) {
1038
1042
  switch (_a.label) {
1039
1043
  case 0: return [4 /*yield*/, this.page.close()];
1040
- case 1: return [2 /*return*/, _a.sent()];
1044
+ case 1:
1045
+ _a.sent();
1046
+ return [2 /*return*/];
1041
1047
  }
1042
1048
  });
1043
1049
  });
@@ -18,6 +18,7 @@ export declare class Assertion extends Actions {
18
18
  * verifyIsEquals("Invalid username", "Invalid username");
19
19
  */
20
20
  verifyIsEquals(object1: any, object2: any, controlDescription?: string): void;
21
+ verifyIsEqualIgnorecase(object1: any, object2: any, controlDescription?: string, caseInsensitive?: boolean): void;
21
22
  /**
22
23
  * Verify first value contains substring as second.
23
24
  * If expected value is present in actual value then test case gets passed else failed..
@@ -86,6 +86,31 @@ var Assertion = /** @class */ (function (_super) {
86
86
  throw error1;
87
87
  }
88
88
  };
89
+ Assertion.prototype.verifyIsEqualIgnorecase = function (object1, object2, controlDescription, caseInsensitive) {
90
+ if (controlDescription === void 0) { controlDescription = ""; }
91
+ if (caseInsensitive === void 0) { caseInsensitive = false; }
92
+ try {
93
+ var expected = object1;
94
+ var actual = object2;
95
+ if (caseInsensitive && typeof object1 === 'string' && typeof object2 === 'string') {
96
+ expected = object1.toLowerCase();
97
+ actual = object2.toLowerCase();
98
+ }
99
+ var verificationResult = expected === actual ? "✅ PASSED" : "❌ FAILED";
100
+ (0, logs_core_1.logVerification)("VERIFICATION: ".concat(verificationResult, ". ").concat(controlDescription, " Expected: '").concat(object1, "' Actual: '").concat(object2, "'"));
101
+ // Perform assertion based on case sensitivity
102
+ if (caseInsensitive && typeof object1 === 'string' && typeof object2 === 'string') {
103
+ test_1.expect.soft(object1.toLowerCase()).toEqual(object2.toLowerCase());
104
+ }
105
+ else {
106
+ test_1.expect.soft(object1).toEqual(object2);
107
+ }
108
+ }
109
+ catch (error1) {
110
+ (0, logs_core_1.logError)("VERIFICATION: '❌ FAILED'. Expected: '" + object1 + "' Actual: '" + object2 + "'");
111
+ throw error1;
112
+ }
113
+ };
89
114
  /**
90
115
  * Verify first value contains substring as second.
91
116
  * If expected value is present in actual value then test case gets passed else failed..
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playwright-ts-automationframework",
3
- "version": "1.1.56",
3
+ "version": "1.1.58",
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.52.0",
23
- "@types/node": "^22.15.19",
22
+ "@playwright/test": "^1.53.0",
23
+ "@types/node": "^24.0.0",
24
24
  "log4js": "^6.9.1",
25
25
  "nodemailer": "^7.0.3",
26
- "npm": "^11.4.0",
26
+ "npm": "^11.4.1",
27
27
  "path": "^0.12.7",
28
28
  "typescript": "^5.8.3"
29
29
  },