@auxcode/auxta 1.3.41 → 1.3.44-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/cjs/auxta/hooks/report.hook.js +2 -1
- package/build/cjs/auxta/services/report.service.d.ts +1 -7
- package/build/cjs/auxta/services/report.service.js +2 -1
- package/build/cjs/auxta/utilities/screenshot.helper.d.ts +2 -0
- package/build/cjs/auxta/utilities/screenshot.helper.js +18 -1
- package/build/cjs/macros/helpers/code.helper.d.ts +1 -1
- package/build/cjs/macros/helpers/code.helper.js +2 -2
- package/build/esm/auxta/hooks/report.hook.js +2 -1
- package/build/esm/auxta/services/report.service.d.ts +1 -7
- package/build/esm/auxta/services/report.service.js +2 -1
- package/build/esm/auxta/utilities/screenshot.helper.d.ts +2 -0
- package/build/esm/auxta/utilities/screenshot.helper.js +16 -0
- package/build/esm/macros/helpers/code.helper.d.ts +1 -1
- package/build/esm/macros/helpers/code.helper.js +3 -3
- package/build/tsconfig-cjs.tsbuildinfo +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -32,7 +32,8 @@ function onTestEnd(body, featureName, scenarioName, statusCode, screenshotBuffer
|
|
|
32
32
|
featureName: featureRes.name,
|
|
33
33
|
featureUri: featureRes.uri,
|
|
34
34
|
status: featureRes.status,
|
|
35
|
-
scenariosCount: featureRes.scenariosCount
|
|
35
|
+
scenariosCount: featureRes.scenariosCount,
|
|
36
|
+
lastFiveStepsHash: featureRes.lastFiveStepsHash
|
|
36
37
|
};
|
|
37
38
|
const stepCounts = {
|
|
38
39
|
failedSteps: log_service_1.default.getStatusCount(status_of_step_1.StatusOfStep.FAILED),
|
|
@@ -7,13 +7,7 @@ export interface Feature {
|
|
|
7
7
|
featureUri: string;
|
|
8
8
|
status: string;
|
|
9
9
|
scenariosCount: number;
|
|
10
|
-
|
|
11
|
-
export interface Scenario {
|
|
12
|
-
featureId: string;
|
|
13
|
-
featureName: string;
|
|
14
|
-
featureUri: string;
|
|
15
|
-
status: string;
|
|
16
|
-
scenariosCount: number;
|
|
10
|
+
lastFiveStepsHash: number;
|
|
17
11
|
}
|
|
18
12
|
export interface Steps {
|
|
19
13
|
failedSteps: number;
|
|
@@ -117,7 +117,8 @@ function updateReport(reportId, feature, steps, isFinal) {
|
|
|
117
117
|
name: feature.featureName,
|
|
118
118
|
uri: feature.featureUri,
|
|
119
119
|
status: feature.status,
|
|
120
|
-
scenariosCount: feature.scenariosCount
|
|
120
|
+
scenariosCount: feature.scenariosCount,
|
|
121
|
+
lastFiveStepsHash: feature.lastFiveStepsHash
|
|
121
122
|
} }, steps)
|
|
122
123
|
}, headers(token));
|
|
123
124
|
});
|
|
@@ -12,7 +12,7 @@ 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.captureScreenshot = void 0;
|
|
15
|
+
exports.captureScreenshotPage = exports.captureScreenshot = void 0;
|
|
16
16
|
const puppeteer_1 = __importDefault(require("../../puppeteer/puppeteer"));
|
|
17
17
|
const log_service_1 = __importDefault(require("../services/log.service"));
|
|
18
18
|
const status_of_step_1 = __importDefault(require("../enums/status-of.step"));
|
|
@@ -38,3 +38,20 @@ function captureScreenshot() {
|
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
exports.captureScreenshot = captureScreenshot;
|
|
41
|
+
function captureScreenshotPage(page) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
try {
|
|
44
|
+
const screenshotBuffer = yield page.screenshot({
|
|
45
|
+
fullPage: true,
|
|
46
|
+
encoding: 'binary'
|
|
47
|
+
});
|
|
48
|
+
if (Buffer.isBuffer(screenshotBuffer))
|
|
49
|
+
return screenshotBuffer;
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
52
|
+
log_service_1.default.push('When', e.toString(), status_of_step_1.default.FAILED);
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
exports.captureScreenshotPage = captureScreenshotPage;
|
|
@@ -2,7 +2,7 @@ import { StatusOfStep } from "../../auxta/enums/status-of.step";
|
|
|
2
2
|
import { ExtendDefaultPage } from "./extend-default-page";
|
|
3
3
|
export declare class FunctionHelper extends ExtendDefaultPage {
|
|
4
4
|
log(keyword: string, name: string, status: StatusOfStep, screenshot?: string): void;
|
|
5
|
-
screenshot(): Promise<string | undefined>;
|
|
5
|
+
screenshot(page?: import("puppeteer").Page): Promise<string | undefined>;
|
|
6
6
|
suggest(name: string): void;
|
|
7
7
|
private getEscapedText;
|
|
8
8
|
clickByText(selector: string, text: string, dotOrText?: string, options?: {}, page?: import("puppeteer").Page, time?: number, log_message?: boolean): Promise<void>;
|
|
@@ -24,9 +24,9 @@ class FunctionHelper extends extend_default_page_1.ExtendDefaultPage {
|
|
|
24
24
|
log(keyword, name, status, screenshot) {
|
|
25
25
|
log_service_1.default.push(keyword, name, status, screenshot);
|
|
26
26
|
}
|
|
27
|
-
screenshot() {
|
|
27
|
+
screenshot(page = puppeteer_1.default.defaultPage) {
|
|
28
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
const screenshotBuffer = yield (0, screenshot_helper_1.
|
|
29
|
+
const screenshotBuffer = yield (0, screenshot_helper_1.captureScreenshotPage)(page);
|
|
30
30
|
if (screenshotBuffer) {
|
|
31
31
|
return screenshotBuffer.toString('base64');
|
|
32
32
|
}
|
|
@@ -26,7 +26,8 @@ export function onTestEnd(body, featureName, scenarioName, statusCode, screensho
|
|
|
26
26
|
featureName: featureRes.name,
|
|
27
27
|
featureUri: featureRes.uri,
|
|
28
28
|
status: featureRes.status,
|
|
29
|
-
scenariosCount: featureRes.scenariosCount
|
|
29
|
+
scenariosCount: featureRes.scenariosCount,
|
|
30
|
+
lastFiveStepsHash: featureRes.lastFiveStepsHash
|
|
30
31
|
};
|
|
31
32
|
const stepCounts = {
|
|
32
33
|
failedSteps: log.getStatusCount(StatusOfStep.FAILED),
|
|
@@ -7,13 +7,7 @@ export interface Feature {
|
|
|
7
7
|
featureUri: string;
|
|
8
8
|
status: string;
|
|
9
9
|
scenariosCount: number;
|
|
10
|
-
|
|
11
|
-
export interface Scenario {
|
|
12
|
-
featureId: string;
|
|
13
|
-
featureName: string;
|
|
14
|
-
featureUri: string;
|
|
15
|
-
status: string;
|
|
16
|
-
scenariosCount: number;
|
|
10
|
+
lastFiveStepsHash: number;
|
|
17
11
|
}
|
|
18
12
|
export interface Steps {
|
|
19
13
|
failedSteps: number;
|
|
@@ -108,7 +108,8 @@ export function updateReport(reportId, feature, steps, isFinal) {
|
|
|
108
108
|
name: feature.featureName,
|
|
109
109
|
uri: feature.featureUri,
|
|
110
110
|
status: feature.status,
|
|
111
|
-
scenariosCount: feature.scenariosCount
|
|
111
|
+
scenariosCount: feature.scenariosCount,
|
|
112
|
+
lastFiveStepsHash: feature.lastFiveStepsHash
|
|
112
113
|
} }, steps)
|
|
113
114
|
}, headers(token));
|
|
114
115
|
});
|
|
@@ -31,3 +31,19 @@ export function captureScreenshot() {
|
|
|
31
31
|
return undefined;
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
+
export function captureScreenshotPage(page) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
try {
|
|
37
|
+
const screenshotBuffer = yield page.screenshot({
|
|
38
|
+
fullPage: true,
|
|
39
|
+
encoding: 'binary'
|
|
40
|
+
});
|
|
41
|
+
if (Buffer.isBuffer(screenshotBuffer))
|
|
42
|
+
return screenshotBuffer;
|
|
43
|
+
}
|
|
44
|
+
catch (e) {
|
|
45
|
+
log.push('When', e.toString(), StatusOfStep.FAILED);
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
@@ -2,7 +2,7 @@ import { StatusOfStep } from "../../auxta/enums/status-of.step";
|
|
|
2
2
|
import { ExtendDefaultPage } from "./extend-default-page";
|
|
3
3
|
export declare class FunctionHelper extends ExtendDefaultPage {
|
|
4
4
|
log(keyword: string, name: string, status: StatusOfStep, screenshot?: string): void;
|
|
5
|
-
screenshot(): Promise<string | undefined>;
|
|
5
|
+
screenshot(page?: import("puppeteer").Page): Promise<string | undefined>;
|
|
6
6
|
suggest(name: string): void;
|
|
7
7
|
private getEscapedText;
|
|
8
8
|
clickByText(selector: string, text: string, dotOrText?: string, options?: {}, page?: import("puppeteer").Page, time?: number, log_message?: boolean): Promise<void>;
|
|
@@ -13,14 +13,14 @@ import { StatusOfStep } from "../../auxta/enums/status-of.step";
|
|
|
13
13
|
import { StepStatus } from "../../AuxTA";
|
|
14
14
|
import { ExtendDefaultPage } from "./extend-default-page";
|
|
15
15
|
import { KnownDevices } from "puppeteer";
|
|
16
|
-
import {
|
|
16
|
+
import { captureScreenshotPage } from "../../auxta/utilities/screenshot.helper";
|
|
17
17
|
export class FunctionHelper extends ExtendDefaultPage {
|
|
18
18
|
log(keyword, name, status, screenshot) {
|
|
19
19
|
log.push(keyword, name, status, screenshot);
|
|
20
20
|
}
|
|
21
|
-
screenshot() {
|
|
21
|
+
screenshot(page = puppeteer.defaultPage) {
|
|
22
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
const screenshotBuffer = yield
|
|
23
|
+
const screenshotBuffer = yield captureScreenshotPage(page);
|
|
24
24
|
if (screenshotBuffer) {
|
|
25
25
|
return screenshotBuffer.toString('base64');
|
|
26
26
|
}
|