playwright-ts-automationframework 1.1.7 → 1.1.8
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
|
|
327
|
+
* @param milliseconds Time for which executed should halt in seconds
|
|
328
328
|
*
|
|
329
329
|
* Example:
|
|
330
330
|
*
|
|
331
331
|
* sleep(10);
|
|
332
332
|
*/
|
|
333
|
-
sleep(
|
|
333
|
+
sleep(milliseconds?: number): Promise<unknown>;
|
|
334
334
|
/**
|
|
335
335
|
* Close the browser instance
|
|
336
336
|
*
|
package/lib/core/actions.core.js
CHANGED
|
@@ -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.
|
|
81
|
+
case 0: return [4 /*yield*/, control.controlLocator.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.
|
|
108
|
+
case 0: return [4 /*yield*/, control.controlLocator.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.
|
|
136
|
+
case 0: return [4 /*yield*/, control.controlLocator.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.
|
|
162
|
+
case 0: return [4 /*yield*/, control.controlLocator.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.
|
|
195
|
+
case 0: return [4 /*yield*/, control.controlLocator.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.
|
|
220
|
+
control.controlLocator.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.
|
|
244
|
+
control.controlLocator.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:
|
|
699
|
+
timeout: 10000,
|
|
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:
|
|
735
|
+
timeout: 10000
|
|
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:
|
|
772
|
+
timeout: 10000
|
|
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:
|
|
805
|
+
timeout: 10000
|
|
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
|
|
821
|
+
* @param milliseconds 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 (
|
|
828
|
-
if (
|
|
827
|
+
Actions.prototype.sleep = function (milliseconds) {
|
|
828
|
+
if (milliseconds === void 0) { milliseconds = 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,
|
|
832
|
+
case 0: return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, milliseconds * 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:
|
|
62
|
+
timeout: 20000
|
|
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
|
-
|
|
75
|
+
testInfo.testId = testCaseID.toString();
|
|
76
76
|
(0, logs_core_1.logTestResult)('');
|
|
77
|
-
(0, logs_core_1.logTestResult)("===== START Of Execution For TestCase ID: " +
|
|
77
|
+
(0, logs_core_1.logTestResult)("===== START Of Execution For TestCase ID: " + testCaseID + " Title: '" + testInfo.title + "' ======");
|
|
78
78
|
(0, logs_core_1.logTestResult)('');
|
|
79
79
|
};
|
|
80
80
|
BasePage.executionCompleted = function (testinfo) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Configuration = void 0;
|
|
4
|
-
var automationSettings = require(
|
|
5
|
-
var appConfigurations = require(
|
|
4
|
+
var automationSettings = require('../../../../ExecutionSettings.json');
|
|
5
|
+
var appConfigurations = require('../../../../AppConfigurations.json');
|
|
6
6
|
/**
|
|
7
7
|
* Class to initilize all variables required for execution
|
|
8
8
|
* @author Ketan Pardeshi
|
|
@@ -52,18 +52,7 @@ var Configuration = /** @class */ (function () {
|
|
|
52
52
|
});
|
|
53
53
|
Object.defineProperty(Configuration, "configurationData", {
|
|
54
54
|
get: function () {
|
|
55
|
-
|
|
56
|
-
return appConfigurations.QA;
|
|
57
|
-
}
|
|
58
|
-
else if (Configuration.environment.toUpperCase().includes("STAG")) {
|
|
59
|
-
return appConfigurations.STAGE;
|
|
60
|
-
}
|
|
61
|
-
else if (Configuration.environment.toUpperCase().includes("PROD")) {
|
|
62
|
-
return appConfigurations.PROD;
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
return appConfigurations.QA;
|
|
66
|
-
}
|
|
55
|
+
return appConfigurations[Configuration.environment];
|
|
67
56
|
},
|
|
68
57
|
enumerable: false,
|
|
69
58
|
configurable: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "playwright-ts-automationframework",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
"nodemailer": "^6.9.5",
|
|
26
26
|
"npm": "^10.2.5",
|
|
27
27
|
"path": "^0.12.7",
|
|
28
|
-
"playwright-ts-automationframework": "file:",
|
|
29
28
|
"typescript": "^5.3.3"
|
|
30
29
|
},
|
|
31
30
|
"files": [
|