@auxcode/auxta 1.3.26-beta.2 → 1.3.26-beta.5
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 +97 -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 -19
- 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 -203
- 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 -19
- 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 -195
- package/build/tsconfig-cjs.tsbuildinfo +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +33 -33
package/README.md
CHANGED
|
@@ -1,93 +1,97 @@
|
|
|
1
|
-
# AuxTA
|
|
2
|
-
|
|
3
|
-
## Implementing
|
|
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
|
-
### Working with Tab
|
|
26
|
-
|
|
27
|
-
...
|
|
28
|
-
|
|
29
|
-
### Complex Workflows
|
|
30
|
-
|
|
31
|
-
#### Email
|
|
32
|
-
|
|
33
|
-
* (AuxTA) We do some action on the website.
|
|
34
|
-
* (Website) Sends an email to the email address of the user who did the action.
|
|
35
|
-
* (AuxTA) Should check that that the email was correctly sent. So we check:
|
|
36
|
-
* `auxta.checkMail(_from_name_, _from_email_, _subject_, _body_text_)`
|
|
37
|
-
* The email login is in the main config of the test suite.
|
|
38
|
-
* email
|
|
39
|
-
* API TOKEN
|
|
40
|
-
* For the moment we do it synchroneous (AuxTA waits for the email).
|
|
41
|
-
* The email must be newser than the time of the action on the Website.
|
|
42
|
-
* Must be _from_name_ (substring)
|
|
43
|
-
* Must be _from_email_ (substring)
|
|
44
|
-
* Must have _subject_ (substring)
|
|
45
|
-
* Must cotnain _body_text_ (substring)
|
|
46
|
-
* Quality of Service, if the email does not arrive w/in eg. 5 minutes we return an error w/ timeout.
|
|
47
|
-
* * `auxta.clickInMail(_from_name_, _from_email_, _subject_, _click_on_)`
|
|
48
|
-
|
|
49
|
-
## Running
|
|
50
|
-
|
|
51
|
-
* Create a main function that calls the run() function which starts all tests
|
|
52
|
-
* Create a function for each test that calls the `auxtaPuppeteer.run(event, callback, featureName, scenarioName)` function
|
|
53
|
-
|
|
54
|
-
## Puppeteer
|
|
55
|
-
|
|
56
|
-
https://pptr.dev
|
|
57
|
-
|
|
58
|
-
https://github.com/puppeteer/puppeteer
|
|
59
|
-
|
|
60
|
-
## Install
|
|
61
|
-
|
|
62
|
-
npm i
|
|
63
|
-
|
|
64
|
-
## Setup
|
|
65
|
-
|
|
66
|
-
```
|
|
67
|
-
{
|
|
68
|
-
# All background functions that will be run, listed
|
|
69
|
-
"suitesList": [
|
|
70
|
-
"{filename}-background"
|
|
71
|
-
],
|
|
72
|
-
# The tested site's url
|
|
73
|
-
"baseURL": "https://{sitename}/",
|
|
74
|
-
# The url where the tests are ran
|
|
75
|
-
"testsURL": "https://{sitename}/",
|
|
76
|
-
# The organization's name
|
|
77
|
-
"organization": "string",
|
|
78
|
-
# The digital product's name
|
|
79
|
-
"digitalProduct": "bedrijfsfinanciering.com",
|
|
80
|
-
# Max timeout in milliseconds
|
|
81
|
-
# Default 1000
|
|
82
|
-
"timeout": 1000,
|
|
83
|
-
# The credentials of the user that uploads the tests to the site
|
|
84
|
-
"email": "string",
|
|
85
|
-
"password": "string",
|
|
86
|
-
"token": "string"
|
|
87
|
-
# Screen width and height used in the testing
|
|
88
|
-
# Allows testing from mobile devices screens
|
|
89
|
-
"screenWidth": 1920,
|
|
90
|
-
"screenHeight": 1080,
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
```
|
|
1
|
+
# AuxTA
|
|
2
|
+
|
|
3
|
+
## Implementing
|
|
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
|
+
### Working with Tab
|
|
26
|
+
|
|
27
|
+
...
|
|
28
|
+
|
|
29
|
+
### Complex Workflows
|
|
30
|
+
|
|
31
|
+
#### Email
|
|
32
|
+
|
|
33
|
+
* (AuxTA) We do some action on the website.
|
|
34
|
+
* (Website) Sends an email to the email address of the user who did the action.
|
|
35
|
+
* (AuxTA) Should check that that the email was correctly sent. So we check:
|
|
36
|
+
* `auxta.checkMail(_from_name_, _from_email_, _subject_, _body_text_)`
|
|
37
|
+
* The email login is in the main config of the test suite.
|
|
38
|
+
* email
|
|
39
|
+
* API TOKEN
|
|
40
|
+
* For the moment we do it synchroneous (AuxTA waits for the email).
|
|
41
|
+
* The email must be newser than the time of the action on the Website.
|
|
42
|
+
* Must be _from_name_ (substring)
|
|
43
|
+
* Must be _from_email_ (substring)
|
|
44
|
+
* Must have _subject_ (substring)
|
|
45
|
+
* Must cotnain _body_text_ (substring)
|
|
46
|
+
* Quality of Service, if the email does not arrive w/in eg. 5 minutes we return an error w/ timeout.
|
|
47
|
+
* * `auxta.clickInMail(_from_name_, _from_email_, _subject_, _click_on_)`
|
|
48
|
+
|
|
49
|
+
## Running
|
|
50
|
+
|
|
51
|
+
* Create a main function that calls the run() function which starts all tests
|
|
52
|
+
* Create a function for each test that calls the `auxtaPuppeteer.run(event, callback, featureName, scenarioName)` function
|
|
53
|
+
|
|
54
|
+
## Puppeteer
|
|
55
|
+
|
|
56
|
+
https://pptr.dev
|
|
57
|
+
|
|
58
|
+
https://github.com/puppeteer/puppeteer
|
|
59
|
+
|
|
60
|
+
## Install
|
|
61
|
+
|
|
62
|
+
npm i
|
|
63
|
+
|
|
64
|
+
## Setup
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
{
|
|
68
|
+
# All background functions that will be run, listed
|
|
69
|
+
"suitesList": [
|
|
70
|
+
"{filename}-background"
|
|
71
|
+
],
|
|
72
|
+
# The tested site's url
|
|
73
|
+
"baseURL": "https://{sitename}/",
|
|
74
|
+
# The url where the tests are ran
|
|
75
|
+
"testsURL": "https://{sitename}/",
|
|
76
|
+
# The organization's name
|
|
77
|
+
"organization": "string",
|
|
78
|
+
# The digital product's name
|
|
79
|
+
"digitalProduct": "bedrijfsfinanciering.com",
|
|
80
|
+
# Max timeout in milliseconds
|
|
81
|
+
# Default 1000
|
|
82
|
+
"timeout": 1000,
|
|
83
|
+
# The credentials of the user that uploads the tests to the site
|
|
84
|
+
"email": "string",
|
|
85
|
+
"password": "string",
|
|
86
|
+
"token": "string"
|
|
87
|
+
# Screen width and height used in the testing
|
|
88
|
+
# Allows testing from mobile devices screens
|
|
89
|
+
"screenWidth": 1920,
|
|
90
|
+
"screenHeight": 1080,
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
##backlog
|
|
96
|
+
Implement a way to scout the skipped steps w/ $failed=true, $skipped=++
|
|
97
|
+
control click go to source directory
|
package/build/cjs/AuxTA.d.ts
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
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
|
-
token: string;
|
|
18
|
-
screenWidth: number;
|
|
19
|
-
screenHeight: number;
|
|
20
|
-
timeout: number;
|
|
21
|
-
suitesList: never[];
|
|
22
|
-
googleEmail: string;
|
|
23
|
-
auxtaCredentials: {
|
|
24
|
-
email: string;
|
|
25
|
-
password: string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
email: import("./macros/helpers/emailHelper").EmailHelper;
|
|
29
|
-
private readonly uploadModel;
|
|
30
|
-
constructor();
|
|
31
|
-
run(event: any, overrideConfig?: any): Promise<{
|
|
32
|
-
nextSuites?: undefined;
|
|
33
|
-
reportId?: undefined;
|
|
34
|
-
currentSuite?: undefined;
|
|
35
|
-
retries?: undefined;
|
|
36
|
-
} | {
|
|
37
|
-
nextSuites: string[];
|
|
38
|
-
reportId: string | undefined;
|
|
39
|
-
currentSuite: string | undefined;
|
|
40
|
-
retries: string;
|
|
41
|
-
}>;
|
|
42
|
-
private changeModelData;
|
|
43
|
-
startBrowser(event: any, callback: any, feature: string, scenario: string, overrideConfig?: any, singleFeature?: boolean, fileName?: string): Promise<{
|
|
44
|
-
nextSuites?: undefined;
|
|
45
|
-
reportId?: undefined;
|
|
46
|
-
currentSuite?: undefined;
|
|
47
|
-
retries?: undefined;
|
|
48
|
-
} | {
|
|
49
|
-
nextSuites: string[];
|
|
50
|
-
reportId: string | undefined;
|
|
51
|
-
currentSuite: string | undefined;
|
|
52
|
-
retries: string;
|
|
53
|
-
} | {
|
|
54
|
-
statusCode: number;
|
|
55
|
-
} | undefined>;
|
|
56
|
-
startBrowserRPA(event: any, callback: any, baseURL: string, fileName?: string): Promise<any>;
|
|
57
|
-
getUploadModel(): UploadModel;
|
|
58
|
-
}
|
|
59
|
-
export declare const StepStatus: typeof StatusOfStep;
|
|
60
|
-
declare const auxta: AuxTA;
|
|
61
|
-
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
|
+
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
|
+
token: string;
|
|
18
|
+
screenWidth: number;
|
|
19
|
+
screenHeight: number;
|
|
20
|
+
timeout: number;
|
|
21
|
+
suitesList: never[];
|
|
22
|
+
googleEmail: string;
|
|
23
|
+
auxtaCredentials: {
|
|
24
|
+
email: string;
|
|
25
|
+
password: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
email: import("./macros/helpers/emailHelper").EmailHelper;
|
|
29
|
+
private readonly uploadModel;
|
|
30
|
+
constructor();
|
|
31
|
+
run(event: any, overrideConfig?: any): Promise<{
|
|
32
|
+
nextSuites?: undefined;
|
|
33
|
+
reportId?: undefined;
|
|
34
|
+
currentSuite?: undefined;
|
|
35
|
+
retries?: undefined;
|
|
36
|
+
} | {
|
|
37
|
+
nextSuites: string[];
|
|
38
|
+
reportId: string | undefined;
|
|
39
|
+
currentSuite: string | undefined;
|
|
40
|
+
retries: string;
|
|
41
|
+
}>;
|
|
42
|
+
private changeModelData;
|
|
43
|
+
startBrowser(event: any, callback: any, feature: string, scenario: string, overrideConfig?: any, singleFeature?: boolean, fileName?: string): Promise<{
|
|
44
|
+
nextSuites?: undefined;
|
|
45
|
+
reportId?: undefined;
|
|
46
|
+
currentSuite?: undefined;
|
|
47
|
+
retries?: undefined;
|
|
48
|
+
} | {
|
|
49
|
+
nextSuites: string[];
|
|
50
|
+
reportId: string | undefined;
|
|
51
|
+
currentSuite: string | undefined;
|
|
52
|
+
retries: string;
|
|
53
|
+
} | {
|
|
54
|
+
statusCode: number;
|
|
55
|
+
} | undefined>;
|
|
56
|
+
startBrowserRPA(event: any, callback: any, baseURL: string, fileName?: string): Promise<any>;
|
|
57
|
+
getUploadModel(): UploadModel;
|
|
58
|
+
}
|
|
59
|
+
export declare const StepStatus: typeof StatusOfStep;
|
|
60
|
+
declare const auxta: AuxTA;
|
|
61
|
+
export default auxta;
|
package/build/cjs/AuxTA.js
CHANGED
|
@@ -1,152 +1,152 @@
|
|
|
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);
|
|
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
|
-
this.config = (0, config_1.setupOverrideConfig)(overrideConfig);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
startBrowser(event, callback, feature, scenario, overrideConfig, singleFeature = false, fileName = '') {
|
|
125
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
126
|
-
this.changeModelData(overrideConfig);
|
|
127
|
-
if (singleFeature && process.env.ENVIRONMENT !== 'LOCAL') {
|
|
128
|
-
this.uploadModel.reportId = yield (0, report_service_1.createEmptyReport)(this.uploadModel);
|
|
129
|
-
this.uploadModel.currentSuite = fileName;
|
|
130
|
-
this.uploadModel.nextSuites = [];
|
|
131
|
-
}
|
|
132
|
-
return this.puppeteer.run(event, callback, feature, scenario);
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
startBrowserRPA(event, callback, baseURL, fileName = '') {
|
|
136
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
137
|
-
this.changeModelData({
|
|
138
|
-
baseURL: baseURL,
|
|
139
|
-
environment: '',
|
|
140
|
-
digitalProduct: ''
|
|
141
|
-
});
|
|
142
|
-
this.uploadModel.currentSuite = fileName;
|
|
143
|
-
return this.puppeteer.runRPA(event, callback);
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
getUploadModel() {
|
|
147
|
-
return this.uploadModel;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
exports.StepStatus = status_of_step_1.default;
|
|
151
|
-
const auxta = new AuxTA();
|
|
152
|
-
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
|
+
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);
|
|
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
|
+
this.config = (0, config_1.setupOverrideConfig)(overrideConfig);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
startBrowser(event, callback, feature, scenario, overrideConfig, singleFeature = false, fileName = '') {
|
|
125
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
126
|
+
this.changeModelData(overrideConfig);
|
|
127
|
+
if (singleFeature && process.env.ENVIRONMENT !== 'LOCAL') {
|
|
128
|
+
this.uploadModel.reportId = yield (0, report_service_1.createEmptyReport)(this.uploadModel);
|
|
129
|
+
this.uploadModel.currentSuite = fileName;
|
|
130
|
+
this.uploadModel.nextSuites = [];
|
|
131
|
+
}
|
|
132
|
+
return this.puppeteer.run(event, callback, feature, scenario);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
startBrowserRPA(event, callback, baseURL, fileName = '') {
|
|
136
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
137
|
+
this.changeModelData({
|
|
138
|
+
baseURL: baseURL,
|
|
139
|
+
environment: '',
|
|
140
|
+
digitalProduct: ''
|
|
141
|
+
});
|
|
142
|
+
this.uploadModel.currentSuite = fileName;
|
|
143
|
+
return this.puppeteer.runRPA(event, callback);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
getUploadModel() {
|
|
147
|
+
return this.uploadModel;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
exports.StepStatus = status_of_step_1.default;
|
|
151
|
+
const auxta = new AuxTA();
|
|
152
|
+
exports.default = auxta;
|