@auxcode/auxta 1.3.39 → 1.3.40-beta.0

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 (79) hide show
  1. package/build/cjs/AuxTA.d.ts +62 -62
  2. package/build/cjs/AuxTA.js +154 -154
  3. package/build/cjs/auxta/configs/config.d.ts +57 -57
  4. package/build/cjs/auxta/configs/config.js +69 -69
  5. package/build/cjs/auxta/enums/status-of.step.d.ts +7 -7
  6. package/build/cjs/auxta/enums/status-of.step.js +11 -11
  7. package/build/cjs/auxta/helpers/response.helper.d.ts +10 -10
  8. package/build/cjs/auxta/helpers/response.helper.js +15 -15
  9. package/build/cjs/auxta/helpers/start.helper.d.ts +1 -1
  10. package/build/cjs/auxta/helpers/start.helper.js +26 -26
  11. package/build/cjs/auxta/hooks/report.hook.d.ts +14 -14
  12. package/build/cjs/auxta/hooks/report.hook.js +66 -66
  13. package/build/cjs/auxta/models/upload.model.d.ts +35 -35
  14. package/build/cjs/auxta/models/upload.model.js +82 -82
  15. package/build/cjs/auxta/services/log.service.d.ts +26 -26
  16. package/build/cjs/auxta/services/log.service.js +47 -47
  17. package/build/cjs/auxta/services/report.service.d.ts +36 -36
  18. package/build/cjs/auxta/services/report.service.js +167 -167
  19. package/build/cjs/auxta/services/runtime.service.d.ts +16 -16
  20. package/build/cjs/auxta/services/runtime.service.js +41 -41
  21. package/build/cjs/auxta/utilities/runtime.helper.d.ts +15 -15
  22. package/build/cjs/auxta/utilities/runtime.helper.js +19 -19
  23. package/build/cjs/auxta/utilities/screenshot.helper.d.ts +2 -2
  24. package/build/cjs/auxta/utilities/screenshot.helper.js +40 -40
  25. package/build/cjs/auxta/utilities/start-suite.helper.d.ts +17 -17
  26. package/build/cjs/auxta/utilities/start-suite.helper.js +31 -31
  27. package/build/cjs/macros/helpers/Aux2faAuth.d.ts +7 -7
  28. package/build/cjs/macros/helpers/Aux2faAuth.js +29 -29
  29. package/build/cjs/macros/helpers/AuxGoogleAuth.d.ts +17 -17
  30. package/build/cjs/macros/helpers/AuxGoogleAuth.js +104 -104
  31. package/build/cjs/macros/helpers/code.helper.d.ts +21 -21
  32. package/build/cjs/macros/helpers/code.helper.js +201 -201
  33. package/build/cjs/macros/helpers/emailHelper.d.ts +19 -19
  34. package/build/cjs/macros/helpers/emailHelper.js +177 -177
  35. package/build/cjs/macros/helpers/extend-default-page.d.ts +6 -6
  36. package/build/cjs/macros/helpers/extend-default-page.js +89 -89
  37. package/build/cjs/puppeteer/puppeteer.d.ts +25 -25
  38. package/build/cjs/puppeteer/puppeteer.js +209 -209
  39. package/build/esm/AuxTA.d.ts +62 -62
  40. package/build/esm/AuxTA.js +125 -125
  41. package/build/esm/auxta/configs/config.d.ts +57 -57
  42. package/build/esm/auxta/configs/config.js +64 -64
  43. package/build/esm/auxta/enums/status-of.step.d.ts +7 -7
  44. package/build/esm/auxta/enums/status-of.step.js +8 -8
  45. package/build/esm/auxta/helpers/response.helper.d.ts +10 -10
  46. package/build/esm/auxta/helpers/response.helper.js +11 -11
  47. package/build/esm/auxta/helpers/start.helper.d.ts +1 -1
  48. package/build/esm/auxta/helpers/start.helper.js +24 -24
  49. package/build/esm/auxta/hooks/report.hook.d.ts +14 -14
  50. package/build/esm/auxta/hooks/report.hook.js +58 -58
  51. package/build/esm/auxta/models/upload.model.d.ts +35 -35
  52. package/build/esm/auxta/models/upload.model.js +78 -78
  53. package/build/esm/auxta/services/log.service.d.ts +26 -26
  54. package/build/esm/auxta/services/log.service.js +43 -43
  55. package/build/esm/auxta/services/report.service.d.ts +36 -36
  56. package/build/esm/auxta/services/report.service.js +153 -153
  57. package/build/esm/auxta/services/runtime.service.d.ts +16 -16
  58. package/build/esm/auxta/services/runtime.service.js +37 -37
  59. package/build/esm/auxta/utilities/runtime.helper.d.ts +15 -15
  60. package/build/esm/auxta/utilities/runtime.helper.js +15 -15
  61. package/build/esm/auxta/utilities/screenshot.helper.d.ts +2 -2
  62. package/build/esm/auxta/utilities/screenshot.helper.js +33 -33
  63. package/build/esm/auxta/utilities/start-suite.helper.d.ts +17 -17
  64. package/build/esm/auxta/utilities/start-suite.helper.js +26 -26
  65. package/build/esm/macros/helpers/Aux2faAuth.d.ts +7 -7
  66. package/build/esm/macros/helpers/Aux2faAuth.js +25 -25
  67. package/build/esm/macros/helpers/AuxGoogleAuth.d.ts +17 -17
  68. package/build/esm/macros/helpers/AuxGoogleAuth.js +100 -100
  69. package/build/esm/macros/helpers/code.helper.d.ts +21 -21
  70. package/build/esm/macros/helpers/code.helper.js +194 -194
  71. package/build/esm/macros/helpers/emailHelper.d.ts +19 -19
  72. package/build/esm/macros/helpers/emailHelper.js +170 -170
  73. package/build/esm/macros/helpers/extend-default-page.d.ts +6 -6
  74. package/build/esm/macros/helpers/extend-default-page.js +82 -82
  75. package/build/esm/puppeteer/puppeteer.d.ts +25 -25
  76. package/build/esm/puppeteer/puppeteer.js +201 -201
  77. package/build/tsconfig-cjs.tsbuildinfo +1 -1
  78. package/build/tsconfig.tsbuildinfo +1 -1
  79. package/package.json +3 -3
@@ -1,167 +1,167 @@
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
- digitalProductToken: body.digitalProduct,
47
- bucket: body.bucket,
48
- start: new Date(),
49
- url: body.baseUrl
50
- }, headers(token))).data.reportId;
51
- });
52
- }
53
- exports.createEmptyReport = createEmptyReport;
54
- function uploadScenario(stepLog, scenarioName, screenshot, errMessage) {
55
- return __awaiter(this, void 0, void 0, function* () {
56
- let scenarios = [];
57
- let token = yield auth();
58
- let lastStep = stepLog[stepLog.length - 1];
59
- const stepLogFormat = JSON.parse(JSON.stringify(stepLog));
60
- stepLogFormat.pop();
61
- let output = (yield axios_1.default.post(config_1.config.auxtaURL + "create-scenario", {
62
- json: {
63
- name: scenarioName,
64
- steps: [
65
- ...stepLogFormat,
66
- (lastStep.result.status == 'failed')
67
- ? Object.assign(lastStep, {
68
- result: Object.assign(Object.assign({}, lastStep.result), { error_message: JSON.stringify(errMessage) })
69
- })
70
- : lastStep,
71
- {
72
- keyword: "After",
73
- result: {
74
- status: "passed",
75
- duration: 2678000000
76
- },
77
- embeddings: (screenshot) ? [{
78
- data: screenshot.toString("base64"),
79
- mime_type: "image/png"
80
- }] : undefined,
81
- }
82
- ],
83
- }
84
- }, headers(token))).data.scenarios;
85
- scenarios.push({
86
- scenarioRef: output.scenarioRef,
87
- name: output.name,
88
- status: output.status,
89
- stepsCount: output.stepsCount
90
- });
91
- return scenarios;
92
- });
93
- }
94
- exports.uploadScenario = uploadScenario;
95
- function uploadFeature(scenarioId, scenarioName, uri, hasFailed) {
96
- return __awaiter(this, void 0, void 0, function* () {
97
- let token = yield auth();
98
- return (yield axios_1.default.post(config_1.config.auxtaURL + "create-feature", {
99
- json: {
100
- name: scenarioName,
101
- uri: uri
102
- },
103
- scenarios: scenarioId,
104
- hasFailed: hasFailed
105
- }, headers(token))).data;
106
- });
107
- }
108
- exports.uploadFeature = uploadFeature;
109
- function updateReport(reportId, feature, steps, isFinal) {
110
- return __awaiter(this, void 0, void 0, function* () {
111
- let token = yield auth();
112
- yield axios_1.default.post(config_1.config.auxtaURL + "update-inprogress-report", {
113
- reportId: reportId,
114
- isFinal: isFinal,
115
- data: Object.assign({ feature: {
116
- featureRef: feature.featureId,
117
- name: feature.featureName,
118
- uri: feature.featureUri,
119
- status: feature.status,
120
- scenariosCount: feature.scenariosCount
121
- } }, steps)
122
- }, headers(token));
123
- });
124
- }
125
- exports.updateReport = updateReport;
126
- function getReport(reportId) {
127
- return __awaiter(this, void 0, void 0, function* () {
128
- let token = yield auth();
129
- return (yield axios_1.default.post(config_1.config.auxtaURL + "get-report", { reportId: reportId }, headers(token))).data;
130
- });
131
- }
132
- exports.getReport = getReport;
133
- function getLastDayResults() {
134
- return __awaiter(this, void 0, void 0, function* () {
135
- let token = yield auth();
136
- return (yield axios_1.default.get(config_1.config.auxtaURL + `get-last-day-results?url=${config_1.config.baseURL}`, headers(token))).data.results;
137
- });
138
- }
139
- exports.getLastDayResults = getLastDayResults;
140
- function postNotifications(body) {
141
- return __awaiter(this, void 0, void 0, function* () {
142
- let token = yield auth();
143
- yield axios_1.default.post(`${config_1.config.auxtaURL}post-notification-after-run-background`, {
144
- environmentName: body.environment,
145
- digitalProductToken: body.digitalProduct,
146
- organizationName: body.organization,
147
- bucketName: body.bucket,
148
- reportId: body.reportId,
149
- }, headers(token));
150
- });
151
- }
152
- exports.postNotifications = postNotifications;
153
- function postNotificationsOnFail(body) {
154
- return __awaiter(this, void 0, void 0, function* () {
155
- let token = yield auth();
156
- yield axios_1.default.post(`${config_1.config.auxtaURL}post-notifications-after-case-fail-background`, {
157
- environmentName: body.environment,
158
- digitalProductToken: body.digitalProduct,
159
- organizationName: body.organization,
160
- bucketName: body.bucket,
161
- reportId: body.reportId,
162
- featureName: body.featureName,
163
- scenarioName: body.scenarioName
164
- }, headers(token));
165
- });
166
- }
167
- 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
+ digitalProductToken: body.digitalProduct,
47
+ bucket: body.bucket,
48
+ start: new Date(),
49
+ url: body.baseUrl
50
+ }, headers(token))).data.reportId;
51
+ });
52
+ }
53
+ exports.createEmptyReport = createEmptyReport;
54
+ function uploadScenario(stepLog, scenarioName, screenshot, errMessage) {
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ let scenarios = [];
57
+ let token = yield auth();
58
+ let lastStep = stepLog[stepLog.length - 1];
59
+ const stepLogFormat = JSON.parse(JSON.stringify(stepLog));
60
+ stepLogFormat.pop();
61
+ let output = (yield axios_1.default.post(config_1.config.auxtaURL + "create-scenario", {
62
+ json: {
63
+ name: scenarioName,
64
+ steps: [
65
+ ...stepLogFormat,
66
+ (lastStep.result.status == 'failed')
67
+ ? Object.assign(lastStep, {
68
+ result: Object.assign(Object.assign({}, lastStep.result), { error_message: JSON.stringify(errMessage) })
69
+ })
70
+ : lastStep,
71
+ {
72
+ keyword: "After",
73
+ result: {
74
+ status: "passed",
75
+ duration: 2678000000
76
+ },
77
+ embeddings: (screenshot) ? [{
78
+ data: screenshot.toString("base64"),
79
+ mime_type: "image/png"
80
+ }] : undefined,
81
+ }
82
+ ],
83
+ }
84
+ }, headers(token))).data.scenarios;
85
+ scenarios.push({
86
+ scenarioRef: output.scenarioRef,
87
+ name: output.name,
88
+ status: output.status,
89
+ stepsCount: output.stepsCount
90
+ });
91
+ return scenarios;
92
+ });
93
+ }
94
+ exports.uploadScenario = uploadScenario;
95
+ function uploadFeature(scenarioId, scenarioName, uri, hasFailed) {
96
+ return __awaiter(this, void 0, void 0, function* () {
97
+ let token = yield auth();
98
+ return (yield axios_1.default.post(config_1.config.auxtaURL + "create-feature", {
99
+ json: {
100
+ name: scenarioName,
101
+ uri: uri
102
+ },
103
+ scenarios: scenarioId,
104
+ hasFailed: hasFailed
105
+ }, headers(token))).data;
106
+ });
107
+ }
108
+ exports.uploadFeature = uploadFeature;
109
+ function updateReport(reportId, feature, steps, isFinal) {
110
+ return __awaiter(this, void 0, void 0, function* () {
111
+ let token = yield auth();
112
+ yield axios_1.default.post(config_1.config.auxtaURL + "update-inprogress-report", {
113
+ reportId: reportId,
114
+ isFinal: isFinal,
115
+ data: Object.assign({ feature: {
116
+ featureRef: feature.featureId,
117
+ name: feature.featureName,
118
+ uri: feature.featureUri,
119
+ status: feature.status,
120
+ scenariosCount: feature.scenariosCount
121
+ } }, steps)
122
+ }, headers(token));
123
+ });
124
+ }
125
+ exports.updateReport = updateReport;
126
+ function getReport(reportId) {
127
+ return __awaiter(this, void 0, void 0, function* () {
128
+ let token = yield auth();
129
+ return (yield axios_1.default.post(config_1.config.auxtaURL + "get-report", { reportId: reportId }, headers(token))).data;
130
+ });
131
+ }
132
+ exports.getReport = getReport;
133
+ function getLastDayResults() {
134
+ return __awaiter(this, void 0, void 0, function* () {
135
+ let token = yield auth();
136
+ return (yield axios_1.default.get(config_1.config.auxtaURL + `get-last-day-results?url=${config_1.config.baseURL}`, headers(token))).data.results;
137
+ });
138
+ }
139
+ exports.getLastDayResults = getLastDayResults;
140
+ function postNotifications(body) {
141
+ return __awaiter(this, void 0, void 0, function* () {
142
+ let token = yield auth();
143
+ yield axios_1.default.post(`${config_1.config.auxtaURL}post-notification-after-run-background`, {
144
+ environmentName: body.environment,
145
+ digitalProductToken: body.digitalProduct,
146
+ organizationName: body.organization,
147
+ bucketName: body.bucket,
148
+ reportId: body.reportId,
149
+ }, headers(token));
150
+ });
151
+ }
152
+ exports.postNotifications = postNotifications;
153
+ function postNotificationsOnFail(body) {
154
+ return __awaiter(this, void 0, void 0, function* () {
155
+ let token = yield auth();
156
+ yield axios_1.default.post(`${config_1.config.auxtaURL}post-notifications-after-case-fail-background`, {
157
+ environmentName: body.environment,
158
+ digitalProductToken: body.digitalProduct,
159
+ organizationName: body.organization,
160
+ bucketName: body.bucket,
161
+ reportId: body.reportId,
162
+ featureName: body.featureName,
163
+ scenarioName: body.scenarioName
164
+ }, headers(token));
165
+ });
166
+ }
167
+ exports.postNotificationsOnFail = postNotificationsOnFail;
@@ -1,16 +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
- }
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,15 +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
- }
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,2 +1,2 @@
1
- /// <reference types="node" />
2
- export declare function captureScreenshot(): Promise<Buffer | undefined>;
1
+ /// <reference types="node" />
2
+ export declare function captureScreenshot(): Promise<Buffer | undefined>;
@@ -1,40 +1,40 @@
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
- const log_service_1 = __importDefault(require("../services/log.service"));
18
- const status_of_step_1 = __importDefault(require("../enums/status-of.step"));
19
- function captureScreenshot() {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- try {
22
- const pages = yield puppeteer_1.default.defaultPage.browser().pages();
23
- if (!pages.length)
24
- return undefined;
25
- const lastPage = pages[pages.length - 1] || puppeteer_1.default.defaultPage;
26
- const screenshotBuffer = yield lastPage.screenshot({
27
- fullPage: true,
28
- encoding: 'binary'
29
- });
30
- if (Buffer.isBuffer(screenshotBuffer))
31
- return screenshotBuffer;
32
- }
33
- catch (e) {
34
- log_service_1.default.push('When', e.toString(), status_of_step_1.default.FAILED);
35
- return undefined;
36
- }
37
- return undefined;
38
- });
39
- }
40
- 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
+ const log_service_1 = __importDefault(require("../services/log.service"));
18
+ const status_of_step_1 = __importDefault(require("../enums/status-of.step"));
19
+ function captureScreenshot() {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ try {
22
+ const pages = yield puppeteer_1.default.defaultPage.browser().pages();
23
+ if (!pages.length)
24
+ return undefined;
25
+ const lastPage = pages[pages.length - 1] || puppeteer_1.default.defaultPage;
26
+ const screenshotBuffer = yield lastPage.screenshot({
27
+ fullPage: true,
28
+ encoding: 'binary'
29
+ });
30
+ if (Buffer.isBuffer(screenshotBuffer))
31
+ return screenshotBuffer;
32
+ }
33
+ catch (e) {
34
+ log_service_1.default.push('When', e.toString(), status_of_step_1.default.FAILED);
35
+ return undefined;
36
+ }
37
+ return undefined;
38
+ });
39
+ }
40
+ exports.captureScreenshot = captureScreenshot;
@@ -1,17 +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
- }>;
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
+ }>;