playwright-ts-automationframework 1.1.1 → 1.1.4
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/README.md +0 -2
- package/lib/core/actions.core.js +8 -8
- package/lib/core/assertion.core.js +17 -17
- package/lib/core/basePage.core.js +7 -7
- package/lib/core/configuration.core.js +2 -2
- package/lib/core/global.setup.js +4 -3
- package/lib/core/global.tearDown.js +4 -3
- package/lib/core/logs.core.js +6 -5
- package/lib/core/sendEmail.js +2 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# Playwright Typescript Automation framework library
|
|
2
2
|
|
|
3
|
-
Sample Project: https://github.com/ketanp88/PlaywrightFrameworkDemoProject
|
|
4
|
-
|
|
5
3
|
Playwright Typescript Automation framework
|
|
6
4
|
|
|
7
5
|
This is a test automation framework around Playwright - for end-to-end testing. This is Playwright Automation framework has all wrapper actions methods and assertions method along with logger. This is plug and play Playwright Test Automation framework in Typescript.
|
package/lib/core/actions.core.js
CHANGED
|
@@ -24,8 +24,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g
|
|
28
|
-
return g
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
30
|
function step(op) {
|
|
31
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -286,9 +286,9 @@ var Actions = /** @class */ (function (_super) {
|
|
|
286
286
|
*
|
|
287
287
|
* selectCheckbox(isMinorChkbx, true);
|
|
288
288
|
*/
|
|
289
|
-
Actions.prototype.selectCheckbox = function (
|
|
290
|
-
|
|
291
|
-
|
|
289
|
+
Actions.prototype.selectCheckbox = function (control, expectedCheckboxValue) {
|
|
290
|
+
if (expectedCheckboxValue === void 0) { expectedCheckboxValue = true; }
|
|
291
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
292
292
|
return __generator(this, function (_a) {
|
|
293
293
|
switch (_a.label) {
|
|
294
294
|
case 0: return [4 /*yield*/, this.waitTillElementIsPresent(control)];
|
|
@@ -824,9 +824,9 @@ var Actions = /** @class */ (function (_super) {
|
|
|
824
824
|
*
|
|
825
825
|
* sleep(10);
|
|
826
826
|
*/
|
|
827
|
-
Actions.prototype.sleep = function () {
|
|
828
|
-
|
|
829
|
-
|
|
827
|
+
Actions.prototype.sleep = function (timeInSeconds) {
|
|
828
|
+
if (timeInSeconds === void 0) { timeInSeconds = 5; }
|
|
829
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
830
830
|
return __generator(this, function (_a) {
|
|
831
831
|
switch (_a.label) {
|
|
832
832
|
case 0: return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, timeInSeconds * 1000); })];
|
|
@@ -24,8 +24,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g
|
|
28
|
-
return g
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
30
|
function step(op) {
|
|
31
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -118,9 +118,9 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
118
118
|
*
|
|
119
119
|
* verifyIsEnabled(loginBtn, true);
|
|
120
120
|
*/
|
|
121
|
-
Assertion.prototype.verifyIsDisplayed = function (
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
Assertion.prototype.verifyIsDisplayed = function (control, expectedIsDisplayed) {
|
|
122
|
+
if (expectedIsDisplayed === void 0) { expectedIsDisplayed = true; }
|
|
123
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
124
124
|
return __generator(this, function (_a) {
|
|
125
125
|
switch (_a.label) {
|
|
126
126
|
case 0:
|
|
@@ -158,11 +158,11 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
158
158
|
*
|
|
159
159
|
* verifyIsNotDisplayed(loginBtn, true);
|
|
160
160
|
*/
|
|
161
|
-
Assertion.prototype.verifyIsNotDisplayed = function (
|
|
162
|
-
|
|
161
|
+
Assertion.prototype.verifyIsNotDisplayed = function (control, isAlreadyHidden) {
|
|
162
|
+
if (isAlreadyHidden === void 0) { isAlreadyHidden = false; }
|
|
163
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
163
164
|
var element;
|
|
164
165
|
var _this = this;
|
|
165
|
-
if (isAlreadyHidden === void 0) { isAlreadyHidden = false; }
|
|
166
166
|
return __generator(this, function (_a) {
|
|
167
167
|
switch (_a.label) {
|
|
168
168
|
case 0:
|
|
@@ -226,9 +226,9 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
226
226
|
*
|
|
227
227
|
* verifyIsEnabled(loginBtn, true);
|
|
228
228
|
*/
|
|
229
|
-
Assertion.prototype.verifyIsEnabled = function (
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
Assertion.prototype.verifyIsEnabled = function (control, expValue) {
|
|
230
|
+
if (expValue === void 0) { expValue = true; }
|
|
231
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
232
232
|
return __generator(this, function (_a) {
|
|
233
233
|
switch (_a.label) {
|
|
234
234
|
case 0:
|
|
@@ -493,10 +493,10 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
493
493
|
});
|
|
494
494
|
});
|
|
495
495
|
};
|
|
496
|
-
Assertion.prototype.verifyListContainsMultipleValues = function (
|
|
497
|
-
|
|
496
|
+
Assertion.prototype.verifyListContainsMultipleValues = function (control, listOfValueToVerify, waitTillElementIsDisplayed) {
|
|
497
|
+
if (waitTillElementIsDisplayed === void 0) { waitTillElementIsDisplayed = true; }
|
|
498
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
498
499
|
var _this = this;
|
|
499
|
-
if (waitTillElementIsDisplayed === void 0) { waitTillElementIsDisplayed = true; }
|
|
500
500
|
return __generator(this, function (_a) {
|
|
501
501
|
switch (_a.label) {
|
|
502
502
|
case 0:
|
|
@@ -541,10 +541,10 @@ var Assertion = /** @class */ (function (_super) {
|
|
|
541
541
|
});
|
|
542
542
|
});
|
|
543
543
|
};
|
|
544
|
-
Assertion.prototype.verifyListForMultipleValues = function (
|
|
545
|
-
|
|
544
|
+
Assertion.prototype.verifyListForMultipleValues = function (control, listOfValueToVerify, waitTillElementIsDisplayed) {
|
|
545
|
+
if (waitTillElementIsDisplayed === void 0) { waitTillElementIsDisplayed = true; }
|
|
546
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
546
547
|
var list, _loop_1, i;
|
|
547
|
-
if (waitTillElementIsDisplayed === void 0) { waitTillElementIsDisplayed = true; }
|
|
548
548
|
return __generator(this, function (_a) {
|
|
549
549
|
switch (_a.label) {
|
|
550
550
|
case 0:
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g
|
|
13
|
-
return g
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -52,9 +52,9 @@ var BasePage = /** @class */ (function () {
|
|
|
52
52
|
* given environment(ExecutionSettings.json)
|
|
53
53
|
* and URL provided in AppConfigurations.json
|
|
54
54
|
*/
|
|
55
|
-
BasePage.prototype.initializeBrowser = function () {
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
BasePage.prototype.initializeBrowser = function (url) {
|
|
56
|
+
if (url === void 0) { url = configuration_core_1.Configuration.get("URL"); }
|
|
57
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
58
58
|
return __generator(this, function (_a) {
|
|
59
59
|
switch (_a.label) {
|
|
60
60
|
case 0: return [4 /*yield*/, this.page.goto(url, {
|
|
@@ -72,7 +72,7 @@ var BasePage = /** @class */ (function () {
|
|
|
72
72
|
};
|
|
73
73
|
BasePage.setTestCaseID = function (testInfo, testCaseID) {
|
|
74
74
|
if (testCaseID === void 0) { testCaseID = 0; }
|
|
75
|
-
var testId =
|
|
75
|
+
var testId = testCaseID.toString();
|
|
76
76
|
(0, logs_core_1.logTestResult)('');
|
|
77
77
|
(0, logs_core_1.logTestResult)("===== START Of Execution For TestCase ID: " + testId + " Title: '" + testInfo.title + "' ======");
|
|
78
78
|
(0, logs_core_1.logTestResult)('');
|
|
@@ -80,7 +80,7 @@ var BasePage = /** @class */ (function () {
|
|
|
80
80
|
BasePage.executionCompleted = function (testinfo) {
|
|
81
81
|
var _a;
|
|
82
82
|
(0, logs_core_1.logTestResult)('');
|
|
83
|
-
(0, logs_core_1.logTestResult)("===== END Of Execution For Test Case: '" + testinfo.
|
|
83
|
+
(0, logs_core_1.logTestResult)("===== END Of Execution For Test Case: '" + testinfo.title + "' With Test Result: '" + ((_a = testinfo.status) === null || _a === void 0 ? void 0 : _a.toUpperCase()) + "' =====");
|
|
84
84
|
(0, logs_core_1.logTestResult)('');
|
|
85
85
|
};
|
|
86
86
|
return BasePage;
|
|
@@ -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
|
package/lib/core/global.setup.js
CHANGED
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g
|
|
13
|
-
return g
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.globalSetup =
|
|
39
|
+
exports.globalSetup = void 0;
|
|
40
40
|
var promises_1 = require("node:fs/promises");
|
|
41
41
|
function globalSetup(config) {
|
|
42
42
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -57,4 +57,5 @@ function globalSetup(config) {
|
|
|
57
57
|
});
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
+
exports.globalSetup = globalSetup;
|
|
60
61
|
exports.default = globalSetup;
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g
|
|
13
|
-
return g
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.globalTearDown =
|
|
39
|
+
exports.globalTearDown = void 0;
|
|
40
40
|
var sendEmail_1 = require("./sendEmail");
|
|
41
41
|
function globalTearDown(config) {
|
|
42
42
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -53,4 +53,5 @@ function globalTearDown(config) {
|
|
|
53
53
|
});
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
+
exports.globalTearDown = globalTearDown;
|
|
56
57
|
exports.default = globalTearDown;
|
package/lib/core/logs.core.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.logAction =
|
|
4
|
-
exports.logVerification = logVerification;
|
|
5
|
-
exports.errorLog = errorLog;
|
|
6
|
-
exports.consoleLog = consoleLog;
|
|
7
|
-
exports.logTestResult = logTestResult;
|
|
3
|
+
exports.logTestResult = exports.consoleLog = exports.errorLog = exports.logVerification = exports.logAction = void 0;
|
|
8
4
|
var log4js = require('log4js');
|
|
9
5
|
var dateTimeStamp = getCurrentDateTimeWithHHMM();
|
|
10
6
|
var logFileName = './Logs/ExecutionLogs.log';
|
|
@@ -26,21 +22,26 @@ function logAction(message) {
|
|
|
26
22
|
console.log("ACTION: " + message);
|
|
27
23
|
logger.info("ACTION: " + message);
|
|
28
24
|
}
|
|
25
|
+
exports.logAction = logAction;
|
|
29
26
|
function logVerification(message) {
|
|
30
27
|
console.log(message);
|
|
31
28
|
logger.info(message);
|
|
32
29
|
}
|
|
30
|
+
exports.logVerification = logVerification;
|
|
33
31
|
function errorLog(message) {
|
|
34
32
|
console.log('ERROR: ' + message);
|
|
35
33
|
logger.error('ERROR: ' + message);
|
|
36
34
|
}
|
|
35
|
+
exports.errorLog = errorLog;
|
|
37
36
|
function consoleLog(message) {
|
|
38
37
|
console.log("INFO: " + message);
|
|
39
38
|
}
|
|
39
|
+
exports.consoleLog = consoleLog;
|
|
40
40
|
function logTestResult(message) {
|
|
41
41
|
console.log(message);
|
|
42
42
|
logger.info(message);
|
|
43
43
|
}
|
|
44
|
+
exports.logTestResult = logTestResult;
|
|
44
45
|
function getCurrentDateTimeWithHHMM() {
|
|
45
46
|
var now = new Date();
|
|
46
47
|
var year = now.getFullYear();
|
package/lib/core/sendEmail.js
CHANGED
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g
|
|
13
|
-
return g
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "playwright-ts-automationframework",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"@playwright/test": "^1.42.1",
|
|
23
23
|
"@types/node": "^20.12.2",
|
|
24
24
|
"log4js": "^6.9.1",
|
|
25
|
-
"nodemailer": "^6.9.
|
|
26
|
-
"npm": "^10.
|
|
25
|
+
"nodemailer": "^6.9.5",
|
|
26
|
+
"npm": "^10.2.5",
|
|
27
27
|
"path": "^0.12.7",
|
|
28
28
|
"playwright-ts-automationframework": "file:",
|
|
29
|
-
"typescript": "^5.
|
|
29
|
+
"typescript": "^5.3.3"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"lib/**/**"
|