playwright-ts-automationframework 1.0.11 → 1.0.13

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.
@@ -324,13 +324,13 @@ export declare class Actions extends BasePage {
324
324
  /**
325
325
  * Wait for execution to stop for given time
326
326
  *
327
- * @param milliseconds Time for which executed should halt in seconds
327
+ * @param timeInSeconds Time for which executed should halt in seconds
328
328
  *
329
329
  * Example:
330
330
  *
331
331
  * sleep(10);
332
332
  */
333
- sleep(milliseconds?: number): Promise<unknown>;
333
+ sleep(timeInSeconds?: number): Promise<unknown>;
334
334
  /**
335
335
  * Close the browser instance
336
336
  *
@@ -78,7 +78,7 @@ var Actions = /** @class */ (function (_super) {
78
78
  return __awaiter(this, void 0, void 0, function () {
79
79
  return __generator(this, function (_a) {
80
80
  switch (_a.label) {
81
- case 0: return [4 /*yield*/, control.controlLocator.click().then(function () {
81
+ case 0: return [4 /*yield*/, control.controlLocator.first().click().then(function () {
82
82
  (0, logs_core_1.logAction)("Clicked on '" + control.controlDescription + "'");
83
83
  }, function (error) {
84
84
  (0, logs_core_1.errorLog)("Unable to click on '" + control.controlDescription + "'");
@@ -105,7 +105,7 @@ var Actions = /** @class */ (function (_super) {
105
105
  return __awaiter(this, void 0, void 0, function () {
106
106
  return __generator(this, function (_a) {
107
107
  switch (_a.label) {
108
- case 0: return [4 /*yield*/, control.controlLocator.hover().then(function () {
108
+ case 0: return [4 /*yield*/, control.controlLocator.first().hover().then(function () {
109
109
  (0, logs_core_1.logAction)("Mouse hover to '" + control.controlDescription + "'");
110
110
  }, function (error) {
111
111
  (0, logs_core_1.errorLog)("Unable to mouse hover on :'" + control.controlDescription + "'");
@@ -133,7 +133,7 @@ var Actions = /** @class */ (function (_super) {
133
133
  return __awaiter(this, void 0, void 0, function () {
134
134
  return __generator(this, function (_a) {
135
135
  switch (_a.label) {
136
- case 0: return [4 /*yield*/, control.controlLocator.focus()];
136
+ case 0: return [4 /*yield*/, control.controlLocator.first().focus()];
137
137
  case 1:
138
138
  _a.sent();
139
139
  return [4 /*yield*/, this.pressKeyboardEvent(control, action)];
@@ -159,7 +159,7 @@ var Actions = /** @class */ (function (_super) {
159
159
  return __awaiter(this, void 0, void 0, function () {
160
160
  return __generator(this, function (_a) {
161
161
  switch (_a.label) {
162
- case 0: return [4 /*yield*/, control.controlLocator.fill(textTobeEntered).then(function () {
162
+ case 0: return [4 /*yield*/, control.controlLocator.first().fill(textTobeEntered).then(function () {
163
163
  if (control.controlDescription.trim().toLowerCase().endsWith('textbox')) {
164
164
  (0, logs_core_1.logAction)("Entered '" + textTobeEntered + "' in '" + control.controlDescription + "'");
165
165
  }
@@ -192,7 +192,7 @@ var Actions = /** @class */ (function (_super) {
192
192
  return __awaiter(this, void 0, void 0, function () {
193
193
  return __generator(this, function (_a) {
194
194
  switch (_a.label) {
195
- case 0: return [4 /*yield*/, control.controlLocator.press(key).then(function () {
195
+ case 0: return [4 /*yield*/, control.controlLocator.first().press(key).then(function () {
196
196
  (0, logs_core_1.logAction)("Press Key '" + key.toUpperCase() + "' on '" + control.controlDescription + "'");
197
197
  })];
198
198
  case 1:
@@ -217,7 +217,7 @@ var Actions = /** @class */ (function (_super) {
217
217
  Actions.prototype.selectFromDropdownByValue = function (control, optionTobeSelcted) {
218
218
  return __awaiter(this, void 0, void 0, function () {
219
219
  return __generator(this, function (_a) {
220
- control.controlLocator.selectOption({ value: optionTobeSelcted }).then(function () {
220
+ control.controlLocator.first().selectOption({ value: optionTobeSelcted }).then(function () {
221
221
  (0, logs_core_1.logAction)("Selected '" + optionTobeSelcted + "' from '" + control.controlDescription + "'");
222
222
  }, function () {
223
223
  (0, logs_core_1.errorLog)("'Unable to select '" + optionTobeSelcted + "' from '" + control.controlDescription + "'");
@@ -241,7 +241,7 @@ var Actions = /** @class */ (function (_super) {
241
241
  Actions.prototype.selectDropDownByText = function (control, optionTobeSelcted) {
242
242
  return __awaiter(this, void 0, void 0, function () {
243
243
  return __generator(this, function (_a) {
244
- control.controlLocator.selectOption({ label: optionTobeSelcted }).then(function () {
244
+ control.controlLocator.first().selectOption({ label: optionTobeSelcted }).then(function () {
245
245
  (0, logs_core_1.logAction)("Selected '" + optionTobeSelcted + "' from '" + control.controlDescription + "'");
246
246
  }, function () {
247
247
  (0, logs_core_1.errorLog)("'Unable to select '" + optionTobeSelcted + "' from '" + control.controlDescription + "'");
@@ -696,7 +696,7 @@ var Actions = /** @class */ (function (_super) {
696
696
  case 0:
697
697
  _a.trys.push([0, 2, , 3]);
698
698
  return [4 /*yield*/, this.page.waitForURL(url, {
699
- timeout: 10000,
699
+ timeout: 30000,
700
700
  waitUntil: "load"
701
701
  })];
702
702
  case 1: return [2 /*return*/, _a.sent()];
@@ -732,7 +732,7 @@ var Actions = /** @class */ (function (_super) {
732
732
  _a.trys.push([2, 4, , 5]);
733
733
  return [4 /*yield*/, control.controlLocator.waitFor({
734
734
  state: "visible",
735
- timeout: 10000
735
+ timeout: 30000
736
736
  })];
737
737
  case 3:
738
738
  _a.sent();
@@ -769,7 +769,7 @@ var Actions = /** @class */ (function (_super) {
769
769
  _a.trys.push([2, 4, , 5]);
770
770
  return [4 /*yield*/, control.controlLocator.waitFor({
771
771
  state: "attached",
772
- timeout: 10000
772
+ timeout: 30000
773
773
  })];
774
774
  case 3:
775
775
  _a.sent();
@@ -802,7 +802,7 @@ var Actions = /** @class */ (function (_super) {
802
802
  _a.trys.push([0, 2, , 3]);
803
803
  return [4 /*yield*/, control.controlLocator.waitFor({
804
804
  state: "hidden",
805
- timeout: 10000
805
+ timeout: 30000
806
806
  })];
807
807
  case 1:
808
808
  _a.sent();
@@ -818,18 +818,18 @@ var Actions = /** @class */ (function (_super) {
818
818
  /**
819
819
  * Wait for execution to stop for given time
820
820
  *
821
- * @param milliseconds Time for which executed should halt in seconds
821
+ * @param timeInSeconds Time for which executed should halt in seconds
822
822
  *
823
823
  * Example:
824
824
  *
825
825
  * sleep(10);
826
826
  */
827
- Actions.prototype.sleep = function (milliseconds) {
828
- if (milliseconds === void 0) { milliseconds = 5; }
827
+ Actions.prototype.sleep = function (timeInSeconds) {
828
+ if (timeInSeconds === void 0) { timeInSeconds = 5; }
829
829
  return __awaiter(this, void 0, void 0, function () {
830
830
  return __generator(this, function (_a) {
831
831
  switch (_a.label) {
832
- case 0: return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, milliseconds * 1000); })];
832
+ case 0: return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, timeInSeconds * 1000); })];
833
833
  case 1: return [2 /*return*/, _a.sent()];
834
834
  }
835
835
  });
@@ -59,7 +59,7 @@ var BasePage = /** @class */ (function () {
59
59
  switch (_a.label) {
60
60
  case 0: return [4 /*yield*/, this.page.goto(url, {
61
61
  waitUntil: "load",
62
- timeout: 20000
62
+ timeout: 30000
63
63
  }).then(function () {
64
64
  (0, logs_core_1.logAction)("Navigated to URL: " + url);
65
65
  })];
@@ -72,9 +72,9 @@ var BasePage = /** @class */ (function () {
72
72
  };
73
73
  BasePage.setTestCaseID = function (testInfo, testCaseID) {
74
74
  if (testCaseID === void 0) { testCaseID = 0; }
75
- testInfo.testId = testCaseID.toString();
75
+ var testId = testCaseID.toString();
76
76
  (0, logs_core_1.logTestResult)('');
77
- (0, logs_core_1.logTestResult)("===== START Of Execution For TestCase ID: " + testCaseID + " Title: '" + testInfo.title + "' ======");
77
+ (0, logs_core_1.logTestResult)("===== START Of Execution For TestCase ID: " + testId + " Title: '" + testInfo.title + "' ======");
78
78
  (0, logs_core_1.logTestResult)('');
79
79
  };
80
80
  BasePage.executionCompleted = function (testinfo) {
@@ -55,14 +55,17 @@ var Configuration = /** @class */ (function () {
55
55
  if (Configuration.environment.toUpperCase().includes("QA")) {
56
56
  return appConfigurations.QA;
57
57
  }
58
- else if (Configuration.environment.toUpperCase().includes("STAG")) {
58
+ if (Configuration.environment.toUpperCase().includes("DEV")) {
59
+ return appConfigurations.DEV;
60
+ }
61
+ else if (Configuration.environment.toUpperCase().includes("STAGE")) {
59
62
  return appConfigurations.STAGE;
60
63
  }
61
64
  else if (Configuration.environment.toUpperCase().includes("PROD")) {
62
65
  return appConfigurations.PROD;
63
66
  }
64
67
  else {
65
- return appConfigurations.QA;
68
+ return appConfigurations[Configuration.environment];
66
69
  }
67
70
  },
68
71
  enumerable: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playwright-ts-automationframework",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -19,12 +19,13 @@
19
19
  "ignore-case": "^0.1.0"
20
20
  },
21
21
  "dependencies": {
22
- "@playwright/test": "^1.40.1",
23
- "@types/node": "^20.10.5",
22
+ "@playwright/test": "^1.42.1",
23
+ "@types/node": "^20.12.2",
24
24
  "log4js": "^6.9.1",
25
25
  "nodemailer": "^6.9.5",
26
26
  "npm": "^10.2.5",
27
27
  "path": "^0.12.7",
28
+ "playwright-ts-automationframework": "file:",
28
29
  "typescript": "^5.3.3"
29
30
  },
30
31
  "files": [