@auxcode/auxta 1.3.45-beta.0 → 1.3.45-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/build/cjs/AuxTA.d.ts +62 -0
- package/build/cjs/AuxTA.js +154 -0
- package/build/cjs/auxta/configs/config.d.ts +57 -0
- package/build/cjs/auxta/configs/config.js +69 -0
- package/build/cjs/auxta/enums/status-of.step.d.ts +7 -0
- package/build/cjs/auxta/enums/status-of.step.js +11 -0
- package/build/cjs/auxta/helpers/response.helper.d.ts +10 -0
- package/build/cjs/auxta/helpers/response.helper.js +15 -0
- package/build/cjs/auxta/helpers/start.helper.d.ts +1 -0
- package/build/cjs/auxta/helpers/start.helper.js +26 -0
- package/build/cjs/auxta/hooks/report.hook.d.ts +14 -0
- package/build/cjs/auxta/hooks/report.hook.js +67 -0
- package/build/cjs/auxta/models/upload.model.d.ts +35 -0
- package/build/cjs/auxta/models/upload.model.js +82 -0
- package/build/cjs/auxta/services/log.service.d.ts +30 -0
- package/build/cjs/auxta/services/log.service.js +60 -0
- package/build/cjs/auxta/services/report.service.d.ts +30 -0
- package/build/cjs/auxta/services/report.service.js +168 -0
- package/build/cjs/auxta/services/runtime.service.d.ts +16 -0
- package/build/cjs/auxta/services/runtime.service.js +41 -0
- package/build/cjs/auxta/utilities/runtime.helper.d.ts +15 -0
- package/build/cjs/auxta/utilities/runtime.helper.js +19 -0
- package/build/cjs/auxta/utilities/screenshot.helper.d.ts +4 -0
- package/build/cjs/auxta/utilities/screenshot.helper.js +57 -0
- package/build/cjs/auxta/utilities/start-suite.helper.d.ts +17 -0
- package/build/cjs/auxta/utilities/start-suite.helper.js +31 -0
- package/build/cjs/macros/helpers/Aux2faAuth.d.ts +7 -0
- package/build/cjs/macros/helpers/Aux2faAuth.js +29 -0
- package/build/cjs/macros/helpers/AuxGoogleAuth.d.ts +17 -0
- package/build/cjs/macros/helpers/AuxGoogleAuth.js +104 -0
- package/build/cjs/macros/helpers/code.helper.d.ts +22 -0
- package/build/cjs/macros/helpers/code.helper.js +210 -0
- package/build/cjs/macros/helpers/emailHelper.d.ts +19 -0
- package/build/cjs/macros/helpers/emailHelper.js +177 -0
- package/build/cjs/macros/helpers/extend-default-page.d.ts +6 -0
- package/build/cjs/macros/helpers/extend-default-page.js +89 -0
- package/build/cjs/puppeteer/puppeteer.d.ts +25 -0
- package/build/cjs/puppeteer/puppeteer.js +210 -0
- package/build/esm/AuxTA.d.ts +62 -0
- package/build/esm/AuxTA.js +125 -0
- package/build/esm/auxta/configs/config.d.ts +57 -0
- package/build/esm/auxta/configs/config.js +64 -0
- package/build/esm/auxta/enums/status-of.step.d.ts +7 -0
- package/build/esm/auxta/enums/status-of.step.js +8 -0
- package/build/esm/auxta/helpers/response.helper.d.ts +10 -0
- package/build/esm/auxta/helpers/response.helper.js +11 -0
- package/build/esm/auxta/helpers/start.helper.d.ts +1 -0
- package/build/esm/auxta/helpers/start.helper.js +24 -0
- package/build/esm/auxta/hooks/report.hook.d.ts +14 -0
- package/build/esm/auxta/hooks/report.hook.js +59 -0
- package/build/esm/auxta/models/upload.model.d.ts +35 -0
- package/build/esm/auxta/models/upload.model.js +78 -0
- package/build/esm/auxta/services/log.service.d.ts +30 -0
- package/build/esm/auxta/services/log.service.js +56 -0
- package/build/esm/auxta/services/report.service.d.ts +30 -0
- package/build/esm/auxta/services/report.service.js +154 -0
- package/build/esm/auxta/services/runtime.service.d.ts +16 -0
- package/build/esm/auxta/services/runtime.service.js +37 -0
- package/build/esm/auxta/utilities/runtime.helper.d.ts +15 -0
- package/build/esm/auxta/utilities/runtime.helper.js +15 -0
- package/build/esm/auxta/utilities/screenshot.helper.d.ts +4 -0
- package/build/esm/auxta/utilities/screenshot.helper.js +49 -0
- package/build/esm/auxta/utilities/start-suite.helper.d.ts +17 -0
- package/build/esm/auxta/utilities/start-suite.helper.js +26 -0
- package/build/esm/macros/helpers/Aux2faAuth.d.ts +7 -0
- package/build/esm/macros/helpers/Aux2faAuth.js +25 -0
- package/build/esm/macros/helpers/AuxGoogleAuth.d.ts +17 -0
- package/build/esm/macros/helpers/AuxGoogleAuth.js +100 -0
- package/build/esm/macros/helpers/code.helper.d.ts +22 -0
- package/build/esm/macros/helpers/code.helper.js +203 -0
- package/build/esm/macros/helpers/emailHelper.d.ts +19 -0
- package/build/esm/macros/helpers/emailHelper.js +170 -0
- package/build/esm/macros/helpers/extend-default-page.d.ts +6 -0
- package/build/esm/macros/helpers/extend-default-page.js +82 -0
- package/build/esm/puppeteer/puppeteer.d.ts +25 -0
- package/build/esm/puppeteer/puppeteer.js +202 -0
- package/build/tsconfig-cjs.tsbuildinfo +1 -0
- package/build/tsconfig.tsbuildinfo +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Puppeteer } from "./puppeteer/puppeteer";
|
|
2
|
+
import { FunctionHelper } from "./macros/helpers/code.helper";
|
|
3
|
+
import StatusOfStep from "./auxta/enums/status-of.step";
|
|
4
|
+
import { UploadModel } from "./auxta/models/upload.model";
|
|
5
|
+
import { AuxGoogleAuth } from "./macros/helpers/AuxGoogleAuth";
|
|
6
|
+
declare class AuxTA extends FunctionHelper {
|
|
7
|
+
puppeteer: Puppeteer;
|
|
8
|
+
aux2fa: import("./macros/helpers/Aux2faAuth").Aux2faAuth;
|
|
9
|
+
google: typeof AuxGoogleAuth;
|
|
10
|
+
config: {
|
|
11
|
+
auxtaURL: string;
|
|
12
|
+
baseURL: string;
|
|
13
|
+
siteURL: string;
|
|
14
|
+
organization: string;
|
|
15
|
+
netlifyPath: string;
|
|
16
|
+
digitalProduct: string;
|
|
17
|
+
bucket: string;
|
|
18
|
+
token: string;
|
|
19
|
+
screenWidth: number;
|
|
20
|
+
screenHeight: number;
|
|
21
|
+
timeout: number;
|
|
22
|
+
suitesList: never[];
|
|
23
|
+
googleEmail: string;
|
|
24
|
+
auxtaCredentials: {
|
|
25
|
+
email: string;
|
|
26
|
+
password: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
email: import("./macros/helpers/emailHelper").EmailHelper;
|
|
30
|
+
private readonly uploadModel;
|
|
31
|
+
constructor();
|
|
32
|
+
run(event: any, overrideConfig?: any): Promise<{
|
|
33
|
+
nextSuites?: undefined;
|
|
34
|
+
reportId?: undefined;
|
|
35
|
+
currentSuite?: undefined;
|
|
36
|
+
retries?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
nextSuites: string[];
|
|
39
|
+
reportId: string | undefined;
|
|
40
|
+
currentSuite: string | undefined;
|
|
41
|
+
retries: string;
|
|
42
|
+
}>;
|
|
43
|
+
private changeModelData;
|
|
44
|
+
startBrowser(event: any, callback: any, feature: string, scenario: string, overrideConfig?: any, singleFeature?: boolean, fileName?: string): Promise<{
|
|
45
|
+
nextSuites?: undefined;
|
|
46
|
+
reportId?: undefined;
|
|
47
|
+
currentSuite?: undefined;
|
|
48
|
+
retries?: undefined;
|
|
49
|
+
} | {
|
|
50
|
+
nextSuites: string[];
|
|
51
|
+
reportId: string | undefined;
|
|
52
|
+
currentSuite: string | undefined;
|
|
53
|
+
retries: string;
|
|
54
|
+
} | {
|
|
55
|
+
statusCode: number;
|
|
56
|
+
} | undefined>;
|
|
57
|
+
startBrowserRPA(event: any, callback: any, baseURL: string, fileName?: string): Promise<any>;
|
|
58
|
+
getUploadModel(): UploadModel;
|
|
59
|
+
}
|
|
60
|
+
export declare const StepStatus: typeof StatusOfStep;
|
|
61
|
+
declare const auxta: AuxTA;
|
|
62
|
+
export default auxta;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.StepStatus = void 0;
|
|
39
|
+
const puppeteer_1 = __importDefault(require("./puppeteer/puppeteer"));
|
|
40
|
+
const code_helper_1 = require("./macros/helpers/code.helper");
|
|
41
|
+
const path_1 = __importDefault(require("path"));
|
|
42
|
+
const fs_1 = __importDefault(require("fs"));
|
|
43
|
+
const status_of_step_1 = __importDefault(require("./auxta/enums/status-of.step"));
|
|
44
|
+
const upload_model_1 = require("./auxta/models/upload.model");
|
|
45
|
+
const dotenv = __importStar(require("dotenv"));
|
|
46
|
+
const config_1 = require("./auxta/configs/config");
|
|
47
|
+
const start_suite_helper_1 = require("./auxta/utilities/start-suite.helper");
|
|
48
|
+
const report_service_1 = require("./auxta/services/report.service");
|
|
49
|
+
const Aux2faAuth_1 = __importDefault(require("./macros/helpers/Aux2faAuth"));
|
|
50
|
+
const AuxGoogleAuth_1 = require("./macros/helpers/AuxGoogleAuth");
|
|
51
|
+
const emailHelper_1 = __importDefault(require("./macros/helpers/emailHelper"));
|
|
52
|
+
dotenv.config();
|
|
53
|
+
class AuxTA extends code_helper_1.FunctionHelper {
|
|
54
|
+
constructor() {
|
|
55
|
+
super();
|
|
56
|
+
this.puppeteer = puppeteer_1.default;
|
|
57
|
+
this.aux2fa = Aux2faAuth_1.default;
|
|
58
|
+
this.google = AuxGoogleAuth_1.AuxGoogleAuth;
|
|
59
|
+
this.config = config_1.config;
|
|
60
|
+
this.email = emailHelper_1.default;
|
|
61
|
+
let file;
|
|
62
|
+
if (!process.env.RPA) {
|
|
63
|
+
try {
|
|
64
|
+
let currentDir = "";
|
|
65
|
+
while (true) {
|
|
66
|
+
file = path_1.default.join(__dirname, currentDir, "auxta.json");
|
|
67
|
+
if (!fs_1.default.existsSync(file)) {
|
|
68
|
+
currentDir += "../";
|
|
69
|
+
if (currentDir.length >= 30) {
|
|
70
|
+
console.log("auxta.json file not found!");
|
|
71
|
+
process.exit(1);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
const jsonConfig = JSON.parse(fs_1.default.readFileSync(file).toString());
|
|
79
|
+
try {
|
|
80
|
+
this.config = (0, config_1.setupConfig)(jsonConfig);
|
|
81
|
+
}
|
|
82
|
+
catch (e) {
|
|
83
|
+
console.log("Missing field in auxta.json:", e);
|
|
84
|
+
}
|
|
85
|
+
this.uploadModel = new upload_model_1.UploadModel(jsonConfig.organization, jsonConfig.baseURL, jsonConfig.digitalProduct, jsonConfig.environment, jsonConfig.bucket);
|
|
86
|
+
}
|
|
87
|
+
catch (e) {
|
|
88
|
+
console.log("Missing or corrupted config: auxta.json. Searching in location:", file);
|
|
89
|
+
console.log(e);
|
|
90
|
+
process.exit(1);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
this.uploadModel = new upload_model_1.UploadModel('', '', '', '', '');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
run(event, overrideConfig) {
|
|
98
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
this.changeModelData(overrideConfig);
|
|
100
|
+
let reportId;
|
|
101
|
+
try {
|
|
102
|
+
if (event.reportId) {
|
|
103
|
+
reportId = event.reportId;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
catch (e) {
|
|
107
|
+
reportId = undefined;
|
|
108
|
+
}
|
|
109
|
+
const suites = this.config.suitesList.slice(0);
|
|
110
|
+
return (0, start_suite_helper_1.startSuite)(suites, reportId || (yield (0, report_service_1.createEmptyReport)(this.uploadModel)));
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
changeModelData(overrideConfig) {
|
|
114
|
+
if (overrideConfig) {
|
|
115
|
+
if (overrideConfig.digitalProduct)
|
|
116
|
+
this.uploadModel.digitalProduct = overrideConfig.digitalProduct;
|
|
117
|
+
if (overrideConfig.environment)
|
|
118
|
+
this.uploadModel.environment = overrideConfig.environment;
|
|
119
|
+
if (overrideConfig.baseURL)
|
|
120
|
+
this.uploadModel.baseUrl = overrideConfig.baseURL;
|
|
121
|
+
if (overrideConfig.bucket)
|
|
122
|
+
this.uploadModel.bucket = overrideConfig.bucket;
|
|
123
|
+
this.config = (0, config_1.setupOverrideConfig)(overrideConfig);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
startBrowser(event, callback, feature, scenario, overrideConfig, singleFeature = false, fileName = '') {
|
|
127
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
128
|
+
this.changeModelData(overrideConfig);
|
|
129
|
+
if (singleFeature && process.env.ENVIRONMENT !== 'LOCAL') {
|
|
130
|
+
this.uploadModel.reportId = yield (0, report_service_1.createEmptyReport)(this.uploadModel);
|
|
131
|
+
this.uploadModel.currentSuite = fileName;
|
|
132
|
+
this.uploadModel.nextSuites = [];
|
|
133
|
+
}
|
|
134
|
+
return this.puppeteer.run(event, callback, feature, scenario);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
startBrowserRPA(event, callback, baseURL, fileName = '') {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
+
this.changeModelData({
|
|
140
|
+
baseURL: baseURL,
|
|
141
|
+
environment: '',
|
|
142
|
+
digitalProduct: ''
|
|
143
|
+
});
|
|
144
|
+
this.uploadModel.currentSuite = fileName;
|
|
145
|
+
return this.puppeteer.runRPA(event, callback);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
getUploadModel() {
|
|
149
|
+
return this.uploadModel;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
exports.StepStatus = status_of_step_1.default;
|
|
153
|
+
const auxta = new AuxTA();
|
|
154
|
+
exports.default = auxta;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare function setupConfig(jsonConfig: any): {
|
|
2
|
+
auxtaURL: string;
|
|
3
|
+
baseURL: string;
|
|
4
|
+
siteURL: string;
|
|
5
|
+
organization: string;
|
|
6
|
+
netlifyPath: string;
|
|
7
|
+
digitalProduct: string;
|
|
8
|
+
bucket: string;
|
|
9
|
+
token: string;
|
|
10
|
+
screenWidth: number;
|
|
11
|
+
screenHeight: number;
|
|
12
|
+
timeout: number;
|
|
13
|
+
suitesList: never[];
|
|
14
|
+
googleEmail: string;
|
|
15
|
+
auxtaCredentials: {
|
|
16
|
+
email: string;
|
|
17
|
+
password: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare function setupOverrideConfig(overrideConfig: any): {
|
|
21
|
+
auxtaURL: string;
|
|
22
|
+
baseURL: string;
|
|
23
|
+
siteURL: string;
|
|
24
|
+
organization: string;
|
|
25
|
+
netlifyPath: string;
|
|
26
|
+
digitalProduct: string;
|
|
27
|
+
bucket: string;
|
|
28
|
+
token: string;
|
|
29
|
+
screenWidth: number;
|
|
30
|
+
screenHeight: number;
|
|
31
|
+
timeout: number;
|
|
32
|
+
suitesList: never[];
|
|
33
|
+
googleEmail: string;
|
|
34
|
+
auxtaCredentials: {
|
|
35
|
+
email: string;
|
|
36
|
+
password: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export declare let config: {
|
|
40
|
+
auxtaURL: string;
|
|
41
|
+
baseURL: string;
|
|
42
|
+
siteURL: string;
|
|
43
|
+
organization: string;
|
|
44
|
+
netlifyPath: string;
|
|
45
|
+
digitalProduct: string;
|
|
46
|
+
bucket: string;
|
|
47
|
+
token: string;
|
|
48
|
+
screenWidth: number;
|
|
49
|
+
screenHeight: number;
|
|
50
|
+
timeout: number;
|
|
51
|
+
suitesList: never[];
|
|
52
|
+
googleEmail: string;
|
|
53
|
+
auxtaCredentials: {
|
|
54
|
+
email: string;
|
|
55
|
+
password: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.config = exports.setupOverrideConfig = exports.setupConfig = void 0;
|
|
4
|
+
function setupConfig(jsonConfig) {
|
|
5
|
+
if (!jsonConfig.baseURL)
|
|
6
|
+
throw new Error("baseURL");
|
|
7
|
+
exports.config.baseURL = jsonConfig.baseURL;
|
|
8
|
+
if (!jsonConfig.digitalProduct)
|
|
9
|
+
throw new Error("digitalProduct");
|
|
10
|
+
exports.config.digitalProduct = jsonConfig.digitalProduct;
|
|
11
|
+
if (!jsonConfig.testsURL)
|
|
12
|
+
throw new Error("testsURL");
|
|
13
|
+
exports.config.bucket = jsonConfig.bucket;
|
|
14
|
+
if (!jsonConfig.testsURL)
|
|
15
|
+
throw new Error("testsURL");
|
|
16
|
+
exports.config.netlifyPath = (process.env.ENVIRONMENT == 'LOCAL') ? 'http://localhost:9999/' : jsonConfig.testsURL;
|
|
17
|
+
if (!jsonConfig.organization)
|
|
18
|
+
throw new Error("organization");
|
|
19
|
+
exports.config.organization = jsonConfig.organization;
|
|
20
|
+
if (!jsonConfig.email)
|
|
21
|
+
throw new Error("email");
|
|
22
|
+
exports.config.auxtaCredentials.email = jsonConfig.email;
|
|
23
|
+
if (!process.env.auxta_password)
|
|
24
|
+
throw new Error("password");
|
|
25
|
+
exports.config.auxtaCredentials.password = process.env.auxta_password;
|
|
26
|
+
if (!jsonConfig.suitesList)
|
|
27
|
+
throw new Error("suitesList");
|
|
28
|
+
exports.config.suitesList = jsonConfig.suitesList;
|
|
29
|
+
exports.config.googleEmail = jsonConfig.googleEmail;
|
|
30
|
+
if (jsonConfig.timeout)
|
|
31
|
+
exports.config.timeout = jsonConfig.timeout;
|
|
32
|
+
if (jsonConfig.screenWidth)
|
|
33
|
+
exports.config.screenWidth = jsonConfig.screenWidth;
|
|
34
|
+
if (jsonConfig.screenHeight)
|
|
35
|
+
exports.config.screenHeight = jsonConfig.screenHeight;
|
|
36
|
+
return exports.config;
|
|
37
|
+
}
|
|
38
|
+
exports.setupConfig = setupConfig;
|
|
39
|
+
function setupOverrideConfig(overrideConfig) {
|
|
40
|
+
if (overrideConfig.baseURL)
|
|
41
|
+
exports.config.baseURL = overrideConfig.baseURL;
|
|
42
|
+
if (overrideConfig.digitalProduct)
|
|
43
|
+
exports.config.digitalProduct = overrideConfig.digitalProduct;
|
|
44
|
+
if (overrideConfig.screenWidth)
|
|
45
|
+
exports.config.screenWidth = overrideConfig.screenWidth;
|
|
46
|
+
if (overrideConfig.screenHeight)
|
|
47
|
+
exports.config.screenHeight = overrideConfig.screenHeight;
|
|
48
|
+
return exports.config;
|
|
49
|
+
}
|
|
50
|
+
exports.setupOverrideConfig = setupOverrideConfig;
|
|
51
|
+
exports.config = {
|
|
52
|
+
auxtaURL: "http://localhost:8888/.netlify/functions/",
|
|
53
|
+
baseURL: "",
|
|
54
|
+
siteURL: "",
|
|
55
|
+
organization: "",
|
|
56
|
+
netlifyPath: "",
|
|
57
|
+
digitalProduct: "",
|
|
58
|
+
bucket: "",
|
|
59
|
+
token: "",
|
|
60
|
+
screenWidth: 1920,
|
|
61
|
+
screenHeight: 1080,
|
|
62
|
+
timeout: 60000,
|
|
63
|
+
suitesList: [],
|
|
64
|
+
googleEmail: "",
|
|
65
|
+
auxtaCredentials: {
|
|
66
|
+
email: "",
|
|
67
|
+
password: "",
|
|
68
|
+
},
|
|
69
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StatusOfStep = void 0;
|
|
4
|
+
var StatusOfStep;
|
|
5
|
+
(function (StatusOfStep) {
|
|
6
|
+
StatusOfStep["PASSED"] = "passed";
|
|
7
|
+
StatusOfStep["FAILED"] = "failed";
|
|
8
|
+
StatusOfStep["SKIPPED"] = "skipped";
|
|
9
|
+
StatusOfStep["SUGGESTION"] = "suggestion";
|
|
10
|
+
})(StatusOfStep || (exports.StatusOfStep = StatusOfStep = {}));
|
|
11
|
+
exports.default = StatusOfStep;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.returnImage = void 0;
|
|
4
|
+
function returnImage(code, screenshot) {
|
|
5
|
+
return {
|
|
6
|
+
isBase64Encoded: true,
|
|
7
|
+
statusCode: code,
|
|
8
|
+
headers: {
|
|
9
|
+
"Content-Type": "image/png",
|
|
10
|
+
"Content-Length": screenshot.length.toString()
|
|
11
|
+
},
|
|
12
|
+
body: screenshot.toString("base64")
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
exports.returnImage = returnImage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const path_1 = require("path");
|
|
13
|
+
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
|
+
const r = /^--params\.suite=(.*)$/g;
|
|
15
|
+
let suite = process.argv.find(el => !!el.match(r));
|
|
16
|
+
if (!suite)
|
|
17
|
+
throw `Locale is undefined`;
|
|
18
|
+
let suites = suite.replace('--params.suite=', '');
|
|
19
|
+
let suitesArr = suites.split(',');
|
|
20
|
+
if (!suitesArr)
|
|
21
|
+
suitesArr = [suites];
|
|
22
|
+
for (const suite of suitesArr) {
|
|
23
|
+
let f = require((0, path_1.join)(process.cwd(), 'build', 'functions', 'controllers', suite));
|
|
24
|
+
yield f.handler();
|
|
25
|
+
}
|
|
26
|
+
}))();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { UploadModel } from "../models/upload.model";
|
|
3
|
+
export declare function onTestEnd(body: any, featureName: string, scenarioName: string, statusCode: number, screenshotBuffer?: Buffer, errMessage?: object): Promise<{
|
|
4
|
+
nextSuites?: undefined;
|
|
5
|
+
reportId?: undefined;
|
|
6
|
+
currentSuite?: undefined;
|
|
7
|
+
retries?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
nextSuites: string[];
|
|
10
|
+
reportId: string | undefined;
|
|
11
|
+
currentSuite: string | undefined;
|
|
12
|
+
retries: string;
|
|
13
|
+
} | undefined>;
|
|
14
|
+
export declare function afterComplete(body: UploadModel): Promise<void>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.afterComplete = exports.onTestEnd = void 0;
|
|
16
|
+
const path_1 = require("path");
|
|
17
|
+
const log_service_1 = __importDefault(require("../services/log.service"));
|
|
18
|
+
const report_service_1 = require("../services/report.service");
|
|
19
|
+
const start_suite_helper_1 = require("../utilities/start-suite.helper");
|
|
20
|
+
const status_of_step_1 = require("../enums/status-of.step");
|
|
21
|
+
function onTestEnd(body, featureName, scenarioName, statusCode, screenshotBuffer, errMessage) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
let isFinal = false;
|
|
24
|
+
if (process.env.ENVIRONMENT == "LIVE") {
|
|
25
|
+
console.log('--- Uploading scenario and feature for AUXTA report ---');
|
|
26
|
+
const stepsArr = log_service_1.default.returnScenarioReport();
|
|
27
|
+
try {
|
|
28
|
+
const stepRes = yield (0, report_service_1.uploadStep)(stepsArr, scenarioName, screenshotBuffer, errMessage);
|
|
29
|
+
const scenarioRes = yield (0, report_service_1.uploadScenario)(stepRes, featureName, (0, path_1.basename)(__filename), (statusCode != 200));
|
|
30
|
+
const scenario = {
|
|
31
|
+
scenarioId: scenarioRes.scenarioRef,
|
|
32
|
+
scenarioName: scenarioRes.name,
|
|
33
|
+
scenarioUri: scenarioRes.uri,
|
|
34
|
+
status: scenarioRes.status,
|
|
35
|
+
scenariosCount: scenarioRes.scenariosCount,
|
|
36
|
+
lastFiveStepsHash: scenarioRes.lastFiveStepsHash
|
|
37
|
+
};
|
|
38
|
+
const stepCounts = {
|
|
39
|
+
failedSteps: log_service_1.default.getStatusCount(status_of_step_1.StatusOfStep.FAILED),
|
|
40
|
+
passedSteps: log_service_1.default.getStatusCount(status_of_step_1.StatusOfStep.PASSED),
|
|
41
|
+
skippedSteps: log_service_1.default.getStatusCount(status_of_step_1.StatusOfStep.SKIPPED),
|
|
42
|
+
suggestedSteps: log_service_1.default.getStatusCount(status_of_step_1.StatusOfStep.SUGGESTION)
|
|
43
|
+
};
|
|
44
|
+
isFinal = (!(body.nextSuites && body.nextSuites.length > 0));
|
|
45
|
+
yield (0, report_service_1.updateReport)(body.reportId, scenario, stepCounts, isFinal);
|
|
46
|
+
console.log('--- Finished uploading report data to AUXTA ---');
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
console.log('--- Failed to update report in AUXTA ---');
|
|
50
|
+
console.log(error);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (isFinal)
|
|
54
|
+
yield afterComplete(body);
|
|
55
|
+
else if (body && body.nextSuites) {
|
|
56
|
+
return yield (0, start_suite_helper_1.startSuite)(body.nextSuites, body.reportId);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
exports.onTestEnd = onTestEnd;
|
|
61
|
+
function afterComplete(body) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
if (process.env.ENVIRONMENT == "LIVE")
|
|
64
|
+
yield (0, report_service_1.postNotifications)(body);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
exports.afterComplete = afterComplete;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare class UploadModel {
|
|
2
|
+
private _reportId;
|
|
3
|
+
private _nextSuites;
|
|
4
|
+
private _digitalProduct;
|
|
5
|
+
private _baseUrl;
|
|
6
|
+
private readonly _organization;
|
|
7
|
+
private _bucket;
|
|
8
|
+
private _environment;
|
|
9
|
+
private _currentSuite;
|
|
10
|
+
private _retries;
|
|
11
|
+
private _featureName;
|
|
12
|
+
private _scenarioName;
|
|
13
|
+
constructor(org: string, baseUrl: string, digitalProduct: string, environment: string, bucket: string);
|
|
14
|
+
set currentSuite(value: string);
|
|
15
|
+
set retries(value: number);
|
|
16
|
+
get currentSuite(): string;
|
|
17
|
+
get bucket(): string;
|
|
18
|
+
set bucket(value: string);
|
|
19
|
+
get retries(): number;
|
|
20
|
+
get reportId(): string;
|
|
21
|
+
set reportId(value: string);
|
|
22
|
+
get nextSuites(): [];
|
|
23
|
+
set nextSuites(value: []);
|
|
24
|
+
get digitalProduct(): string;
|
|
25
|
+
set digitalProduct(value: string);
|
|
26
|
+
get organization(): string;
|
|
27
|
+
get baseUrl(): string;
|
|
28
|
+
set baseUrl(value: string);
|
|
29
|
+
get environment(): string;
|
|
30
|
+
set environment(value: string);
|
|
31
|
+
get featureName(): string;
|
|
32
|
+
set featureName(value: string);
|
|
33
|
+
get scenarioName(): string;
|
|
34
|
+
set scenarioName(value: string);
|
|
35
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UploadModel = void 0;
|
|
4
|
+
class UploadModel {
|
|
5
|
+
constructor(org, baseUrl, digitalProduct, environment, bucket) {
|
|
6
|
+
this._reportId = '';
|
|
7
|
+
this._nextSuites = [];
|
|
8
|
+
this._currentSuite = '';
|
|
9
|
+
this._retries = 0;
|
|
10
|
+
this._organization = org;
|
|
11
|
+
this._bucket = bucket;
|
|
12
|
+
this._digitalProduct = digitalProduct;
|
|
13
|
+
this._environment = environment;
|
|
14
|
+
this._baseUrl = baseUrl;
|
|
15
|
+
this._featureName = '';
|
|
16
|
+
this._scenarioName = '';
|
|
17
|
+
}
|
|
18
|
+
set currentSuite(value) {
|
|
19
|
+
this._currentSuite = value;
|
|
20
|
+
}
|
|
21
|
+
set retries(value) {
|
|
22
|
+
this._retries = value;
|
|
23
|
+
}
|
|
24
|
+
get currentSuite() {
|
|
25
|
+
return this._currentSuite;
|
|
26
|
+
}
|
|
27
|
+
get bucket() {
|
|
28
|
+
return this._bucket;
|
|
29
|
+
}
|
|
30
|
+
set bucket(value) {
|
|
31
|
+
this._bucket = value;
|
|
32
|
+
}
|
|
33
|
+
get retries() {
|
|
34
|
+
return this._retries;
|
|
35
|
+
}
|
|
36
|
+
get reportId() {
|
|
37
|
+
return this._reportId;
|
|
38
|
+
}
|
|
39
|
+
set reportId(value) {
|
|
40
|
+
this._reportId = value;
|
|
41
|
+
}
|
|
42
|
+
get nextSuites() {
|
|
43
|
+
return this._nextSuites;
|
|
44
|
+
}
|
|
45
|
+
set nextSuites(value) {
|
|
46
|
+
this._nextSuites = value;
|
|
47
|
+
}
|
|
48
|
+
get digitalProduct() {
|
|
49
|
+
return this._digitalProduct;
|
|
50
|
+
}
|
|
51
|
+
set digitalProduct(value) {
|
|
52
|
+
this._digitalProduct = value;
|
|
53
|
+
}
|
|
54
|
+
get organization() {
|
|
55
|
+
return this._organization;
|
|
56
|
+
}
|
|
57
|
+
get baseUrl() {
|
|
58
|
+
return this._baseUrl;
|
|
59
|
+
}
|
|
60
|
+
set baseUrl(value) {
|
|
61
|
+
this._baseUrl = value;
|
|
62
|
+
}
|
|
63
|
+
get environment() {
|
|
64
|
+
return this._environment;
|
|
65
|
+
}
|
|
66
|
+
set environment(value) {
|
|
67
|
+
this._environment = value;
|
|
68
|
+
}
|
|
69
|
+
get featureName() {
|
|
70
|
+
return this._featureName;
|
|
71
|
+
}
|
|
72
|
+
set featureName(value) {
|
|
73
|
+
this._featureName = value;
|
|
74
|
+
}
|
|
75
|
+
get scenarioName() {
|
|
76
|
+
return this._scenarioName;
|
|
77
|
+
}
|
|
78
|
+
set scenarioName(value) {
|
|
79
|
+
this._scenarioName = value;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.UploadModel = UploadModel;
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
embedding?: {
|
|
9
|
+
data: string;
|
|
10
|
+
mime_type: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare class LogSteps {
|
|
15
|
+
private stepLog;
|
|
16
|
+
private lastStepTime;
|
|
17
|
+
statusCounter: {
|
|
18
|
+
passed: number;
|
|
19
|
+
failed: number;
|
|
20
|
+
skipped: number;
|
|
21
|
+
suggestion: number;
|
|
22
|
+
};
|
|
23
|
+
addSuggestion(text: string): void;
|
|
24
|
+
clear(): void;
|
|
25
|
+
push(keyword: string, name: string, status: StatusOfStep, screenshot?: string): void;
|
|
26
|
+
returnScenarioReport(): Step[];
|
|
27
|
+
getStatusCount(status: StatusOfStep): number;
|
|
28
|
+
}
|
|
29
|
+
declare const log: LogSteps;
|
|
30
|
+
export default log;
|