@auxcode/auxta 1.3.24 → 1.3.26-beta.2
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/README.md +93 -93
- package/build/cjs/AuxTA.d.ts +61 -61
- package/build/cjs/AuxTA.js +152 -152
- package/build/cjs/auxta/configs/config.d.ts +54 -54
- package/build/cjs/auxta/configs/config.js +65 -65
- package/build/cjs/auxta/enums/status-of.step.d.ts +7 -7
- package/build/cjs/auxta/enums/status-of.step.js +11 -11
- package/build/cjs/auxta/helpers/response.helper.d.ts +10 -10
- package/build/cjs/auxta/helpers/response.helper.js +15 -15
- package/build/cjs/auxta/helpers/start.helper.d.ts +1 -1
- package/build/cjs/auxta/helpers/start.helper.js +26 -26
- package/build/cjs/auxta/hooks/report.hook.d.ts +14 -14
- package/build/cjs/auxta/hooks/report.hook.js +66 -66
- package/build/cjs/auxta/models/upload.model.d.ts +32 -32
- package/build/cjs/auxta/models/upload.model.js +75 -75
- package/build/cjs/auxta/services/log.service.d.ts +26 -26
- package/build/cjs/auxta/services/log.service.js +47 -47
- package/build/cjs/auxta/services/report.service.d.ts +36 -36
- package/build/cjs/auxta/services/report.service.js +164 -164
- package/build/cjs/auxta/services/runtime.service.d.ts +16 -16
- package/build/cjs/auxta/services/runtime.service.js +41 -41
- package/build/cjs/auxta/utilities/runtime.helper.d.ts +15 -15
- package/build/cjs/auxta/utilities/runtime.helper.js +19 -19
- package/build/cjs/auxta/utilities/screenshot.helper.d.ts +2 -2
- package/build/cjs/auxta/utilities/screenshot.helper.js +36 -36
- package/build/cjs/auxta/utilities/start-suite.helper.d.ts +17 -17
- package/build/cjs/auxta/utilities/start-suite.helper.js +31 -31
- package/build/cjs/macros/helpers/Aux2faAuth.d.ts +7 -7
- package/build/cjs/macros/helpers/Aux2faAuth.js +29 -29
- package/build/cjs/macros/helpers/AuxGoogleAuth.d.ts +17 -17
- package/build/cjs/macros/helpers/AuxGoogleAuth.js +104 -104
- package/build/cjs/macros/helpers/code.helper.d.ts +21 -21
- package/build/cjs/macros/helpers/code.helper.js +201 -201
- package/build/cjs/macros/helpers/emailHelper.d.ts +19 -23
- package/build/cjs/macros/helpers/emailHelper.js +167 -167
- package/build/cjs/macros/helpers/extend-default-page.d.ts +6 -6
- package/build/cjs/macros/helpers/extend-default-page.js +89 -89
- package/build/cjs/puppeteer/puppeteer.d.ts +25 -25
- package/build/cjs/puppeteer/puppeteer.js +203 -196
- package/build/esm/AuxTA.d.ts +61 -61
- package/build/esm/AuxTA.js +123 -123
- package/build/esm/auxta/configs/config.d.ts +54 -54
- package/build/esm/auxta/configs/config.js +60 -60
- package/build/esm/auxta/enums/status-of.step.d.ts +7 -7
- package/build/esm/auxta/enums/status-of.step.js +8 -8
- package/build/esm/auxta/helpers/response.helper.d.ts +10 -10
- package/build/esm/auxta/helpers/response.helper.js +11 -11
- package/build/esm/auxta/helpers/start.helper.d.ts +1 -1
- package/build/esm/auxta/helpers/start.helper.js +24 -24
- package/build/esm/auxta/hooks/report.hook.d.ts +14 -14
- package/build/esm/auxta/hooks/report.hook.js +58 -58
- package/build/esm/auxta/models/upload.model.d.ts +32 -32
- package/build/esm/auxta/models/upload.model.js +71 -71
- package/build/esm/auxta/services/log.service.d.ts +26 -26
- package/build/esm/auxta/services/log.service.js +43 -43
- package/build/esm/auxta/services/report.service.d.ts +36 -36
- package/build/esm/auxta/services/report.service.js +150 -150
- package/build/esm/auxta/services/runtime.service.d.ts +16 -16
- package/build/esm/auxta/services/runtime.service.js +37 -37
- package/build/esm/auxta/utilities/runtime.helper.d.ts +15 -15
- package/build/esm/auxta/utilities/runtime.helper.js +15 -15
- package/build/esm/auxta/utilities/screenshot.helper.d.ts +2 -2
- package/build/esm/auxta/utilities/screenshot.helper.js +29 -29
- package/build/esm/auxta/utilities/start-suite.helper.d.ts +17 -17
- package/build/esm/auxta/utilities/start-suite.helper.js +26 -26
- package/build/esm/macros/helpers/Aux2faAuth.d.ts +7 -7
- package/build/esm/macros/helpers/Aux2faAuth.js +25 -25
- package/build/esm/macros/helpers/AuxGoogleAuth.d.ts +17 -17
- package/build/esm/macros/helpers/AuxGoogleAuth.js +100 -100
- package/build/esm/macros/helpers/code.helper.d.ts +21 -21
- package/build/esm/macros/helpers/code.helper.js +194 -194
- package/build/esm/macros/helpers/emailHelper.d.ts +19 -23
- package/build/esm/macros/helpers/emailHelper.js +160 -160
- package/build/esm/macros/helpers/extend-default-page.d.ts +6 -6
- package/build/esm/macros/helpers/extend-default-page.js +82 -82
- package/build/esm/puppeteer/puppeteer.d.ts +25 -25
- package/build/esm/puppeteer/puppeteer.js +195 -188
- package/build/tsconfig-cjs.tsbuildinfo +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +33 -33
|
@@ -1,58 +1,58 @@
|
|
|
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 { basename } from 'path';
|
|
11
|
-
import log from "../services/log.service";
|
|
12
|
-
import { postNotifications, updateReport, uploadFeature, uploadScenario } from '../services/report.service';
|
|
13
|
-
import { startSuite } from '../utilities/start-suite.helper';
|
|
14
|
-
import { StatusOfStep } from "../enums/status-of.step";
|
|
15
|
-
export function onTestEnd(body, featureName, scenarioName, statusCode, screenshotBuffer, errMessage) {
|
|
16
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
let isFinal = false;
|
|
18
|
-
if (process.env.ENVIRONMENT == "LIVE") {
|
|
19
|
-
console.log('--- Uploading scenario and feature for AUXTA report ---');
|
|
20
|
-
const stepsArr = log.returnScenarioReport();
|
|
21
|
-
try {
|
|
22
|
-
const scenarioRes = yield uploadScenario(stepsArr, scenarioName, screenshotBuffer, errMessage);
|
|
23
|
-
const featureRes = yield uploadFeature(scenarioRes, featureName, basename(__filename), (statusCode != 200));
|
|
24
|
-
const feature = {
|
|
25
|
-
featureId: featureRes.featureRef,
|
|
26
|
-
featureName: featureRes.name,
|
|
27
|
-
featureUri: featureRes.uri,
|
|
28
|
-
status: featureRes.status,
|
|
29
|
-
scenariosCount: featureRes.scenariosCount
|
|
30
|
-
};
|
|
31
|
-
const stepCounts = {
|
|
32
|
-
failedSteps: log.getStatusCount(StatusOfStep.FAILED),
|
|
33
|
-
passedSteps: log.getStatusCount(StatusOfStep.PASSED),
|
|
34
|
-
skippedSteps: log.getStatusCount(StatusOfStep.SKIPPED),
|
|
35
|
-
suggestedSteps: log.getStatusCount(StatusOfStep.SUGGESTION)
|
|
36
|
-
};
|
|
37
|
-
isFinal = (!(body.nextSuites && body.nextSuites.length > 0));
|
|
38
|
-
yield updateReport(body.reportId, feature, stepCounts, isFinal);
|
|
39
|
-
console.log('--- Finished uploading report data to AUXTA ---');
|
|
40
|
-
}
|
|
41
|
-
catch (error) {
|
|
42
|
-
console.log('--- Failed to update report in AUXTA ---');
|
|
43
|
-
console.log(error);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
if (isFinal)
|
|
47
|
-
yield afterComplete(body);
|
|
48
|
-
else if (body && body.nextSuites) {
|
|
49
|
-
return yield startSuite(body.nextSuites, body.reportId);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
export function afterComplete(body) {
|
|
54
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
if (process.env.ENVIRONMENT == "LIVE")
|
|
56
|
-
yield postNotifications(body);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
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 { basename } from 'path';
|
|
11
|
+
import log from "../services/log.service";
|
|
12
|
+
import { postNotifications, updateReport, uploadFeature, uploadScenario } from '../services/report.service';
|
|
13
|
+
import { startSuite } from '../utilities/start-suite.helper';
|
|
14
|
+
import { StatusOfStep } from "../enums/status-of.step";
|
|
15
|
+
export function onTestEnd(body, featureName, scenarioName, statusCode, screenshotBuffer, errMessage) {
|
|
16
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
let isFinal = false;
|
|
18
|
+
if (process.env.ENVIRONMENT == "LIVE") {
|
|
19
|
+
console.log('--- Uploading scenario and feature for AUXTA report ---');
|
|
20
|
+
const stepsArr = log.returnScenarioReport();
|
|
21
|
+
try {
|
|
22
|
+
const scenarioRes = yield uploadScenario(stepsArr, scenarioName, screenshotBuffer, errMessage);
|
|
23
|
+
const featureRes = yield uploadFeature(scenarioRes, featureName, basename(__filename), (statusCode != 200));
|
|
24
|
+
const feature = {
|
|
25
|
+
featureId: featureRes.featureRef,
|
|
26
|
+
featureName: featureRes.name,
|
|
27
|
+
featureUri: featureRes.uri,
|
|
28
|
+
status: featureRes.status,
|
|
29
|
+
scenariosCount: featureRes.scenariosCount
|
|
30
|
+
};
|
|
31
|
+
const stepCounts = {
|
|
32
|
+
failedSteps: log.getStatusCount(StatusOfStep.FAILED),
|
|
33
|
+
passedSteps: log.getStatusCount(StatusOfStep.PASSED),
|
|
34
|
+
skippedSteps: log.getStatusCount(StatusOfStep.SKIPPED),
|
|
35
|
+
suggestedSteps: log.getStatusCount(StatusOfStep.SUGGESTION)
|
|
36
|
+
};
|
|
37
|
+
isFinal = (!(body.nextSuites && body.nextSuites.length > 0));
|
|
38
|
+
yield updateReport(body.reportId, feature, stepCounts, isFinal);
|
|
39
|
+
console.log('--- Finished uploading report data to AUXTA ---');
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
console.log('--- Failed to update report in AUXTA ---');
|
|
43
|
+
console.log(error);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (isFinal)
|
|
47
|
+
yield afterComplete(body);
|
|
48
|
+
else if (body && body.nextSuites) {
|
|
49
|
+
return yield startSuite(body.nextSuites, body.reportId);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
export function afterComplete(body) {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
if (process.env.ENVIRONMENT == "LIVE")
|
|
56
|
+
yield postNotifications(body);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
export declare class UploadModel {
|
|
2
|
-
private _reportId;
|
|
3
|
-
private _nextSuites;
|
|
4
|
-
private _digitalProduct;
|
|
5
|
-
private _baseUrl;
|
|
6
|
-
private readonly _organization;
|
|
7
|
-
private _environment;
|
|
8
|
-
private _currentSuite;
|
|
9
|
-
private _retries;
|
|
10
|
-
private _featureName;
|
|
11
|
-
private _scenarioName;
|
|
12
|
-
constructor(org: string, baseUrl: string, digitalProduct: string, environment: string);
|
|
13
|
-
set currentSuite(value: string);
|
|
14
|
-
set retries(value: number);
|
|
15
|
-
get currentSuite(): string;
|
|
16
|
-
get retries(): number;
|
|
17
|
-
get reportId(): string;
|
|
18
|
-
set reportId(value: string);
|
|
19
|
-
get nextSuites(): [];
|
|
20
|
-
set nextSuites(value: []);
|
|
21
|
-
get digitalProduct(): string;
|
|
22
|
-
set digitalProduct(value: string);
|
|
23
|
-
get organization(): string;
|
|
24
|
-
get baseUrl(): string;
|
|
25
|
-
set baseUrl(value: string);
|
|
26
|
-
get environment(): string;
|
|
27
|
-
set environment(value: string);
|
|
28
|
-
get featureName(): string;
|
|
29
|
-
set featureName(value: string);
|
|
30
|
-
get scenarioName(): string;
|
|
31
|
-
set scenarioName(value: string);
|
|
32
|
-
}
|
|
1
|
+
export declare class UploadModel {
|
|
2
|
+
private _reportId;
|
|
3
|
+
private _nextSuites;
|
|
4
|
+
private _digitalProduct;
|
|
5
|
+
private _baseUrl;
|
|
6
|
+
private readonly _organization;
|
|
7
|
+
private _environment;
|
|
8
|
+
private _currentSuite;
|
|
9
|
+
private _retries;
|
|
10
|
+
private _featureName;
|
|
11
|
+
private _scenarioName;
|
|
12
|
+
constructor(org: string, baseUrl: string, digitalProduct: string, environment: string);
|
|
13
|
+
set currentSuite(value: string);
|
|
14
|
+
set retries(value: number);
|
|
15
|
+
get currentSuite(): string;
|
|
16
|
+
get retries(): number;
|
|
17
|
+
get reportId(): string;
|
|
18
|
+
set reportId(value: string);
|
|
19
|
+
get nextSuites(): [];
|
|
20
|
+
set nextSuites(value: []);
|
|
21
|
+
get digitalProduct(): string;
|
|
22
|
+
set digitalProduct(value: string);
|
|
23
|
+
get organization(): string;
|
|
24
|
+
get baseUrl(): string;
|
|
25
|
+
set baseUrl(value: string);
|
|
26
|
+
get environment(): string;
|
|
27
|
+
set environment(value: string);
|
|
28
|
+
get featureName(): string;
|
|
29
|
+
set featureName(value: string);
|
|
30
|
+
get scenarioName(): string;
|
|
31
|
+
set scenarioName(value: string);
|
|
32
|
+
}
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
export class UploadModel {
|
|
2
|
-
constructor(org, baseUrl, digitalProduct, environment) {
|
|
3
|
-
this._reportId = '';
|
|
4
|
-
this._nextSuites = [];
|
|
5
|
-
this._currentSuite = '';
|
|
6
|
-
this._retries = 0;
|
|
7
|
-
this._organization = org;
|
|
8
|
-
this._digitalProduct = digitalProduct;
|
|
9
|
-
this._environment = environment;
|
|
10
|
-
this._baseUrl = baseUrl;
|
|
11
|
-
this._featureName = '';
|
|
12
|
-
this._scenarioName = '';
|
|
13
|
-
}
|
|
14
|
-
set currentSuite(value) {
|
|
15
|
-
this._currentSuite = value;
|
|
16
|
-
}
|
|
17
|
-
set retries(value) {
|
|
18
|
-
this._retries = value;
|
|
19
|
-
}
|
|
20
|
-
get currentSuite() {
|
|
21
|
-
return this._currentSuite;
|
|
22
|
-
}
|
|
23
|
-
get retries() {
|
|
24
|
-
return this._retries;
|
|
25
|
-
}
|
|
26
|
-
get reportId() {
|
|
27
|
-
return this._reportId;
|
|
28
|
-
}
|
|
29
|
-
set reportId(value) {
|
|
30
|
-
this._reportId = value;
|
|
31
|
-
}
|
|
32
|
-
get nextSuites() {
|
|
33
|
-
return this._nextSuites;
|
|
34
|
-
}
|
|
35
|
-
set nextSuites(value) {
|
|
36
|
-
this._nextSuites = value;
|
|
37
|
-
}
|
|
38
|
-
get digitalProduct() {
|
|
39
|
-
return this._digitalProduct;
|
|
40
|
-
}
|
|
41
|
-
set digitalProduct(value) {
|
|
42
|
-
this._digitalProduct = value;
|
|
43
|
-
}
|
|
44
|
-
get organization() {
|
|
45
|
-
return this._organization;
|
|
46
|
-
}
|
|
47
|
-
get baseUrl() {
|
|
48
|
-
return this._baseUrl;
|
|
49
|
-
}
|
|
50
|
-
set baseUrl(value) {
|
|
51
|
-
this._baseUrl = value;
|
|
52
|
-
}
|
|
53
|
-
get environment() {
|
|
54
|
-
return this._environment;
|
|
55
|
-
}
|
|
56
|
-
set environment(value) {
|
|
57
|
-
this._environment = value;
|
|
58
|
-
}
|
|
59
|
-
get featureName() {
|
|
60
|
-
return this._featureName;
|
|
61
|
-
}
|
|
62
|
-
set featureName(value) {
|
|
63
|
-
this._featureName = value;
|
|
64
|
-
}
|
|
65
|
-
get scenarioName() {
|
|
66
|
-
return this._scenarioName;
|
|
67
|
-
}
|
|
68
|
-
set scenarioName(value) {
|
|
69
|
-
this._scenarioName = value;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
1
|
+
export class UploadModel {
|
|
2
|
+
constructor(org, baseUrl, digitalProduct, environment) {
|
|
3
|
+
this._reportId = '';
|
|
4
|
+
this._nextSuites = [];
|
|
5
|
+
this._currentSuite = '';
|
|
6
|
+
this._retries = 0;
|
|
7
|
+
this._organization = org;
|
|
8
|
+
this._digitalProduct = digitalProduct;
|
|
9
|
+
this._environment = environment;
|
|
10
|
+
this._baseUrl = baseUrl;
|
|
11
|
+
this._featureName = '';
|
|
12
|
+
this._scenarioName = '';
|
|
13
|
+
}
|
|
14
|
+
set currentSuite(value) {
|
|
15
|
+
this._currentSuite = value;
|
|
16
|
+
}
|
|
17
|
+
set retries(value) {
|
|
18
|
+
this._retries = value;
|
|
19
|
+
}
|
|
20
|
+
get currentSuite() {
|
|
21
|
+
return this._currentSuite;
|
|
22
|
+
}
|
|
23
|
+
get retries() {
|
|
24
|
+
return this._retries;
|
|
25
|
+
}
|
|
26
|
+
get reportId() {
|
|
27
|
+
return this._reportId;
|
|
28
|
+
}
|
|
29
|
+
set reportId(value) {
|
|
30
|
+
this._reportId = value;
|
|
31
|
+
}
|
|
32
|
+
get nextSuites() {
|
|
33
|
+
return this._nextSuites;
|
|
34
|
+
}
|
|
35
|
+
set nextSuites(value) {
|
|
36
|
+
this._nextSuites = value;
|
|
37
|
+
}
|
|
38
|
+
get digitalProduct() {
|
|
39
|
+
return this._digitalProduct;
|
|
40
|
+
}
|
|
41
|
+
set digitalProduct(value) {
|
|
42
|
+
this._digitalProduct = value;
|
|
43
|
+
}
|
|
44
|
+
get organization() {
|
|
45
|
+
return this._organization;
|
|
46
|
+
}
|
|
47
|
+
get baseUrl() {
|
|
48
|
+
return this._baseUrl;
|
|
49
|
+
}
|
|
50
|
+
set baseUrl(value) {
|
|
51
|
+
this._baseUrl = value;
|
|
52
|
+
}
|
|
53
|
+
get environment() {
|
|
54
|
+
return this._environment;
|
|
55
|
+
}
|
|
56
|
+
set environment(value) {
|
|
57
|
+
this._environment = value;
|
|
58
|
+
}
|
|
59
|
+
get featureName() {
|
|
60
|
+
return this._featureName;
|
|
61
|
+
}
|
|
62
|
+
set featureName(value) {
|
|
63
|
+
this._featureName = value;
|
|
64
|
+
}
|
|
65
|
+
get scenarioName() {
|
|
66
|
+
return this._scenarioName;
|
|
67
|
+
}
|
|
68
|
+
set scenarioName(value) {
|
|
69
|
+
this._scenarioName = value;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { StatusOfStep } from "../enums/status-of.step";
|
|
2
|
-
export interface Step {
|
|
3
|
-
keyword: string;
|
|
4
|
-
name: string;
|
|
5
|
-
result: {
|
|
6
|
-
status: StatusOfStep;
|
|
7
|
-
duration: number;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
export declare class LogSteps {
|
|
11
|
-
private stepLog;
|
|
12
|
-
private lastStepTime;
|
|
13
|
-
statusCounter: {
|
|
14
|
-
passed: number;
|
|
15
|
-
failed: number;
|
|
16
|
-
skipped: number;
|
|
17
|
-
suggestion: number;
|
|
18
|
-
};
|
|
19
|
-
addSuggestion(text: string): void;
|
|
20
|
-
clear(): void;
|
|
21
|
-
push(keyword: string, name: string, status: StatusOfStep): void;
|
|
22
|
-
returnScenarioReport(): Step[];
|
|
23
|
-
getStatusCount(status: StatusOfStep): number;
|
|
24
|
-
}
|
|
25
|
-
declare const log: LogSteps;
|
|
26
|
-
export default log;
|
|
1
|
+
import { StatusOfStep } from "../enums/status-of.step";
|
|
2
|
+
export interface Step {
|
|
3
|
+
keyword: string;
|
|
4
|
+
name: string;
|
|
5
|
+
result: {
|
|
6
|
+
status: StatusOfStep;
|
|
7
|
+
duration: number;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export declare class LogSteps {
|
|
11
|
+
private stepLog;
|
|
12
|
+
private lastStepTime;
|
|
13
|
+
statusCounter: {
|
|
14
|
+
passed: number;
|
|
15
|
+
failed: number;
|
|
16
|
+
skipped: number;
|
|
17
|
+
suggestion: number;
|
|
18
|
+
};
|
|
19
|
+
addSuggestion(text: string): void;
|
|
20
|
+
clear(): void;
|
|
21
|
+
push(keyword: string, name: string, status: StatusOfStep): void;
|
|
22
|
+
returnScenarioReport(): Step[];
|
|
23
|
+
getStatusCount(status: StatusOfStep): number;
|
|
24
|
+
}
|
|
25
|
+
declare const log: LogSteps;
|
|
26
|
+
export default log;
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { StatusOfStep } from "../enums/status-of.step";
|
|
2
|
-
export class LogSteps {
|
|
3
|
-
constructor() {
|
|
4
|
-
this.stepLog = [];
|
|
5
|
-
this.lastStepTime = new Date().getTime();
|
|
6
|
-
this.statusCounter = {
|
|
7
|
-
[StatusOfStep.PASSED]: 0,
|
|
8
|
-
[StatusOfStep.FAILED]: 0,
|
|
9
|
-
[StatusOfStep.SKIPPED]: 0,
|
|
10
|
-
[StatusOfStep.SUGGESTION]: 0,
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
addSuggestion(text) {
|
|
14
|
-
this.statusCounter[StatusOfStep.SUGGESTION]++;
|
|
15
|
-
this.stepLog.push({
|
|
16
|
-
keyword: 'Suggestion', name: text, result: { status: StatusOfStep.SUGGESTION, duration: 0 }
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
clear() {
|
|
20
|
-
this.stepLog = [];
|
|
21
|
-
this.statusCounter = {
|
|
22
|
-
[StatusOfStep.PASSED]: 0,
|
|
23
|
-
[StatusOfStep.FAILED]: 0,
|
|
24
|
-
[StatusOfStep.SKIPPED]: 0,
|
|
25
|
-
[StatusOfStep.SUGGESTION]: 0,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
push(keyword, name, status) {
|
|
29
|
-
console.log(`System log -- status: ${status} -- : ${name} `);
|
|
30
|
-
this.statusCounter[status]++;
|
|
31
|
-
const currentStep = new Date().getTime();
|
|
32
|
-
this.stepLog.push({ keyword, name, result: { status, duration: currentStep - this.lastStepTime } });
|
|
33
|
-
this.lastStepTime = currentStep;
|
|
34
|
-
}
|
|
35
|
-
returnScenarioReport() {
|
|
36
|
-
return this.stepLog;
|
|
37
|
-
}
|
|
38
|
-
getStatusCount(status) {
|
|
39
|
-
return this.statusCounter[status];
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
const log = new LogSteps();
|
|
43
|
-
export default log;
|
|
1
|
+
import { StatusOfStep } from "../enums/status-of.step";
|
|
2
|
+
export class LogSteps {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.stepLog = [];
|
|
5
|
+
this.lastStepTime = new Date().getTime();
|
|
6
|
+
this.statusCounter = {
|
|
7
|
+
[StatusOfStep.PASSED]: 0,
|
|
8
|
+
[StatusOfStep.FAILED]: 0,
|
|
9
|
+
[StatusOfStep.SKIPPED]: 0,
|
|
10
|
+
[StatusOfStep.SUGGESTION]: 0,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
addSuggestion(text) {
|
|
14
|
+
this.statusCounter[StatusOfStep.SUGGESTION]++;
|
|
15
|
+
this.stepLog.push({
|
|
16
|
+
keyword: 'Suggestion', name: text, result: { status: StatusOfStep.SUGGESTION, duration: 0 }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
clear() {
|
|
20
|
+
this.stepLog = [];
|
|
21
|
+
this.statusCounter = {
|
|
22
|
+
[StatusOfStep.PASSED]: 0,
|
|
23
|
+
[StatusOfStep.FAILED]: 0,
|
|
24
|
+
[StatusOfStep.SKIPPED]: 0,
|
|
25
|
+
[StatusOfStep.SUGGESTION]: 0,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
push(keyword, name, status) {
|
|
29
|
+
console.log(`System log -- status: ${status} -- : ${name} `);
|
|
30
|
+
this.statusCounter[status]++;
|
|
31
|
+
const currentStep = new Date().getTime();
|
|
32
|
+
this.stepLog.push({ keyword, name, result: { status, duration: currentStep - this.lastStepTime } });
|
|
33
|
+
this.lastStepTime = currentStep;
|
|
34
|
+
}
|
|
35
|
+
returnScenarioReport() {
|
|
36
|
+
return this.stepLog;
|
|
37
|
+
}
|
|
38
|
+
getStatusCount(status) {
|
|
39
|
+
return this.statusCounter[status];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const log = new LogSteps();
|
|
43
|
+
export default log;
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Step } from "./log.service";
|
|
3
|
-
import { UploadModel } from "../models/upload.model";
|
|
4
|
-
export interface Feature {
|
|
5
|
-
featureId: string;
|
|
6
|
-
featureName: string;
|
|
7
|
-
featureUri: string;
|
|
8
|
-
status: string;
|
|
9
|
-
scenariosCount: number;
|
|
10
|
-
}
|
|
11
|
-
export interface Scenario {
|
|
12
|
-
featureId: string;
|
|
13
|
-
featureName: string;
|
|
14
|
-
featureUri: string;
|
|
15
|
-
status: string;
|
|
16
|
-
scenariosCount: number;
|
|
17
|
-
}
|
|
18
|
-
export interface Steps {
|
|
19
|
-
failedSteps: number;
|
|
20
|
-
passedSteps: number;
|
|
21
|
-
skippedSteps: number;
|
|
22
|
-
suggestedSteps: number;
|
|
23
|
-
}
|
|
24
|
-
export declare function createEmptyReport(body: any): Promise<string>;
|
|
25
|
-
export declare function uploadScenario(stepLog: Step[], scenarioName: string, screenshot?: Buffer, errMessage?: object): Promise<{
|
|
26
|
-
scenarioRef: any;
|
|
27
|
-
name: any;
|
|
28
|
-
status: any;
|
|
29
|
-
stepsCount: any;
|
|
30
|
-
}[]>;
|
|
31
|
-
export declare function uploadFeature(scenarioId: any[], scenarioName: string, uri: string, hasFailed: boolean): Promise<any>;
|
|
32
|
-
export declare function updateReport(reportId: string, feature: Feature, steps: Steps, isFinal: boolean): Promise<void>;
|
|
33
|
-
export declare function getReport(reportId: string): Promise<any>;
|
|
34
|
-
export declare function getLastDayResults(): Promise<any>;
|
|
35
|
-
export declare function postNotifications(body: UploadModel): Promise<void>;
|
|
36
|
-
export declare function postNotificationsOnFail(body: UploadModel): Promise<void>;
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Step } from "./log.service";
|
|
3
|
+
import { UploadModel } from "../models/upload.model";
|
|
4
|
+
export interface Feature {
|
|
5
|
+
featureId: string;
|
|
6
|
+
featureName: string;
|
|
7
|
+
featureUri: string;
|
|
8
|
+
status: string;
|
|
9
|
+
scenariosCount: number;
|
|
10
|
+
}
|
|
11
|
+
export interface Scenario {
|
|
12
|
+
featureId: string;
|
|
13
|
+
featureName: string;
|
|
14
|
+
featureUri: string;
|
|
15
|
+
status: string;
|
|
16
|
+
scenariosCount: number;
|
|
17
|
+
}
|
|
18
|
+
export interface Steps {
|
|
19
|
+
failedSteps: number;
|
|
20
|
+
passedSteps: number;
|
|
21
|
+
skippedSteps: number;
|
|
22
|
+
suggestedSteps: number;
|
|
23
|
+
}
|
|
24
|
+
export declare function createEmptyReport(body: any): Promise<string>;
|
|
25
|
+
export declare function uploadScenario(stepLog: Step[], scenarioName: string, screenshot?: Buffer, errMessage?: object): Promise<{
|
|
26
|
+
scenarioRef: any;
|
|
27
|
+
name: any;
|
|
28
|
+
status: any;
|
|
29
|
+
stepsCount: any;
|
|
30
|
+
}[]>;
|
|
31
|
+
export declare function uploadFeature(scenarioId: any[], scenarioName: string, uri: string, hasFailed: boolean): Promise<any>;
|
|
32
|
+
export declare function updateReport(reportId: string, feature: Feature, steps: Steps, isFinal: boolean): Promise<void>;
|
|
33
|
+
export declare function getReport(reportId: string): Promise<any>;
|
|
34
|
+
export declare function getLastDayResults(): Promise<any>;
|
|
35
|
+
export declare function postNotifications(body: UploadModel): Promise<void>;
|
|
36
|
+
export declare function postNotificationsOnFail(body: UploadModel): Promise<void>;
|