@auxcode/auxta 1.3.84 → 1.3.85-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.
- package/build/auxta/helpers/response.helper.d.ts +1 -1
- package/build/auxta/helpers/response.helper.js +1 -1
- package/build/auxta/services/log.service.d.ts +2 -2
- package/build/auxta/services/log.service.js +2 -2
- package/build/auxta/services/report.service.d.ts +1 -1
- package/build/auxta/services/report.service.js +1 -1
- package/build/auxta/utilities/screenshot.helper.js +1 -1
- package/build/macros/helpers/code.helper.d.ts +3 -2
- package/build/macros/helpers/code.helper.js +2 -2
- package/package.json +4 -4
|
@@ -7,7 +7,7 @@ export interface Step {
|
|
|
7
7
|
status: StatusOfStep;
|
|
8
8
|
duration: number;
|
|
9
9
|
embedding?: {
|
|
10
|
-
data:
|
|
10
|
+
data: ArrayBuffer;
|
|
11
11
|
mime_type: string;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
@@ -23,7 +23,7 @@ export declare class LogSteps {
|
|
|
23
23
|
private lastStepTime;
|
|
24
24
|
addSuggestion(text: string): void;
|
|
25
25
|
clear(): void;
|
|
26
|
-
push(keyword: string, name: string, status: StatusOfStep, screenshot?:
|
|
26
|
+
push(keyword: string, name: string, status: StatusOfStep, screenshot?: ArrayBuffer, imageCompareKey?: string): void;
|
|
27
27
|
returnScenarioReport(): Step[];
|
|
28
28
|
getStatusCount(status: StatusOfStep): number;
|
|
29
29
|
}
|
|
@@ -28,11 +28,11 @@ class LogSteps {
|
|
|
28
28
|
[status_of_step_1.StatusOfStep.SUGGESTION]: 0,
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
push(keyword, name, status, screenshot =
|
|
31
|
+
push(keyword, name, status, screenshot = new ArrayBuffer(0), imageCompareKey = '') {
|
|
32
32
|
console.log(`System log -- status: ${status} -- : ${name} `);
|
|
33
33
|
this.statusCounter[status]++;
|
|
34
34
|
const currentStep = new Date().getTime();
|
|
35
|
-
if (screenshot !=
|
|
35
|
+
if (screenshot.byteLength != 0) {
|
|
36
36
|
const embedding = {
|
|
37
37
|
data: screenshot,
|
|
38
38
|
mime_type: "image/png"
|
|
@@ -26,7 +26,7 @@ export declare function uploadScenario(stepRes: any[], scenarioName: string, uri
|
|
|
26
26
|
export declare function updateReport(reportId: string, scenario: Scenarios, steps: Steps, isFinal: boolean): Promise<void>;
|
|
27
27
|
export declare function getReport(reportId: string): Promise<any>;
|
|
28
28
|
export declare function getLastDayResults(): Promise<any>;
|
|
29
|
-
export declare function compareScreenshots(key: string, screenshot:
|
|
29
|
+
export declare function compareScreenshots(key: string, screenshot: ArrayBuffer): Promise<any>;
|
|
30
30
|
export declare function postNotifications(body: UploadModel): Promise<void>;
|
|
31
31
|
export declare function postNotificationsOnFail(body: UploadModel): Promise<void>;
|
|
32
32
|
export declare function getVerifyReceivedEmail(from_name: string, from_email: string, subject: string, body: string, link: boolean): Promise<import("axios").AxiosResponse<any, any>>;
|
|
@@ -54,7 +54,7 @@ function captureScreenshot() {
|
|
|
54
54
|
encoding: 'binary'
|
|
55
55
|
});
|
|
56
56
|
if (Buffer.isBuffer(screenshotBuffer)) {
|
|
57
|
-
log_service_1.default.push("When", `${i} Image`, status_of_step_1.default.FAILED, screenshotBuffer
|
|
57
|
+
log_service_1.default.push("When", `${i} Image`, status_of_step_1.default.FAILED, screenshotBuffer);
|
|
58
58
|
break;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { StatusOfStep } from "../../auxta/enums/status-of.step";
|
|
2
3
|
import { ExtendDefaultPage } from "./extend-default-page";
|
|
3
4
|
export declare class FunctionHelper extends ExtendDefaultPage {
|
|
4
|
-
log(keyword: string, name: string, status: StatusOfStep, screenshot?:
|
|
5
|
-
screenshot(page?: import("puppeteer").Page): Promise<
|
|
5
|
+
log(keyword: string, name: string, status: StatusOfStep, screenshot?: ArrayBuffer): void;
|
|
6
|
+
screenshot(page?: import("puppeteer").Page): Promise<Buffer | undefined>;
|
|
6
7
|
screenshotCompare(key: string, threshold?: number, page?: import("puppeteer").Page): Promise<void>;
|
|
7
8
|
suggest(name: string): void;
|
|
8
9
|
clickByText(selector: string, text: string, dotOrText?: string, options?: {}, page?: import("puppeteer").Page, time?: number, log_message?: boolean): Promise<void>;
|
|
@@ -29,7 +29,7 @@ class FunctionHelper extends extend_default_page_1.ExtendDefaultPage {
|
|
|
29
29
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
30
|
const screenshotBuffer = yield (0, screenshot_helper_1.captureScreenshotPage)(page);
|
|
31
31
|
if (screenshotBuffer) {
|
|
32
|
-
return screenshotBuffer
|
|
32
|
+
return screenshotBuffer;
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
}
|
|
@@ -38,7 +38,7 @@ class FunctionHelper extends extend_default_page_1.ExtendDefaultPage {
|
|
|
38
38
|
if (process.env.ENVIRONMENT !== 'LOCAL') {
|
|
39
39
|
const screenshotBuffer = yield (0, screenshot_helper_1.captureScreenshotPage)(page);
|
|
40
40
|
if (screenshotBuffer) {
|
|
41
|
-
const screenshot = screenshotBuffer
|
|
41
|
+
const screenshot = screenshotBuffer;
|
|
42
42
|
const result = yield (0, report_service_1.compareScreenshots)(key, screenshot);
|
|
43
43
|
if (result.presentDifference && Number(result.presentDifference) > threshold) {
|
|
44
44
|
log_service_1.default.push('Then', `I compare screenshots with key ${key}, and difference is: ${result.presentDifference}%`, status_of_step_1.StatusOfStep.FAILED, screenshot, key);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@auxcode/auxta",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.85-beta.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/AuxTA.js",
|
|
6
6
|
"types": "./build/AuxTA.d.ts",
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"googleapis": "^118.0.0",
|
|
24
24
|
"js-base64": "^3.7.5",
|
|
25
25
|
"node-2fa": "^2.0.3",
|
|
26
|
-
"nodemailer": "^6.9.
|
|
26
|
+
"nodemailer": "^6.9.9",
|
|
27
27
|
"puppeteer": "^22.0.0",
|
|
28
28
|
"readline": "^1.3.0",
|
|
29
|
-
"typescript": "^5.
|
|
29
|
+
"typescript": "^5.3.3"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@babel/preset-typescript": "^7.
|
|
32
|
+
"@babel/preset-typescript": "^7.23.3"
|
|
33
33
|
}
|
|
34
34
|
}
|