@auxcode/auxta 1.3.17 → 1.3.18

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 +69 -60
  2. package/build/cjs/AuxTA.d.ts +57 -57
  3. package/build/cjs/AuxTA.js +148 -148
  4. package/build/cjs/auxta/configs/config.d.ts +51 -51
  5. package/build/cjs/auxta/configs/config.js +63 -63
  6. package/build/cjs/auxta/enums/status-of.step.d.ts +7 -7
  7. package/build/cjs/auxta/enums/status-of.step.js +11 -11
  8. package/build/cjs/auxta/helpers/response.helper.d.ts +10 -10
  9. package/build/cjs/auxta/helpers/response.helper.js +15 -15
  10. package/build/cjs/auxta/helpers/start.helper.d.ts +1 -1
  11. package/build/cjs/auxta/helpers/start.helper.js +26 -26
  12. package/build/cjs/auxta/hooks/report.hook.d.ts +14 -14
  13. package/build/cjs/auxta/hooks/report.hook.js +66 -66
  14. package/build/cjs/auxta/models/upload.model.d.ts +32 -32
  15. package/build/cjs/auxta/models/upload.model.js +75 -75
  16. package/build/cjs/auxta/services/log.service.d.ts +26 -26
  17. package/build/cjs/auxta/services/log.service.js +47 -47
  18. package/build/cjs/auxta/services/report.service.d.ts +36 -36
  19. package/build/cjs/auxta/services/report.service.js +164 -164
  20. package/build/cjs/auxta/services/runtime.service.d.ts +16 -16
  21. package/build/cjs/auxta/services/runtime.service.js +41 -41
  22. package/build/cjs/auxta/utilities/runtime.helper.d.ts +15 -15
  23. package/build/cjs/auxta/utilities/runtime.helper.js +19 -19
  24. package/build/cjs/auxta/utilities/screenshot.helper.d.ts +2 -2
  25. package/build/cjs/auxta/utilities/screenshot.helper.js +36 -36
  26. package/build/cjs/auxta/utilities/start-suite.helper.d.ts +17 -17
  27. package/build/cjs/auxta/utilities/start-suite.helper.js +31 -31
  28. package/build/cjs/macros/helpers/Aux2faAuth.d.ts +7 -7
  29. package/build/cjs/macros/helpers/Aux2faAuth.js +29 -29
  30. package/build/cjs/macros/helpers/code.helper.d.ts +21 -23
  31. package/build/cjs/macros/helpers/code.helper.js +192 -166
  32. package/build/cjs/macros/helpers/extend-default-page.d.ts +6 -6
  33. package/build/cjs/macros/helpers/extend-default-page.js +88 -88
  34. package/build/cjs/puppeteer/puppeteer.d.ts +25 -25
  35. package/build/cjs/puppeteer/puppeteer.js +196 -200
  36. package/build/esm/AuxTA.d.ts +57 -57
  37. package/build/esm/AuxTA.js +119 -119
  38. package/build/esm/auxta/configs/config.d.ts +51 -51
  39. package/build/esm/auxta/configs/config.js +58 -58
  40. package/build/esm/auxta/enums/status-of.step.d.ts +7 -7
  41. package/build/esm/auxta/enums/status-of.step.js +8 -8
  42. package/build/esm/auxta/helpers/response.helper.d.ts +10 -10
  43. package/build/esm/auxta/helpers/response.helper.js +11 -11
  44. package/build/esm/auxta/helpers/start.helper.d.ts +1 -1
  45. package/build/esm/auxta/helpers/start.helper.js +24 -24
  46. package/build/esm/auxta/hooks/report.hook.d.ts +14 -14
  47. package/build/esm/auxta/hooks/report.hook.js +58 -58
  48. package/build/esm/auxta/models/upload.model.d.ts +32 -32
  49. package/build/esm/auxta/models/upload.model.js +71 -71
  50. package/build/esm/auxta/services/log.service.d.ts +26 -26
  51. package/build/esm/auxta/services/log.service.js +43 -43
  52. package/build/esm/auxta/services/report.service.d.ts +36 -36
  53. package/build/esm/auxta/services/report.service.js +150 -150
  54. package/build/esm/auxta/services/runtime.service.d.ts +16 -16
  55. package/build/esm/auxta/services/runtime.service.js +37 -37
  56. package/build/esm/auxta/utilities/runtime.helper.d.ts +15 -15
  57. package/build/esm/auxta/utilities/runtime.helper.js +15 -15
  58. package/build/esm/auxta/utilities/screenshot.helper.d.ts +2 -2
  59. package/build/esm/auxta/utilities/screenshot.helper.js +29 -29
  60. package/build/esm/auxta/utilities/start-suite.helper.d.ts +17 -17
  61. package/build/esm/auxta/utilities/start-suite.helper.js +26 -26
  62. package/build/esm/macros/helpers/Aux2faAuth.d.ts +7 -7
  63. package/build/esm/macros/helpers/Aux2faAuth.js +25 -25
  64. package/build/esm/macros/helpers/code.helper.d.ts +21 -23
  65. package/build/esm/macros/helpers/code.helper.js +185 -159
  66. package/build/esm/macros/helpers/extend-default-page.d.ts +6 -6
  67. package/build/esm/macros/helpers/extend-default-page.js +81 -81
  68. package/build/esm/puppeteer/puppeteer.d.ts +25 -25
  69. package/build/esm/puppeteer/puppeteer.js +188 -192
  70. package/build/tsconfig-cjs.tsbuildinfo +1 -1
  71. package/build/tsconfig.tsbuildinfo +1 -1
  72. package/package.json +29 -29
package/README.md CHANGED
@@ -1,60 +1,69 @@
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
+ ## Implement
4
+
5
+ The main thing is a `scenario`.
6
+
7
+ `Scenarios` consts of `steps.
8
+
9
+ ### Clicking
10
+
11
+ All clicks wait for the selector by default and timeout w/ the standard timeout unless different is specified.
12
+
13
+ `timeout` It is recommended to have a standard timeout for the whole scenario and not to define spefici. `TODO`
14
+
15
+ auxta.clickByText `TO BE FIXED BY GEORGE TO ADD THE WAIT FOR SELECTOR WHICH IS MISSING`
16
+
17
+ auxta.clickByXPath
18
+
19
+ auxta.clickByClass
20
+
21
+ auxta.click() `THINK TO MAKE` `TODO`
22
+
23
+ waitforseelctorbytext `depreciated`
24
+
25
+ ## Running
26
+
27
+ * Create a main function that calls the run() function which starts all tests
28
+ * Create a function for each test that calls the `auxtaPuppeteer.run(event, callback, featureName, scenarioName)` function
29
+
30
+ ## Puppeteer
31
+
32
+ https://pptr.dev
33
+
34
+ https://github.com/puppeteer/puppeteer
35
+
36
+ ## Install
37
+
38
+ npm i
39
+
40
+ ## Setup
41
+
42
+ ```
43
+ {
44
+ # All background functions that will be run, listed
45
+ "suitesList": [
46
+ "{filename}-background"
47
+ ],
48
+ # The tested site's url
49
+ "baseURL": "https://{sitename}/",
50
+ # The url where the tests are ran
51
+ "testsURL": "https://{sitename}/",
52
+ # The organization's name
53
+ "organization": "string",
54
+ # The digital product's name
55
+ "digitalProduct": "bedrijfsfinanciering.com",
56
+ # Max timeout in milliseconds
57
+ # Default 1000
58
+ "timeout": 1000,
59
+ # The credentials of the user that uploads the tests to the site
60
+ "email": "string",
61
+ "password": "string",
62
+ "token": "string"
63
+ # Screen width and height used in the testing
64
+ # Allows testing from mobile devices screens
65
+ "screenWidth": 1920,
66
+ "screenHeight": 1080,
67
+ }
68
+
69
+ ```
@@ -1,57 +1,57 @@
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
+ 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 +1,148 @@
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
+ "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 +1,51 @@
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
+ 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
+ };