@auxcode/auxta 1.3.116 → 1.3.117
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/AuxTA.js +17 -7
- package/build/auxta/configs/config.js +3 -3
- package/build/auxta/helpers/response.helper.d.ts +0 -1
- package/build/auxta/helpers/response.helper.js +1 -2
- package/build/auxta/hooks/report.hook.d.ts +0 -1
- package/build/auxta/hooks/report.hook.js +2 -3
- package/build/auxta/services/log.service.d.ts +3 -3
- package/build/auxta/services/log.service.js +2 -2
- package/build/auxta/services/report.service.d.ts +1 -2
- package/build/auxta/services/report.service.js +12 -13
- package/build/auxta/utilities/screenshot.helper.d.ts +0 -1
- package/build/auxta/utilities/screenshot.helper.js +2 -3
- package/build/auxta/utilities/start-suite.helper.js +2 -3
- package/build/macros/helpers/code.helper.d.ts +1 -2
- package/package.json +1 -1
package/build/AuxTA.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.config =
|
|
3
|
+
exports.config = void 0;
|
|
4
|
+
exports.setupConfig = setupConfig;
|
|
5
|
+
exports.setupOverrideConfig = setupOverrideConfig;
|
|
4
6
|
function setupConfig(jsonConfig) {
|
|
5
7
|
if (!jsonConfig.baseURL)
|
|
6
8
|
throw new Error("baseURL");
|
|
@@ -42,7 +44,6 @@ function setupConfig(jsonConfig) {
|
|
|
42
44
|
exports.config.screenHeight = jsonConfig.screenHeight;
|
|
43
45
|
return exports.config;
|
|
44
46
|
}
|
|
45
|
-
exports.setupConfig = setupConfig;
|
|
46
47
|
function setupOverrideConfig(overrideConfig) {
|
|
47
48
|
if (overrideConfig.baseURL)
|
|
48
49
|
exports.config.baseURL = overrideConfig.baseURL;
|
|
@@ -54,7 +55,6 @@ function setupOverrideConfig(overrideConfig) {
|
|
|
54
55
|
exports.config.screenHeight = overrideConfig.screenHeight;
|
|
55
56
|
return exports.config;
|
|
56
57
|
}
|
|
57
|
-
exports.setupOverrideConfig = setupOverrideConfig;
|
|
58
58
|
exports.config = {
|
|
59
59
|
auxtaURL: "",
|
|
60
60
|
baseURL: "",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.returnImage =
|
|
3
|
+
exports.returnImage = returnImage;
|
|
4
4
|
function returnImage(code, screenshot) {
|
|
5
5
|
return {
|
|
6
6
|
isBase64Encoded: true,
|
|
@@ -12,4 +12,3 @@ function returnImage(code, screenshot) {
|
|
|
12
12
|
body: screenshot
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
exports.returnImage = returnImage;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { UploadModel } from "../models/upload.model";
|
|
3
2
|
export declare function onTestEnd(body: any, featureName: string, scenarioName: string, statusCode: number, screenshotBuffer?: Buffer, errMessage?: object): Promise<{
|
|
4
3
|
nextSuites?: undefined;
|
|
@@ -12,7 +12,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
15
|
+
exports.onTestEnd = onTestEnd;
|
|
16
|
+
exports.afterComplete = afterComplete;
|
|
16
17
|
const path_1 = require("path");
|
|
17
18
|
const log_service_1 = __importDefault(require("../services/log.service"));
|
|
18
19
|
const report_service_1 = require("../services/report.service");
|
|
@@ -59,11 +60,9 @@ function onTestEnd(body, featureName, scenarioName, statusCode, screenshotBuffer
|
|
|
59
60
|
}
|
|
60
61
|
});
|
|
61
62
|
}
|
|
62
|
-
exports.onTestEnd = onTestEnd;
|
|
63
63
|
function afterComplete(body) {
|
|
64
64
|
return __awaiter(this, void 0, void 0, function* () {
|
|
65
65
|
if (process.env.ENVIRONMENT == "LIVE")
|
|
66
66
|
yield (0, report_service_1.postNotifications)(body);
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
exports.afterComplete = afterComplete;
|
|
@@ -8,7 +8,7 @@ export interface Step {
|
|
|
8
8
|
status: StatusOfStep;
|
|
9
9
|
duration: number;
|
|
10
10
|
embedding?: {
|
|
11
|
-
data:
|
|
11
|
+
data: Buffer;
|
|
12
12
|
mime_type: string;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
@@ -26,9 +26,9 @@ export declare class LogSteps {
|
|
|
26
26
|
private lastStepTime;
|
|
27
27
|
private _tags;
|
|
28
28
|
addSuggestion(text: string): void;
|
|
29
|
-
addPerformanceFail(text: string, screenshot?:
|
|
29
|
+
addPerformanceFail(text: string, screenshot?: Buffer): void;
|
|
30
30
|
clear(): void;
|
|
31
|
-
push(keyword: string, tag: string, name: string, status: StatusOfStep, screenshot?:
|
|
31
|
+
push(keyword: string, tag: string, name: string, status: StatusOfStep, screenshot?: Buffer, imageCompareKey?: string): void;
|
|
32
32
|
returnScenarioReport(): Step[];
|
|
33
33
|
getStatusCount(status: StatusOfStep): number;
|
|
34
34
|
get tag(): string;
|
|
@@ -22,7 +22,7 @@ class LogSteps {
|
|
|
22
22
|
keyword: 'Suggestion', tag: this.tag, name: text, imageCompareKey: '', result: { status: status_of_step_1.StatusOfStep.SUGGESTION, duration: 0 }
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
addPerformanceFail(text, screenshot =
|
|
25
|
+
addPerformanceFail(text, screenshot = Buffer.alloc(0)) {
|
|
26
26
|
this.statusCounter[status_of_step_1.StatusOfStep.PERFORMANCE_FAIL]++;
|
|
27
27
|
const currentStep = new Date().getTime();
|
|
28
28
|
if (screenshot.byteLength != 0) {
|
|
@@ -60,7 +60,7 @@ class LogSteps {
|
|
|
60
60
|
[status_of_step_1.StatusOfStep.LOG]: 0
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
|
-
push(keyword, tag, name, status, screenshot =
|
|
63
|
+
push(keyword, tag, name, status, screenshot = Buffer.alloc(0), imageCompareKey = '') {
|
|
64
64
|
console.log(`System log -- status: ${status} -- tag: ${tag} -- : ${name} `);
|
|
65
65
|
this.statusCounter[status]++;
|
|
66
66
|
const currentStep = new Date().getTime();
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Step } from "./log.service";
|
|
3
2
|
import { UploadModel } from "../models/upload.model";
|
|
4
3
|
export interface Scenarios {
|
|
@@ -30,7 +29,7 @@ export declare function uploadScenario(stepRes: any[], scenarioName: string, uri
|
|
|
30
29
|
export declare function updateReport(reportId: string, scenario: Scenarios, steps: Steps, isFinal: boolean): Promise<void>;
|
|
31
30
|
export declare function getReport(reportId: string): Promise<any>;
|
|
32
31
|
export declare function getLastDayResults(): Promise<any>;
|
|
33
|
-
export declare function compareScreenshots(key: string, screenshot:
|
|
32
|
+
export declare function compareScreenshots(key: string, screenshot: Buffer): Promise<any>;
|
|
34
33
|
export declare function postNotifications(body: UploadModel): Promise<void>;
|
|
35
34
|
export declare function postNotificationsOnFail(body: UploadModel): Promise<void>;
|
|
36
35
|
export declare function getVerifyReceivedEmail(from_name: string, from_email: string, subject: string, body: string, link: boolean): Promise<import("axios").AxiosResponse<any, any>>;
|
|
@@ -12,7 +12,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
15
|
+
exports.setTimeZone = setTimeZone;
|
|
16
|
+
exports.setEmailProvider = setEmailProvider;
|
|
17
|
+
exports.createEmptyReport = createEmptyReport;
|
|
18
|
+
exports.uploadStep = uploadStep;
|
|
19
|
+
exports.uploadScenario = uploadScenario;
|
|
20
|
+
exports.updateReport = updateReport;
|
|
21
|
+
exports.getReport = getReport;
|
|
22
|
+
exports.getLastDayResults = getLastDayResults;
|
|
23
|
+
exports.compareScreenshots = compareScreenshots;
|
|
24
|
+
exports.postNotifications = postNotifications;
|
|
25
|
+
exports.postNotificationsOnFail = postNotificationsOnFail;
|
|
26
|
+
exports.getVerifyReceivedEmail = getVerifyReceivedEmail;
|
|
16
27
|
const axios_1 = __importDefault(require("axios"));
|
|
17
28
|
const config_1 = require("../configs/config");
|
|
18
29
|
function headers(token) {
|
|
@@ -61,7 +72,6 @@ function setTimeZone() {
|
|
|
61
72
|
}, headers(token))).data;
|
|
62
73
|
});
|
|
63
74
|
}
|
|
64
|
-
exports.setTimeZone = setTimeZone;
|
|
65
75
|
function setEmailProvider() {
|
|
66
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
67
77
|
const token = yield auth();
|
|
@@ -71,7 +81,6 @@ function setEmailProvider() {
|
|
|
71
81
|
}, headers(token))).data;
|
|
72
82
|
});
|
|
73
83
|
}
|
|
74
|
-
exports.setEmailProvider = setEmailProvider;
|
|
75
84
|
function createEmptyReport(body) {
|
|
76
85
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
86
|
const token = yield auth();
|
|
@@ -86,7 +95,6 @@ function createEmptyReport(body) {
|
|
|
86
95
|
}, headers(token))).data.reportId;
|
|
87
96
|
});
|
|
88
97
|
}
|
|
89
|
-
exports.createEmptyReport = createEmptyReport;
|
|
90
98
|
function uploadStep(stepLog, scenarioName, screenshot, errMessage) {
|
|
91
99
|
return __awaiter(this, void 0, void 0, function* () {
|
|
92
100
|
let scenarios = [];
|
|
@@ -127,7 +135,6 @@ function uploadStep(stepLog, scenarioName, screenshot, errMessage) {
|
|
|
127
135
|
return scenarios;
|
|
128
136
|
});
|
|
129
137
|
}
|
|
130
|
-
exports.uploadStep = uploadStep;
|
|
131
138
|
function uploadScenario(stepRes, scenarioName, uri, hasFailed) {
|
|
132
139
|
return __awaiter(this, void 0, void 0, function* () {
|
|
133
140
|
let token = yield auth();
|
|
@@ -141,7 +148,6 @@ function uploadScenario(stepRes, scenarioName, uri, hasFailed) {
|
|
|
141
148
|
}, headers(token))).data;
|
|
142
149
|
});
|
|
143
150
|
}
|
|
144
|
-
exports.uploadScenario = uploadScenario;
|
|
145
151
|
function updateReport(reportId, scenario, steps, isFinal) {
|
|
146
152
|
return __awaiter(this, void 0, void 0, function* () {
|
|
147
153
|
let token = yield auth();
|
|
@@ -161,21 +167,18 @@ function updateReport(reportId, scenario, steps, isFinal) {
|
|
|
161
167
|
}, headers(token));
|
|
162
168
|
});
|
|
163
169
|
}
|
|
164
|
-
exports.updateReport = updateReport;
|
|
165
170
|
function getReport(reportId) {
|
|
166
171
|
return __awaiter(this, void 0, void 0, function* () {
|
|
167
172
|
let token = yield auth();
|
|
168
173
|
return (yield axios_1.default.post(config_1.config.auxtaURL + "get-report", { reportId: reportId }, headers(token))).data;
|
|
169
174
|
});
|
|
170
175
|
}
|
|
171
|
-
exports.getReport = getReport;
|
|
172
176
|
function getLastDayResults() {
|
|
173
177
|
return __awaiter(this, void 0, void 0, function* () {
|
|
174
178
|
let token = yield auth();
|
|
175
179
|
return (yield axios_1.default.get(config_1.config.auxtaURL + `get-last-day-results?url=${config_1.config.baseURL}`, headers(token))).data.results;
|
|
176
180
|
});
|
|
177
181
|
}
|
|
178
|
-
exports.getLastDayResults = getLastDayResults;
|
|
179
182
|
function compareScreenshots(key, screenshot) {
|
|
180
183
|
return __awaiter(this, void 0, void 0, function* () {
|
|
181
184
|
let token = yield auth();
|
|
@@ -190,7 +193,6 @@ function compareScreenshots(key, screenshot) {
|
|
|
190
193
|
}, headers(token))).data;
|
|
191
194
|
});
|
|
192
195
|
}
|
|
193
|
-
exports.compareScreenshots = compareScreenshots;
|
|
194
196
|
function postNotifications(body) {
|
|
195
197
|
return __awaiter(this, void 0, void 0, function* () {
|
|
196
198
|
let token = yield auth();
|
|
@@ -204,7 +206,6 @@ function postNotifications(body) {
|
|
|
204
206
|
}, headers(token));
|
|
205
207
|
});
|
|
206
208
|
}
|
|
207
|
-
exports.postNotifications = postNotifications;
|
|
208
209
|
function postNotificationsOnFail(body) {
|
|
209
210
|
return __awaiter(this, void 0, void 0, function* () {
|
|
210
211
|
let token = yield auth();
|
|
@@ -220,7 +221,6 @@ function postNotificationsOnFail(body) {
|
|
|
220
221
|
}, headers(token));
|
|
221
222
|
});
|
|
222
223
|
}
|
|
223
|
-
exports.postNotificationsOnFail = postNotificationsOnFail;
|
|
224
224
|
function getVerifyReceivedEmail(from_name, from_email, subject, body, link) {
|
|
225
225
|
return __awaiter(this, void 0, void 0, function* () {
|
|
226
226
|
let token = yield auth();
|
|
@@ -233,4 +233,3 @@ function getVerifyReceivedEmail(from_name, from_email, subject, body, link) {
|
|
|
233
233
|
}, headers(token));
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
|
-
exports.getVerifyReceivedEmail = getVerifyReceivedEmail;
|
|
@@ -12,7 +12,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
15
|
+
exports.captureScreenshot = captureScreenshot;
|
|
16
|
+
exports.captureScreenshotPage = captureScreenshotPage;
|
|
16
17
|
const puppeteer_1 = __importDefault(require("../../puppeteer/puppeteer"));
|
|
17
18
|
const log_service_1 = __importDefault(require("../services/log.service"));
|
|
18
19
|
const status_of_step_1 = __importDefault(require("../enums/status-of.step"));
|
|
@@ -71,7 +72,6 @@ function captureScreenshot() {
|
|
|
71
72
|
return undefined;
|
|
72
73
|
});
|
|
73
74
|
}
|
|
74
|
-
exports.captureScreenshot = captureScreenshot;
|
|
75
75
|
function captureScreenshotPage(page) {
|
|
76
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
77
|
let count = 0;
|
|
@@ -98,4 +98,3 @@ function captureScreenshotPage(page) {
|
|
|
98
98
|
return undefined;
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
|
-
exports.captureScreenshotPage = captureScreenshotPage;
|
|
@@ -9,7 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.startSuite = startSuite;
|
|
13
|
+
exports.retrySuite = retrySuite;
|
|
13
14
|
function startSuite(suites, reportId) {
|
|
14
15
|
return __awaiter(this, void 0, void 0, function* () {
|
|
15
16
|
if (suites.length === 0)
|
|
@@ -18,7 +19,6 @@ function startSuite(suites, reportId) {
|
|
|
18
19
|
return { nextSuites: suites, reportId: reportId, currentSuite: next, retries: "0" };
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
|
-
exports.startSuite = startSuite;
|
|
22
22
|
function retrySuite(suites, reportId, currentSuite, retries) {
|
|
23
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
24
|
console.log('I repeat again the current suite: ' + currentSuite);
|
|
@@ -28,4 +28,3 @@ function retrySuite(suites, reportId, currentSuite, retries) {
|
|
|
28
28
|
return { nextSuites: suites, reportId: reportId, currentSuite: currentSuite, retries: retries };
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
exports.retrySuite = retrySuite;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { StatusOfStep } from "../../auxta/enums/status-of.step";
|
|
3
2
|
import { ExtendDefaultPage } from "./extend-default-page";
|
|
4
3
|
import { CDPSession } from "puppeteer";
|
|
5
4
|
export declare class FunctionHelper extends ExtendDefaultPage {
|
|
6
5
|
cdp: CDPSession | undefined;
|
|
7
|
-
log(keyword: string, name: string, status: StatusOfStep, screenshot?:
|
|
6
|
+
log(keyword: string, name: string, status: StatusOfStep, screenshot?: Buffer): void;
|
|
8
7
|
setTag(tag: string): void;
|
|
9
8
|
clearTag(): void;
|
|
10
9
|
callREST(method: string, url: string, headers?: object, body?: object): Promise<import("axios").AxiosResponse<any, any>>;
|