@auxcode/auxta 1.3.14 → 1.3.16

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.
Files changed (72) hide show
  1. package/README.md +60 -60
  2. package/package.json +29 -29
  3. package/build/cjs/AuxTA.d.ts +0 -57
  4. package/build/cjs/AuxTA.js +0 -148
  5. package/build/cjs/auxta/configs/config.d.ts +0 -51
  6. package/build/cjs/auxta/configs/config.js +0 -66
  7. package/build/cjs/auxta/enums/status-of.step.d.ts +0 -7
  8. package/build/cjs/auxta/enums/status-of.step.js +0 -11
  9. package/build/cjs/auxta/helpers/response.helper.d.ts +0 -10
  10. package/build/cjs/auxta/helpers/response.helper.js +0 -15
  11. package/build/cjs/auxta/helpers/start.helper.d.ts +0 -1
  12. package/build/cjs/auxta/helpers/start.helper.js +0 -26
  13. package/build/cjs/auxta/hooks/report.hook.d.ts +0 -14
  14. package/build/cjs/auxta/hooks/report.hook.js +0 -66
  15. package/build/cjs/auxta/models/upload.model.d.ts +0 -32
  16. package/build/cjs/auxta/models/upload.model.js +0 -75
  17. package/build/cjs/auxta/services/log.service.d.ts +0 -26
  18. package/build/cjs/auxta/services/log.service.js +0 -47
  19. package/build/cjs/auxta/services/report.service.d.ts +0 -36
  20. package/build/cjs/auxta/services/report.service.js +0 -164
  21. package/build/cjs/auxta/services/runtime.service.d.ts +0 -16
  22. package/build/cjs/auxta/services/runtime.service.js +0 -41
  23. package/build/cjs/auxta/utilities/runtime.helper.d.ts +0 -15
  24. package/build/cjs/auxta/utilities/runtime.helper.js +0 -19
  25. package/build/cjs/auxta/utilities/screenshot.helper.d.ts +0 -2
  26. package/build/cjs/auxta/utilities/screenshot.helper.js +0 -36
  27. package/build/cjs/auxta/utilities/start-suite.helper.d.ts +0 -17
  28. package/build/cjs/auxta/utilities/start-suite.helper.js +0 -31
  29. package/build/cjs/macros/helpers/Aux2faAuth.d.ts +0 -7
  30. package/build/cjs/macros/helpers/Aux2faAuth.js +0 -29
  31. package/build/cjs/macros/helpers/code.helper.d.ts +0 -21
  32. package/build/cjs/macros/helpers/code.helper.js +0 -192
  33. package/build/cjs/macros/helpers/extend-default-page.d.ts +0 -6
  34. package/build/cjs/macros/helpers/extend-default-page.js +0 -88
  35. package/build/cjs/puppeteer/puppeteer.d.ts +0 -25
  36. package/build/cjs/puppeteer/puppeteer.js +0 -200
  37. package/build/esm/AuxTA.d.ts +0 -57
  38. package/build/esm/AuxTA.js +0 -119
  39. package/build/esm/auxta/configs/config.d.ts +0 -51
  40. package/build/esm/auxta/configs/config.js +0 -61
  41. package/build/esm/auxta/enums/status-of.step.d.ts +0 -7
  42. package/build/esm/auxta/enums/status-of.step.js +0 -8
  43. package/build/esm/auxta/helpers/response.helper.d.ts +0 -10
  44. package/build/esm/auxta/helpers/response.helper.js +0 -11
  45. package/build/esm/auxta/helpers/start.helper.d.ts +0 -1
  46. package/build/esm/auxta/helpers/start.helper.js +0 -24
  47. package/build/esm/auxta/hooks/report.hook.d.ts +0 -14
  48. package/build/esm/auxta/hooks/report.hook.js +0 -58
  49. package/build/esm/auxta/models/upload.model.d.ts +0 -32
  50. package/build/esm/auxta/models/upload.model.js +0 -71
  51. package/build/esm/auxta/services/log.service.d.ts +0 -26
  52. package/build/esm/auxta/services/log.service.js +0 -43
  53. package/build/esm/auxta/services/report.service.d.ts +0 -36
  54. package/build/esm/auxta/services/report.service.js +0 -150
  55. package/build/esm/auxta/services/runtime.service.d.ts +0 -16
  56. package/build/esm/auxta/services/runtime.service.js +0 -37
  57. package/build/esm/auxta/utilities/runtime.helper.d.ts +0 -15
  58. package/build/esm/auxta/utilities/runtime.helper.js +0 -15
  59. package/build/esm/auxta/utilities/screenshot.helper.d.ts +0 -2
  60. package/build/esm/auxta/utilities/screenshot.helper.js +0 -29
  61. package/build/esm/auxta/utilities/start-suite.helper.d.ts +0 -17
  62. package/build/esm/auxta/utilities/start-suite.helper.js +0 -26
  63. package/build/esm/macros/helpers/Aux2faAuth.d.ts +0 -7
  64. package/build/esm/macros/helpers/Aux2faAuth.js +0 -25
  65. package/build/esm/macros/helpers/code.helper.d.ts +0 -21
  66. package/build/esm/macros/helpers/code.helper.js +0 -185
  67. package/build/esm/macros/helpers/extend-default-page.d.ts +0 -6
  68. package/build/esm/macros/helpers/extend-default-page.js +0 -81
  69. package/build/esm/puppeteer/puppeteer.d.ts +0 -25
  70. package/build/esm/puppeteer/puppeteer.js +0 -192
  71. package/build/tsconfig-cjs.tsbuildinfo +0 -1
  72. package/build/tsconfig.tsbuildinfo +0 -1
package/README.md CHANGED
@@ -1,60 +1,60 @@
1
- # AuxTA
2
-
3
- ## Table of Contents
4
-
5
- * [puppeteer](#puppeteer)
6
- * [install](#install)
7
- * [setup](#setup)
8
- * [running](#running)
9
-
10
- ## Puppeteer
11
-
12
- https://pptr.dev
13
-
14
- https://github.com/puppeteer/puppeteer
15
-
16
- ## Install
17
-
18
- npm i
19
-
20
- ## Setup
21
-
22
- ```
23
- {
24
- # All background functions that will be run, listed
25
- "suitesList": [
26
- "{filename}-background"
27
- ],
28
- # The tested site's url
29
- "baseURL": "https://{sitename}/",
30
- # The url where the tests are ran
31
- "testsURL": "https://{sitename}/",
32
- # The organization's name
33
- "organization": "string",
34
- # The digital product's name
35
- "digitalProduct": "bedrijfsfinanciering.com",
36
- # Max timeout in milliseconds
37
- # Default 1000
38
- "timeout": 1000,
39
- # The credentials of the user that uploads the tests to the site
40
- "email": "string",
41
- "password": "string",
42
- "token": "string"
43
- # Screen width and height used in the testing
44
- # Allows testing from mobile devices screens
45
- "screenWidth": 1920,
46
- "screenHeight": 1080,
47
- }
48
-
49
- ```
50
-
51
- ## Implement
52
-
53
- The main thing is a `scenario`.
54
-
55
- `Scenarios` consts of `steps.
56
-
57
- ## Running
58
-
59
- * Create a main function that calls the run() function which starts all tests
60
- * Create a function for each test that calls the `auxtaPuppeteer.run(event, callback, featureName, scenarioName)` function
1
+ # AuxTA
2
+
3
+ ## Table of Contents
4
+
5
+ * [puppeteer](#puppeteer)
6
+ * [install](#install)
7
+ * [setup](#setup)
8
+ * [running](#running)
9
+
10
+ ## Puppeteer
11
+
12
+ https://pptr.dev
13
+
14
+ https://github.com/puppeteer/puppeteer
15
+
16
+ ## Install
17
+
18
+ npm i
19
+
20
+ ## Setup
21
+
22
+ ```
23
+ {
24
+ # All background functions that will be run, listed
25
+ "suitesList": [
26
+ "{filename}-background"
27
+ ],
28
+ # The tested site's url
29
+ "baseURL": "https://{sitename}/",
30
+ # The url where the tests are ran
31
+ "testsURL": "https://{sitename}/",
32
+ # The organization's name
33
+ "organization": "string",
34
+ # The digital product's name
35
+ "digitalProduct": "bedrijfsfinanciering.com",
36
+ # Max timeout in milliseconds
37
+ # Default 1000
38
+ "timeout": 1000,
39
+ # The credentials of the user that uploads the tests to the site
40
+ "email": "string",
41
+ "password": "string",
42
+ "token": "string"
43
+ # Screen width and height used in the testing
44
+ # Allows testing from mobile devices screens
45
+ "screenWidth": 1920,
46
+ "screenHeight": 1080,
47
+ }
48
+
49
+ ```
50
+
51
+ ## Implement
52
+
53
+ The main thing is a `scenario`.
54
+
55
+ `Scenarios` consts of `steps.
56
+
57
+ ## Running
58
+
59
+ * Create a main function that calls the run() function which starts all tests
60
+ * Create a function for each test that calls the `auxtaPuppeteer.run(event, callback, featureName, scenarioName)` function
package/package.json CHANGED
@@ -1,29 +1,29 @@
1
- {
2
- "name": "@auxcode/auxta",
3
- "version": "1.3.14",
4
- "description": "",
5
- "main": "./build/cjs/AuxTA.js",
6
- "module": "./build/esm/AuxTA.js",
7
- "files": [
8
- "build/"
9
- ],
10
- "scripts": {
11
- "tsc": "tsc -p tsconfig.json && tsc -p tsconfig-cjs.json",
12
- "prepublish": "npm run tsc",
13
- "test": "npm run prepublish & node ./build/AuxTA.js"
14
- },
15
- "author": "auxcode",
16
- "license": "ISC",
17
- "dependencies": {
18
- "@types/node": "^17.0.9",
19
- "axios": "^0.24.0",
20
- "dotenv": "^10.0.0",
21
- "dotenv-extended": "^2.9.0",
22
- "node-2fa": "^2.0.3",
23
- "puppeteer": "^19.7.5",
24
- "typescript": "^4.5.2"
25
- },
26
- "devDependencies": {
27
- "@babel/preset-typescript": "^7.16.0"
28
- }
29
- }
1
+ {
2
+ "name": "@auxcode/auxta",
3
+ "version": "1.3.16",
4
+ "description": "",
5
+ "main": "./build/cjs/AuxTA.js",
6
+ "module": "./build/esm/AuxTA.js",
7
+ "files": [
8
+ "build/"
9
+ ],
10
+ "scripts": {
11
+ "tsc": "tsc -p tsconfig.json && tsc -p tsconfig-cjs.json",
12
+ "prepublish": "npm run tsc",
13
+ "test": "npm run prepublish & node ./build/AuxTA.js"
14
+ },
15
+ "author": "auxcode",
16
+ "license": "ISC",
17
+ "dependencies": {
18
+ "@types/node": "^17.0.9",
19
+ "axios": "^0.24.0",
20
+ "dotenv": "^10.0.0",
21
+ "dotenv-extended": "^2.9.0",
22
+ "node-2fa": "^2.0.3",
23
+ "puppeteer": "^19.7.5",
24
+ "typescript": "^4.5.2"
25
+ },
26
+ "devDependencies": {
27
+ "@babel/preset-typescript": "^7.16.0"
28
+ }
29
+ }
@@ -1,57 +0,0 @@
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
- declare class AuxTA extends FunctionHelper {
6
- puppeteer: Puppeteer;
7
- aux2fa: import("./macros/helpers/Aux2faAuth").Aux2faAuth;
8
- config: {
9
- auxtaURL: string;
10
- baseURL: string;
11
- siteURL: string;
12
- organization: string;
13
- netlifyPath: string;
14
- digitalProduct: string;
15
- token: string;
16
- screenWidth: number;
17
- screenHeight: number;
18
- timeout: number;
19
- suitesList: never[];
20
- auxtaCredentials: {
21
- email: string;
22
- password: string;
23
- };
24
- };
25
- private readonly uploadModel;
26
- constructor();
27
- run(event: any, overrideConfig?: any): Promise<{
28
- nextSuites?: undefined;
29
- reportId?: undefined;
30
- currentSuite?: undefined;
31
- retries?: undefined;
32
- } | {
33
- nextSuites: string[];
34
- reportId: string | undefined;
35
- currentSuite: string | undefined;
36
- retries: string;
37
- }>;
38
- private changeModelData;
39
- startBrowser(event: any, callback: any, feature: string, scenario: string, overrideConfig?: any, singleFeature?: boolean, fileName?: string): Promise<{
40
- nextSuites?: undefined;
41
- reportId?: undefined;
42
- currentSuite?: undefined;
43
- retries?: undefined;
44
- } | {
45
- nextSuites: string[];
46
- reportId: string | undefined;
47
- currentSuite: string | undefined;
48
- retries: string;
49
- } | {
50
- statusCode: number;
51
- } | undefined>;
52
- startBrowserRPA(event: any, callback: any, baseURL: string, fileName?: string): Promise<any>;
53
- getUploadModel(): UploadModel;
54
- }
55
- export declare const StepStatus: typeof StatusOfStep;
56
- declare const auxta: AuxTA;
57
- export default auxta;
@@ -1,148 +0,0 @@
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
- dotenv.config();
51
- class AuxTA extends code_helper_1.FunctionHelper {
52
- constructor() {
53
- super();
54
- this.puppeteer = puppeteer_1.default;
55
- this.aux2fa = Aux2faAuth_1.default;
56
- this.config = config_1.config;
57
- let file;
58
- if (!process.env.RPA) {
59
- try {
60
- let currentDir = "";
61
- while (true) {
62
- file = path_1.default.join(__dirname, currentDir, "auxta.json");
63
- if (!fs_1.default.existsSync(file)) {
64
- currentDir += "../";
65
- if (currentDir.length >= 30) {
66
- console.log("auxta.json file not found!");
67
- process.exit(1);
68
- return;
69
- }
70
- continue;
71
- }
72
- break;
73
- }
74
- const jsonConfig = JSON.parse(fs_1.default.readFileSync(file).toString());
75
- try {
76
- this.config = (0, config_1.setupConfig)(jsonConfig);
77
- }
78
- catch (e) {
79
- console.log("Missing field in auxta.json:", e);
80
- }
81
- this.uploadModel = new upload_model_1.UploadModel(jsonConfig.organization, jsonConfig.baseURL, jsonConfig.digitalProduct, jsonConfig.environment);
82
- }
83
- catch (e) {
84
- console.log("Missing or corrupted config: auxta.json. Searching in location:", file);
85
- console.log(e);
86
- process.exit(1);
87
- }
88
- }
89
- else {
90
- this.uploadModel = new upload_model_1.UploadModel('', '', '', '');
91
- }
92
- }
93
- run(event, overrideConfig) {
94
- return __awaiter(this, void 0, void 0, function* () {
95
- this.changeModelData(overrideConfig);
96
- let reportId;
97
- try {
98
- if (event.reportId) {
99
- reportId = event.reportId;
100
- }
101
- }
102
- catch (e) {
103
- reportId = undefined;
104
- }
105
- const suites = this.config.suitesList.slice(0);
106
- return (0, start_suite_helper_1.startSuite)(suites, reportId || (yield (0, report_service_1.createEmptyReport)(this.uploadModel)));
107
- });
108
- }
109
- changeModelData(overrideConfig) {
110
- if (overrideConfig) {
111
- if (overrideConfig.digitalProduct)
112
- this.uploadModel.digitalProduct = overrideConfig.digitalProduct;
113
- if (overrideConfig.environment)
114
- this.uploadModel.environment = overrideConfig.environment;
115
- if (overrideConfig.baseURL)
116
- this.uploadModel.baseUrl = overrideConfig.baseURL;
117
- this.config = (0, config_1.setupOverrideConfig)(overrideConfig);
118
- }
119
- }
120
- startBrowser(event, callback, feature, scenario, overrideConfig, singleFeature = false, fileName = '') {
121
- return __awaiter(this, void 0, void 0, function* () {
122
- this.changeModelData(overrideConfig);
123
- if (singleFeature && process.env.ENVIRONMENT !== 'LOCAL') {
124
- this.uploadModel.reportId = yield (0, report_service_1.createEmptyReport)(this.uploadModel);
125
- this.uploadModel.currentSuite = fileName;
126
- this.uploadModel.nextSuites = [];
127
- }
128
- return this.puppeteer.run(event, callback, feature, scenario);
129
- });
130
- }
131
- startBrowserRPA(event, callback, baseURL, fileName = '') {
132
- return __awaiter(this, void 0, void 0, function* () {
133
- this.changeModelData({
134
- baseURL: baseURL,
135
- environment: '',
136
- digitalProduct: ''
137
- });
138
- this.uploadModel.currentSuite = fileName;
139
- return this.puppeteer.runRPA(event, callback);
140
- });
141
- }
142
- getUploadModel() {
143
- return this.uploadModel;
144
- }
145
- }
146
- exports.StepStatus = status_of_step_1.default;
147
- const auxta = new AuxTA();
148
- exports.default = auxta;
@@ -1,51 +0,0 @@
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
- token: string;
9
- screenWidth: number;
10
- screenHeight: number;
11
- timeout: number;
12
- suitesList: never[];
13
- auxtaCredentials: {
14
- email: string;
15
- password: string;
16
- };
17
- };
18
- export declare function setupOverrideConfig(overrideConfig: any): {
19
- auxtaURL: string;
20
- baseURL: string;
21
- siteURL: string;
22
- organization: string;
23
- netlifyPath: string;
24
- digitalProduct: string;
25
- token: string;
26
- screenWidth: number;
27
- screenHeight: number;
28
- timeout: number;
29
- suitesList: never[];
30
- auxtaCredentials: {
31
- email: string;
32
- password: string;
33
- };
34
- };
35
- export declare let config: {
36
- auxtaURL: string;
37
- baseURL: string;
38
- siteURL: string;
39
- organization: string;
40
- netlifyPath: string;
41
- digitalProduct: string;
42
- token: string;
43
- screenWidth: number;
44
- screenHeight: number;
45
- timeout: number;
46
- suitesList: never[];
47
- auxtaCredentials: {
48
- email: string;
49
- password: string;
50
- };
51
- };
@@ -1,66 +0,0 @@
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.netlifyPath = (process.env.ENVIRONMENT == 'LOCAL') ? 'http://localhost:9999/' : jsonConfig.testsURL;
14
- if (!jsonConfig.organization)
15
- throw new Error("organization");
16
- exports.config.organization = jsonConfig.organization;
17
- if (!process.env.token)
18
- throw new Error("token");
19
- exports.config.token = process.env.token;
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
- if (jsonConfig.timeout)
30
- exports.config.timeout = jsonConfig.timeout;
31
- if (jsonConfig.screenWidth)
32
- exports.config.screenWidth = jsonConfig.screenWidth;
33
- if (jsonConfig.screenHeight)
34
- exports.config.screenHeight = jsonConfig.screenHeight;
35
- return exports.config;
36
- }
37
- exports.setupConfig = setupConfig;
38
- function setupOverrideConfig(overrideConfig) {
39
- if (overrideConfig.baseURL)
40
- exports.config.baseURL = overrideConfig.baseURL;
41
- if (overrideConfig.digitalProduct)
42
- exports.config.digitalProduct = overrideConfig.digitalProduct;
43
- if (overrideConfig.screenWidth)
44
- exports.config.screenWidth = overrideConfig.screenWidth;
45
- if (overrideConfig.screenHeight)
46
- exports.config.screenHeight = overrideConfig.screenHeight;
47
- return exports.config;
48
- }
49
- exports.setupOverrideConfig = setupOverrideConfig;
50
- exports.config = {
51
- auxtaURL: "https://auxta.live/.netlify/functions/",
52
- baseURL: "",
53
- siteURL: "",
54
- organization: "",
55
- netlifyPath: "",
56
- digitalProduct: "",
57
- token: "",
58
- screenWidth: 1920,
59
- screenHeight: 1080,
60
- timeout: 60000,
61
- suitesList: [],
62
- auxtaCredentials: {
63
- email: "",
64
- password: "",
65
- },
66
- };
@@ -1,7 +0,0 @@
1
- export declare enum StatusOfStep {
2
- PASSED = "passed",
3
- FAILED = "failed",
4
- SKIPPED = "skipped",
5
- SUGGESTION = "suggestion"
6
- }
7
- export default StatusOfStep;
@@ -1,11 +0,0 @@
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 || (exports.StatusOfStep = {}));
11
- exports.default = StatusOfStep;
@@ -1,10 +0,0 @@
1
- /// <reference types="node" />
2
- export declare function returnImage(code: number, screenshot: Buffer): {
3
- isBase64Encoded: boolean;
4
- statusCode: number;
5
- headers: {
6
- "Content-Type": string;
7
- "Content-Length": string;
8
- };
9
- body: string;
10
- };
@@ -1,15 +0,0 @@
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;
@@ -1 +0,0 @@
1
- export {};
@@ -1,26 +0,0 @@
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
- }))();
@@ -1,14 +0,0 @@
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>;
@@ -1,66 +0,0 @@
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 scenarioRes = yield (0, report_service_1.uploadScenario)(stepsArr, scenarioName, screenshotBuffer, errMessage);
29
- const featureRes = yield (0, report_service_1.uploadFeature)(scenarioRes, featureName, (0, path_1.basename)(__filename), (statusCode != 200));
30
- const feature = {
31
- featureId: featureRes.featureRef,
32
- featureName: featureRes.name,
33
- featureUri: featureRes.uri,
34
- status: featureRes.status,
35
- scenariosCount: featureRes.scenariosCount
36
- };
37
- const stepCounts = {
38
- failedSteps: log_service_1.default.getStatusCount(status_of_step_1.StatusOfStep.FAILED),
39
- passedSteps: log_service_1.default.getStatusCount(status_of_step_1.StatusOfStep.PASSED),
40
- skippedSteps: log_service_1.default.getStatusCount(status_of_step_1.StatusOfStep.SKIPPED),
41
- suggestedSteps: log_service_1.default.getStatusCount(status_of_step_1.StatusOfStep.SUGGESTION)
42
- };
43
- isFinal = (!(body.nextSuites && body.nextSuites.length > 0));
44
- yield (0, report_service_1.updateReport)(body.reportId, feature, stepCounts, isFinal);
45
- console.log('--- Finished uploading report data to AUXTA ---');
46
- }
47
- catch (error) {
48
- console.log('--- Failed to update report in AUXTA ---');
49
- console.log(error);
50
- }
51
- }
52
- if (isFinal)
53
- yield afterComplete(body);
54
- else if (body && body.nextSuites) {
55
- return yield (0, start_suite_helper_1.startSuite)(body.nextSuites, body.reportId);
56
- }
57
- });
58
- }
59
- exports.onTestEnd = onTestEnd;
60
- function afterComplete(body) {
61
- return __awaiter(this, void 0, void 0, function* () {
62
- if (process.env.ENVIRONMENT == "LIVE")
63
- yield (0, report_service_1.postNotifications)(body);
64
- });
65
- }
66
- exports.afterComplete = afterComplete;