@auxcode/auxta 1.3.26-beta.3 → 1.3.26-beta.5

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.
Files changed (117) hide show
  1. package/build/cjs/AuxTA.d.ts +61 -62
  2. package/build/cjs/AuxTA.js +152 -152
  3. package/build/cjs/auxta/configs/config.d.ts +54 -55
  4. package/build/cjs/auxta/configs/config.js +65 -65
  5. package/build/cjs/auxta/enums/status-of.step.d.ts +7 -8
  6. package/build/cjs/auxta/enums/status-of.step.js +11 -11
  7. package/build/cjs/auxta/helpers/response.helper.d.ts +10 -11
  8. package/build/cjs/auxta/helpers/response.helper.js +15 -15
  9. package/build/cjs/auxta/helpers/start.helper.d.ts +1 -2
  10. package/build/cjs/auxta/helpers/start.helper.js +26 -26
  11. package/build/cjs/auxta/hooks/report.hook.d.ts +14 -15
  12. package/build/cjs/auxta/hooks/report.hook.js +66 -66
  13. package/build/cjs/auxta/models/upload.model.d.ts +32 -33
  14. package/build/cjs/auxta/models/upload.model.js +75 -75
  15. package/build/cjs/auxta/services/log.service.d.ts +26 -27
  16. package/build/cjs/auxta/services/log.service.js +47 -47
  17. package/build/cjs/auxta/services/report.service.d.ts +36 -37
  18. package/build/cjs/auxta/services/report.service.js +164 -164
  19. package/build/cjs/auxta/services/runtime.service.d.ts +16 -17
  20. package/build/cjs/auxta/services/runtime.service.js +41 -41
  21. package/build/cjs/auxta/utilities/runtime.helper.d.ts +15 -16
  22. package/build/cjs/auxta/utilities/runtime.helper.js +19 -19
  23. package/build/cjs/auxta/utilities/screenshot.helper.d.ts +2 -3
  24. package/build/cjs/auxta/utilities/screenshot.helper.js +36 -36
  25. package/build/cjs/auxta/utilities/start-suite.helper.d.ts +17 -18
  26. package/build/cjs/auxta/utilities/start-suite.helper.js +31 -31
  27. package/build/cjs/macros/helpers/Aux2faAuth.d.ts +7 -8
  28. package/build/cjs/macros/helpers/Aux2faAuth.js +29 -29
  29. package/build/cjs/macros/helpers/AuxGoogleAuth.d.ts +17 -18
  30. package/build/cjs/macros/helpers/AuxGoogleAuth.js +104 -104
  31. package/build/cjs/macros/helpers/code.helper.d.ts +21 -22
  32. package/build/cjs/macros/helpers/code.helper.js +201 -201
  33. package/build/cjs/macros/helpers/emailHelper.d.ts +19 -20
  34. package/build/cjs/macros/helpers/emailHelper.js +167 -167
  35. package/build/cjs/macros/helpers/extend-default-page.d.ts +6 -7
  36. package/build/cjs/macros/helpers/extend-default-page.js +89 -89
  37. package/build/cjs/puppeteer/puppeteer.d.ts +25 -26
  38. package/build/cjs/puppeteer/puppeteer.js +203 -203
  39. package/build/esm/AuxTA.d.ts +61 -62
  40. package/build/esm/AuxTA.js +123 -123
  41. package/build/esm/auxta/configs/config.d.ts +54 -55
  42. package/build/esm/auxta/configs/config.js +60 -60
  43. package/build/esm/auxta/enums/status-of.step.d.ts +7 -8
  44. package/build/esm/auxta/enums/status-of.step.js +8 -8
  45. package/build/esm/auxta/helpers/response.helper.d.ts +10 -11
  46. package/build/esm/auxta/helpers/response.helper.js +11 -11
  47. package/build/esm/auxta/helpers/start.helper.d.ts +1 -2
  48. package/build/esm/auxta/helpers/start.helper.js +24 -24
  49. package/build/esm/auxta/hooks/report.hook.d.ts +14 -15
  50. package/build/esm/auxta/hooks/report.hook.js +58 -58
  51. package/build/esm/auxta/models/upload.model.d.ts +32 -33
  52. package/build/esm/auxta/models/upload.model.js +71 -71
  53. package/build/esm/auxta/services/log.service.d.ts +26 -27
  54. package/build/esm/auxta/services/log.service.js +43 -43
  55. package/build/esm/auxta/services/report.service.d.ts +36 -37
  56. package/build/esm/auxta/services/report.service.js +150 -150
  57. package/build/esm/auxta/services/runtime.service.d.ts +16 -17
  58. package/build/esm/auxta/services/runtime.service.js +37 -37
  59. package/build/esm/auxta/utilities/runtime.helper.d.ts +15 -16
  60. package/build/esm/auxta/utilities/runtime.helper.js +15 -15
  61. package/build/esm/auxta/utilities/screenshot.helper.d.ts +2 -3
  62. package/build/esm/auxta/utilities/screenshot.helper.js +29 -29
  63. package/build/esm/auxta/utilities/start-suite.helper.d.ts +17 -18
  64. package/build/esm/auxta/utilities/start-suite.helper.js +26 -26
  65. package/build/esm/macros/helpers/Aux2faAuth.d.ts +7 -8
  66. package/build/esm/macros/helpers/Aux2faAuth.js +25 -25
  67. package/build/esm/macros/helpers/AuxGoogleAuth.d.ts +17 -18
  68. package/build/esm/macros/helpers/AuxGoogleAuth.js +100 -100
  69. package/build/esm/macros/helpers/code.helper.d.ts +21 -22
  70. package/build/esm/macros/helpers/code.helper.js +194 -194
  71. package/build/esm/macros/helpers/emailHelper.d.ts +19 -20
  72. package/build/esm/macros/helpers/emailHelper.js +160 -160
  73. package/build/esm/macros/helpers/extend-default-page.d.ts +6 -7
  74. package/build/esm/macros/helpers/extend-default-page.js +82 -82
  75. package/build/esm/puppeteer/puppeteer.d.ts +25 -26
  76. package/build/esm/puppeteer/puppeteer.js +195 -195
  77. package/build/tsconfig-cjs.tsbuildinfo +1 -1
  78. package/build/tsconfig.tsbuildinfo +1 -1
  79. package/package.json +2 -2
  80. package/build/cjs/AuxTA.d.ts.map +0 -1
  81. package/build/cjs/auxta/configs/config.d.ts.map +0 -1
  82. package/build/cjs/auxta/enums/status-of.step.d.ts.map +0 -1
  83. package/build/cjs/auxta/helpers/response.helper.d.ts.map +0 -1
  84. package/build/cjs/auxta/helpers/start.helper.d.ts.map +0 -1
  85. package/build/cjs/auxta/hooks/report.hook.d.ts.map +0 -1
  86. package/build/cjs/auxta/models/upload.model.d.ts.map +0 -1
  87. package/build/cjs/auxta/services/log.service.d.ts.map +0 -1
  88. package/build/cjs/auxta/services/report.service.d.ts.map +0 -1
  89. package/build/cjs/auxta/services/runtime.service.d.ts.map +0 -1
  90. package/build/cjs/auxta/utilities/runtime.helper.d.ts.map +0 -1
  91. package/build/cjs/auxta/utilities/screenshot.helper.d.ts.map +0 -1
  92. package/build/cjs/auxta/utilities/start-suite.helper.d.ts.map +0 -1
  93. package/build/cjs/macros/helpers/Aux2faAuth.d.ts.map +0 -1
  94. package/build/cjs/macros/helpers/AuxGoogleAuth.d.ts.map +0 -1
  95. package/build/cjs/macros/helpers/code.helper.d.ts.map +0 -1
  96. package/build/cjs/macros/helpers/emailHelper.d.ts.map +0 -1
  97. package/build/cjs/macros/helpers/extend-default-page.d.ts.map +0 -1
  98. package/build/cjs/puppeteer/puppeteer.d.ts.map +0 -1
  99. package/build/esm/AuxTA.d.ts.map +0 -1
  100. package/build/esm/auxta/configs/config.d.ts.map +0 -1
  101. package/build/esm/auxta/enums/status-of.step.d.ts.map +0 -1
  102. package/build/esm/auxta/helpers/response.helper.d.ts.map +0 -1
  103. package/build/esm/auxta/helpers/start.helper.d.ts.map +0 -1
  104. package/build/esm/auxta/hooks/report.hook.d.ts.map +0 -1
  105. package/build/esm/auxta/models/upload.model.d.ts.map +0 -1
  106. package/build/esm/auxta/services/log.service.d.ts.map +0 -1
  107. package/build/esm/auxta/services/report.service.d.ts.map +0 -1
  108. package/build/esm/auxta/services/runtime.service.d.ts.map +0 -1
  109. package/build/esm/auxta/utilities/runtime.helper.d.ts.map +0 -1
  110. package/build/esm/auxta/utilities/screenshot.helper.d.ts.map +0 -1
  111. package/build/esm/auxta/utilities/start-suite.helper.d.ts.map +0 -1
  112. package/build/esm/macros/helpers/Aux2faAuth.d.ts.map +0 -1
  113. package/build/esm/macros/helpers/AuxGoogleAuth.d.ts.map +0 -1
  114. package/build/esm/macros/helpers/code.helper.d.ts.map +0 -1
  115. package/build/esm/macros/helpers/emailHelper.d.ts.map +0 -1
  116. package/build/esm/macros/helpers/extend-default-page.d.ts.map +0 -1
  117. package/build/esm/puppeteer/puppeteer.d.ts.map +0 -1
@@ -1,164 +1,164 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.postNotificationsOnFail = exports.postNotifications = exports.getLastDayResults = exports.getReport = exports.updateReport = exports.uploadFeature = exports.uploadScenario = exports.createEmptyReport = void 0;
16
- const axios_1 = __importDefault(require("axios"));
17
- const config_1 = require("../configs/config");
18
- function headers(token) {
19
- return {
20
- headers: {
21
- 'Content-Type': 'application/json',
22
- 'cookie': `authToken=${token}`
23
- }
24
- };
25
- }
26
- function auth() {
27
- return __awaiter(this, void 0, void 0, function* () {
28
- return axios_1.default.post(config_1.config.auxtaURL + 'login', config_1.config.auxtaCredentials, {
29
- headers: {
30
- 'Content-Type': 'application/json',
31
- }
32
- })
33
- .then(({ data }) => {
34
- return data.token;
35
- })
36
- .catch(() => {
37
- throw new Error("Invalid login credentials");
38
- });
39
- });
40
- }
41
- function createEmptyReport(body) {
42
- return __awaiter(this, void 0, void 0, function* () {
43
- const token = yield auth();
44
- return (yield axios_1.default.post(config_1.config.auxtaURL + "create-empty-report", {
45
- environment: body.environment,
46
- digitalProductName: body.digitalProduct,
47
- start: new Date(),
48
- url: body.baseUrl
49
- }, headers(token))).data.reportId;
50
- });
51
- }
52
- exports.createEmptyReport = createEmptyReport;
53
- function uploadScenario(stepLog, scenarioName, screenshot, errMessage) {
54
- return __awaiter(this, void 0, void 0, function* () {
55
- let scenarios = [];
56
- let token = yield auth();
57
- let lastStep = stepLog[stepLog.length - 1];
58
- const stepLogFormat = JSON.parse(JSON.stringify(stepLog));
59
- stepLogFormat.pop();
60
- let output = (yield axios_1.default.post(config_1.config.auxtaURL + "create-scenario", {
61
- json: {
62
- name: scenarioName,
63
- steps: [
64
- ...stepLogFormat,
65
- (lastStep.result.status == 'failed')
66
- ? Object.assign(lastStep, {
67
- result: Object.assign(Object.assign({}, lastStep.result), { error_message: JSON.stringify(errMessage) })
68
- })
69
- : lastStep,
70
- {
71
- keyword: "After",
72
- result: {
73
- status: "passed",
74
- duration: 2678000000
75
- },
76
- embeddings: (screenshot) ? [{
77
- data: screenshot.toString("base64"),
78
- mime_type: "image/png"
79
- }] : undefined,
80
- }
81
- ],
82
- }
83
- }, headers(token))).data.scenarios;
84
- scenarios.push({
85
- scenarioRef: output.scenarioRef,
86
- name: output.name,
87
- status: output.status,
88
- stepsCount: output.stepsCount
89
- });
90
- return scenarios;
91
- });
92
- }
93
- exports.uploadScenario = uploadScenario;
94
- function uploadFeature(scenarioId, scenarioName, uri, hasFailed) {
95
- return __awaiter(this, void 0, void 0, function* () {
96
- let token = yield auth();
97
- return (yield axios_1.default.post(config_1.config.auxtaURL + "create-feature", {
98
- json: {
99
- name: scenarioName,
100
- uri: uri
101
- },
102
- scenarios: scenarioId,
103
- hasFailed: hasFailed
104
- }, headers(token))).data;
105
- });
106
- }
107
- exports.uploadFeature = uploadFeature;
108
- function updateReport(reportId, feature, steps, isFinal) {
109
- return __awaiter(this, void 0, void 0, function* () {
110
- let token = yield auth();
111
- yield axios_1.default.post(config_1.config.auxtaURL + "update-inprogress-report", {
112
- reportId: reportId,
113
- isFinal: isFinal,
114
- data: Object.assign({ feature: {
115
- featureRef: feature.featureId,
116
- name: feature.featureName,
117
- uri: feature.featureUri,
118
- status: feature.status,
119
- scenariosCount: feature.scenariosCount
120
- } }, steps)
121
- }, headers(token));
122
- });
123
- }
124
- exports.updateReport = updateReport;
125
- function getReport(reportId) {
126
- return __awaiter(this, void 0, void 0, function* () {
127
- let token = yield auth();
128
- return (yield axios_1.default.post(config_1.config.auxtaURL + "get-report", { reportId: reportId }, headers(token))).data;
129
- });
130
- }
131
- exports.getReport = getReport;
132
- function getLastDayResults() {
133
- return __awaiter(this, void 0, void 0, function* () {
134
- let token = yield auth();
135
- return (yield axios_1.default.get(config_1.config.auxtaURL + `get-last-day-results?url=${config_1.config.baseURL}`, headers(token))).data.results;
136
- });
137
- }
138
- exports.getLastDayResults = getLastDayResults;
139
- function postNotifications(body) {
140
- return __awaiter(this, void 0, void 0, function* () {
141
- let token = yield auth();
142
- yield axios_1.default.post(`${config_1.config.auxtaURL}post-notification-after-run-background`, {
143
- environmentName: body.environment,
144
- digitalProductName: body.digitalProduct,
145
- organizationName: body.organization,
146
- reportId: body.reportId,
147
- }, headers(token));
148
- });
149
- }
150
- exports.postNotifications = postNotifications;
151
- function postNotificationsOnFail(body) {
152
- return __awaiter(this, void 0, void 0, function* () {
153
- let token = yield auth();
154
- yield axios_1.default.post(`${config_1.config.auxtaURL}post-notifications-after-case-fail-background`, {
155
- environmentName: body.environment,
156
- digitalProductName: body.digitalProduct,
157
- organizationName: body.organization,
158
- reportId: body.reportId,
159
- featureName: body.featureName,
160
- scenarioName: body.scenarioName
161
- }, headers(token));
162
- });
163
- }
164
- exports.postNotificationsOnFail = postNotificationsOnFail;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.postNotificationsOnFail = exports.postNotifications = exports.getLastDayResults = exports.getReport = exports.updateReport = exports.uploadFeature = exports.uploadScenario = exports.createEmptyReport = void 0;
16
+ const axios_1 = __importDefault(require("axios"));
17
+ const config_1 = require("../configs/config");
18
+ function headers(token) {
19
+ return {
20
+ headers: {
21
+ 'Content-Type': 'application/json',
22
+ 'cookie': `authToken=${token}`
23
+ }
24
+ };
25
+ }
26
+ function auth() {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ return axios_1.default.post(config_1.config.auxtaURL + 'login', config_1.config.auxtaCredentials, {
29
+ headers: {
30
+ 'Content-Type': 'application/json',
31
+ }
32
+ })
33
+ .then(({ data }) => {
34
+ return data.token;
35
+ })
36
+ .catch(() => {
37
+ throw new Error("Invalid login credentials");
38
+ });
39
+ });
40
+ }
41
+ function createEmptyReport(body) {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ const token = yield auth();
44
+ return (yield axios_1.default.post(config_1.config.auxtaURL + "create-empty-report", {
45
+ environment: body.environment,
46
+ digitalProductName: body.digitalProduct,
47
+ start: new Date(),
48
+ url: body.baseUrl
49
+ }, headers(token))).data.reportId;
50
+ });
51
+ }
52
+ exports.createEmptyReport = createEmptyReport;
53
+ function uploadScenario(stepLog, scenarioName, screenshot, errMessage) {
54
+ return __awaiter(this, void 0, void 0, function* () {
55
+ let scenarios = [];
56
+ let token = yield auth();
57
+ let lastStep = stepLog[stepLog.length - 1];
58
+ const stepLogFormat = JSON.parse(JSON.stringify(stepLog));
59
+ stepLogFormat.pop();
60
+ let output = (yield axios_1.default.post(config_1.config.auxtaURL + "create-scenario", {
61
+ json: {
62
+ name: scenarioName,
63
+ steps: [
64
+ ...stepLogFormat,
65
+ (lastStep.result.status == 'failed')
66
+ ? Object.assign(lastStep, {
67
+ result: Object.assign(Object.assign({}, lastStep.result), { error_message: JSON.stringify(errMessage) })
68
+ })
69
+ : lastStep,
70
+ {
71
+ keyword: "After",
72
+ result: {
73
+ status: "passed",
74
+ duration: 2678000000
75
+ },
76
+ embeddings: (screenshot) ? [{
77
+ data: screenshot.toString("base64"),
78
+ mime_type: "image/png"
79
+ }] : undefined,
80
+ }
81
+ ],
82
+ }
83
+ }, headers(token))).data.scenarios;
84
+ scenarios.push({
85
+ scenarioRef: output.scenarioRef,
86
+ name: output.name,
87
+ status: output.status,
88
+ stepsCount: output.stepsCount
89
+ });
90
+ return scenarios;
91
+ });
92
+ }
93
+ exports.uploadScenario = uploadScenario;
94
+ function uploadFeature(scenarioId, scenarioName, uri, hasFailed) {
95
+ return __awaiter(this, void 0, void 0, function* () {
96
+ let token = yield auth();
97
+ return (yield axios_1.default.post(config_1.config.auxtaURL + "create-feature", {
98
+ json: {
99
+ name: scenarioName,
100
+ uri: uri
101
+ },
102
+ scenarios: scenarioId,
103
+ hasFailed: hasFailed
104
+ }, headers(token))).data;
105
+ });
106
+ }
107
+ exports.uploadFeature = uploadFeature;
108
+ function updateReport(reportId, feature, steps, isFinal) {
109
+ return __awaiter(this, void 0, void 0, function* () {
110
+ let token = yield auth();
111
+ yield axios_1.default.post(config_1.config.auxtaURL + "update-inprogress-report", {
112
+ reportId: reportId,
113
+ isFinal: isFinal,
114
+ data: Object.assign({ feature: {
115
+ featureRef: feature.featureId,
116
+ name: feature.featureName,
117
+ uri: feature.featureUri,
118
+ status: feature.status,
119
+ scenariosCount: feature.scenariosCount
120
+ } }, steps)
121
+ }, headers(token));
122
+ });
123
+ }
124
+ exports.updateReport = updateReport;
125
+ function getReport(reportId) {
126
+ return __awaiter(this, void 0, void 0, function* () {
127
+ let token = yield auth();
128
+ return (yield axios_1.default.post(config_1.config.auxtaURL + "get-report", { reportId: reportId }, headers(token))).data;
129
+ });
130
+ }
131
+ exports.getReport = getReport;
132
+ function getLastDayResults() {
133
+ return __awaiter(this, void 0, void 0, function* () {
134
+ let token = yield auth();
135
+ return (yield axios_1.default.get(config_1.config.auxtaURL + `get-last-day-results?url=${config_1.config.baseURL}`, headers(token))).data.results;
136
+ });
137
+ }
138
+ exports.getLastDayResults = getLastDayResults;
139
+ function postNotifications(body) {
140
+ return __awaiter(this, void 0, void 0, function* () {
141
+ let token = yield auth();
142
+ yield axios_1.default.post(`${config_1.config.auxtaURL}post-notification-after-run-background`, {
143
+ environmentName: body.environment,
144
+ digitalProductName: body.digitalProduct,
145
+ organizationName: body.organization,
146
+ reportId: body.reportId,
147
+ }, headers(token));
148
+ });
149
+ }
150
+ exports.postNotifications = postNotifications;
151
+ function postNotificationsOnFail(body) {
152
+ return __awaiter(this, void 0, void 0, function* () {
153
+ let token = yield auth();
154
+ yield axios_1.default.post(`${config_1.config.auxtaURL}post-notifications-after-case-fail-background`, {
155
+ environmentName: body.environment,
156
+ digitalProductName: body.digitalProduct,
157
+ organizationName: body.organization,
158
+ reportId: body.reportId,
159
+ featureName: body.featureName,
160
+ scenarioName: body.scenarioName
161
+ }, headers(token));
162
+ });
163
+ }
164
+ exports.postNotificationsOnFail = postNotificationsOnFail;
@@ -1,17 +1,16 @@
1
- export interface RunTime {
2
- duration: String;
3
- startTime: Date;
4
- endTime: Date;
5
- }
6
- export declare class Runtime {
7
- private start;
8
- private end;
9
- private runtime;
10
- constructor(s: Date, e: Date);
11
- private calculateDuration;
12
- private splitAtDecimanlMinutes;
13
- private splitAtDecimanlHours;
14
- private formatRuntime;
15
- returnRuntime(): RunTime;
16
- }
17
- //# sourceMappingURL=runtime.service.d.ts.map
1
+ export interface RunTime {
2
+ duration: String;
3
+ startTime: Date;
4
+ endTime: Date;
5
+ }
6
+ export declare class Runtime {
7
+ private start;
8
+ private end;
9
+ private runtime;
10
+ constructor(s: Date, e: Date);
11
+ private calculateDuration;
12
+ private splitAtDecimanlMinutes;
13
+ private splitAtDecimanlHours;
14
+ private formatRuntime;
15
+ returnRuntime(): RunTime;
16
+ }
@@ -1,41 +1,41 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Runtime = void 0;
4
- class Runtime {
5
- constructor(s, e) {
6
- this.start = s;
7
- this.end = e;
8
- }
9
- calculateDuration() {
10
- let currentTime = new Date;
11
- let duration = currentTime.getTime() - this.start.getTime();
12
- return duration;
13
- }
14
- splitAtDecimanlMinutes(time) {
15
- let minutes = time.toFixed(2).toString().split('.');
16
- return `${minutes[0]}m ${(Number(minutes[1]) / 100 * 60).toFixed(0)}s`;
17
- }
18
- splitAtDecimanlHours(time) {
19
- let hours = time.toFixed(2).toString().split('.');
20
- let minutes = (Number(hours[1]) / 100 * 60).toFixed(2).toString().split('.');
21
- return `${hours[0]}h ${minutes[0]}m ${(Number(minutes[1]) / 100 * 60).toFixed(0)}s`;
22
- }
23
- formatRuntime(duration) {
24
- if (duration / 1000 < 60)
25
- return `${(duration / 1000).toFixed(0)}s`;
26
- else {
27
- if (duration / 60000 < 60)
28
- return this.splitAtDecimanlMinutes(duration / 60000);
29
- else
30
- return this.splitAtDecimanlHours(duration / 3600000);
31
- }
32
- }
33
- returnRuntime() {
34
- let duration = this.formatRuntime(this.calculateDuration());
35
- let startTime = this.start;
36
- let endTime = this.end;
37
- this.runtime = { duration, startTime, endTime };
38
- return this.runtime;
39
- }
40
- }
41
- exports.Runtime = Runtime;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Runtime = void 0;
4
+ class Runtime {
5
+ constructor(s, e) {
6
+ this.start = s;
7
+ this.end = e;
8
+ }
9
+ calculateDuration() {
10
+ let currentTime = new Date;
11
+ let duration = currentTime.getTime() - this.start.getTime();
12
+ return duration;
13
+ }
14
+ splitAtDecimanlMinutes(time) {
15
+ let minutes = time.toFixed(2).toString().split('.');
16
+ return `${minutes[0]}m ${(Number(minutes[1]) / 100 * 60).toFixed(0)}s`;
17
+ }
18
+ splitAtDecimanlHours(time) {
19
+ let hours = time.toFixed(2).toString().split('.');
20
+ let minutes = (Number(hours[1]) / 100 * 60).toFixed(2).toString().split('.');
21
+ return `${hours[0]}h ${minutes[0]}m ${(Number(minutes[1]) / 100 * 60).toFixed(0)}s`;
22
+ }
23
+ formatRuntime(duration) {
24
+ if (duration / 1000 < 60)
25
+ return `${(duration / 1000).toFixed(0)}s`;
26
+ else {
27
+ if (duration / 60000 < 60)
28
+ return this.splitAtDecimanlMinutes(duration / 60000);
29
+ else
30
+ return this.splitAtDecimanlHours(duration / 3600000);
31
+ }
32
+ }
33
+ returnRuntime() {
34
+ let duration = this.formatRuntime(this.calculateDuration());
35
+ let startTime = this.start;
36
+ let endTime = this.end;
37
+ this.runtime = { duration, startTime, endTime };
38
+ return this.runtime;
39
+ }
40
+ }
41
+ exports.Runtime = Runtime;
@@ -1,16 +1,15 @@
1
- import { RunTime } from "../services/runtime.service";
2
- export declare class CalculateRuntime {
3
- private runtime;
4
- startTimeSeconds: string;
5
- startTimeMinutes: string;
6
- startTimeHours: string;
7
- startTimeDay: string;
8
- startTimeMonth: string;
9
- endTimeSeconds: string;
10
- endTimeMinutes: string;
11
- endTimeHours: string;
12
- endTimeDay: string;
13
- endTimeMonth: string;
14
- constructor(r: RunTime);
15
- }
16
- //# sourceMappingURL=runtime.helper.d.ts.map
1
+ import { RunTime } from "../services/runtime.service";
2
+ export declare class CalculateRuntime {
3
+ private runtime;
4
+ startTimeSeconds: string;
5
+ startTimeMinutes: string;
6
+ startTimeHours: string;
7
+ startTimeDay: string;
8
+ startTimeMonth: string;
9
+ endTimeSeconds: string;
10
+ endTimeMinutes: string;
11
+ endTimeHours: string;
12
+ endTimeDay: string;
13
+ endTimeMonth: string;
14
+ constructor(r: RunTime);
15
+ }
@@ -1,19 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CalculateRuntime = void 0;
4
- class CalculateRuntime {
5
- constructor(r) {
6
- this.runtime = r;
7
- this.startTimeSeconds = (this.runtime.startTime.getSeconds() < 10) ? `0${this.runtime.startTime.getSeconds()}` : `${this.runtime.startTime.getSeconds()}`;
8
- this.startTimeMinutes = (this.runtime.startTime.getMinutes() < 10) ? `0${this.runtime.startTime.getMinutes()}` : `${this.runtime.startTime.getMinutes()}`;
9
- this.startTimeHours = (this.runtime.startTime.getHours() < 10) ? `0${this.runtime.startTime.getHours()}` : `${this.runtime.startTime.getHours()}`;
10
- this.startTimeDay = (this.runtime.startTime.getDate() < 10) ? `0${this.runtime.startTime.getDate()}` : `${this.runtime.startTime.getDate()}`;
11
- this.startTimeMonth = (this.runtime.startTime.getMonth() + 1 < 10) ? `0${this.runtime.startTime.getMonth() + 1}` : `${this.runtime.startTime.getMonth() + 1}`;
12
- this.endTimeSeconds = (this.runtime.endTime.getSeconds() < 10) ? `0${this.runtime.endTime.getSeconds()}` : `${this.runtime.endTime.getSeconds()}`;
13
- this.endTimeMinutes = (this.runtime.endTime.getMinutes() < 10) ? `0${this.runtime.endTime.getMinutes()}` : `${this.runtime.endTime.getMinutes()}`;
14
- this.endTimeHours = (this.runtime.endTime.getHours() < 10) ? `0${this.runtime.endTime.getHours()}` : `${this.runtime.endTime.getHours()}`;
15
- this.endTimeDay = (this.runtime.endTime.getDate() < 10) ? `0${this.runtime.endTime.getDate()}` : `${this.runtime.endTime.getDate()}`;
16
- this.endTimeMonth = (this.runtime.endTime.getMonth() + 1 < 10) ? `0${this.runtime.endTime.getMonth() + 1}` : `${this.runtime.endTime.getMonth() + 1}`;
17
- }
18
- }
19
- exports.CalculateRuntime = CalculateRuntime;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CalculateRuntime = void 0;
4
+ class CalculateRuntime {
5
+ constructor(r) {
6
+ this.runtime = r;
7
+ this.startTimeSeconds = (this.runtime.startTime.getSeconds() < 10) ? `0${this.runtime.startTime.getSeconds()}` : `${this.runtime.startTime.getSeconds()}`;
8
+ this.startTimeMinutes = (this.runtime.startTime.getMinutes() < 10) ? `0${this.runtime.startTime.getMinutes()}` : `${this.runtime.startTime.getMinutes()}`;
9
+ this.startTimeHours = (this.runtime.startTime.getHours() < 10) ? `0${this.runtime.startTime.getHours()}` : `${this.runtime.startTime.getHours()}`;
10
+ this.startTimeDay = (this.runtime.startTime.getDate() < 10) ? `0${this.runtime.startTime.getDate()}` : `${this.runtime.startTime.getDate()}`;
11
+ this.startTimeMonth = (this.runtime.startTime.getMonth() + 1 < 10) ? `0${this.runtime.startTime.getMonth() + 1}` : `${this.runtime.startTime.getMonth() + 1}`;
12
+ this.endTimeSeconds = (this.runtime.endTime.getSeconds() < 10) ? `0${this.runtime.endTime.getSeconds()}` : `${this.runtime.endTime.getSeconds()}`;
13
+ this.endTimeMinutes = (this.runtime.endTime.getMinutes() < 10) ? `0${this.runtime.endTime.getMinutes()}` : `${this.runtime.endTime.getMinutes()}`;
14
+ this.endTimeHours = (this.runtime.endTime.getHours() < 10) ? `0${this.runtime.endTime.getHours()}` : `${this.runtime.endTime.getHours()}`;
15
+ this.endTimeDay = (this.runtime.endTime.getDate() < 10) ? `0${this.runtime.endTime.getDate()}` : `${this.runtime.endTime.getDate()}`;
16
+ this.endTimeMonth = (this.runtime.endTime.getMonth() + 1 < 10) ? `0${this.runtime.endTime.getMonth() + 1}` : `${this.runtime.endTime.getMonth() + 1}`;
17
+ }
18
+ }
19
+ exports.CalculateRuntime = CalculateRuntime;
@@ -1,3 +1,2 @@
1
- /// <reference types="node" />
2
- export declare function captureScreenshot(): Promise<Buffer | undefined>;
3
- //# sourceMappingURL=screenshot.helper.d.ts.map
1
+ /// <reference types="node" />
2
+ export declare function captureScreenshot(): Promise<Buffer | undefined>;
@@ -1,36 +1,36 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.captureScreenshot = void 0;
16
- const puppeteer_1 = __importDefault(require("../../puppeteer/puppeteer"));
17
- function captureScreenshot() {
18
- return __awaiter(this, void 0, void 0, function* () {
19
- try {
20
- const pages = yield puppeteer_1.default.defaultPage.browser().pages();
21
- if (!pages.length)
22
- return undefined;
23
- const lastPage = pages[pages.length - 1] || puppeteer_1.default.defaultPage;
24
- const screenshotBuffer = yield lastPage.screenshot({
25
- fullPage: true,
26
- encoding: 'binary'
27
- });
28
- if (Buffer.isBuffer(screenshotBuffer))
29
- return screenshotBuffer;
30
- }
31
- catch (e) {
32
- }
33
- return undefined;
34
- });
35
- }
36
- exports.captureScreenshot = captureScreenshot;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.captureScreenshot = void 0;
16
+ const puppeteer_1 = __importDefault(require("../../puppeteer/puppeteer"));
17
+ function captureScreenshot() {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ try {
20
+ const pages = yield puppeteer_1.default.defaultPage.browser().pages();
21
+ if (!pages.length)
22
+ return undefined;
23
+ const lastPage = pages[pages.length - 1] || puppeteer_1.default.defaultPage;
24
+ const screenshotBuffer = yield lastPage.screenshot({
25
+ fullPage: true,
26
+ encoding: 'binary'
27
+ });
28
+ if (Buffer.isBuffer(screenshotBuffer))
29
+ return screenshotBuffer;
30
+ }
31
+ catch (e) {
32
+ }
33
+ return undefined;
34
+ });
35
+ }
36
+ exports.captureScreenshot = captureScreenshot;
@@ -1,18 +1,17 @@
1
- export declare function startSuite(suites: string[], reportId?: string): Promise<{
2
- nextSuites?: undefined;
3
- reportId?: undefined;
4
- currentSuite?: undefined;
5
- retries?: undefined;
6
- } | {
7
- nextSuites: string[];
8
- reportId: string | undefined;
9
- currentSuite: string | undefined;
10
- retries: string;
11
- }>;
12
- export declare function retrySuite(suites: string[], reportId: string, currentSuite: string, retries: number): Promise<false | {
13
- nextSuites: string[];
14
- reportId: string;
15
- currentSuite: string;
16
- retries: number;
17
- }>;
18
- //# sourceMappingURL=start-suite.helper.d.ts.map
1
+ export declare function startSuite(suites: string[], reportId?: string): Promise<{
2
+ nextSuites?: undefined;
3
+ reportId?: undefined;
4
+ currentSuite?: undefined;
5
+ retries?: undefined;
6
+ } | {
7
+ nextSuites: string[];
8
+ reportId: string | undefined;
9
+ currentSuite: string | undefined;
10
+ retries: string;
11
+ }>;
12
+ export declare function retrySuite(suites: string[], reportId: string, currentSuite: string, retries: number): Promise<false | {
13
+ nextSuites: string[];
14
+ reportId: string;
15
+ currentSuite: string;
16
+ retries: number;
17
+ }>;