@auxcode/auxta 1.3.24-beta.6 → 1.3.24

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