@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
@@ -1,32 +0,0 @@
1
- export declare class UploadModel {
2
- private _reportId;
3
- private _nextSuites;
4
- private _digitalProduct;
5
- private _baseUrl;
6
- private readonly _organization;
7
- private _environment;
8
- private _currentSuite;
9
- private _retries;
10
- private _featureName;
11
- private _scenarioName;
12
- constructor(org: string, baseUrl: string, digitalProduct: string, environment: string);
13
- set currentSuite(value: string);
14
- set retries(value: number);
15
- get currentSuite(): string;
16
- get retries(): number;
17
- get reportId(): string;
18
- set reportId(value: string);
19
- get nextSuites(): [];
20
- set nextSuites(value: []);
21
- get digitalProduct(): string;
22
- set digitalProduct(value: string);
23
- get organization(): string;
24
- get baseUrl(): string;
25
- set baseUrl(value: string);
26
- get environment(): string;
27
- set environment(value: string);
28
- get featureName(): string;
29
- set featureName(value: string);
30
- get scenarioName(): string;
31
- set scenarioName(value: string);
32
- }
@@ -1,75 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UploadModel = void 0;
4
- class UploadModel {
5
- constructor(org, baseUrl, digitalProduct, environment) {
6
- this._reportId = '';
7
- this._nextSuites = [];
8
- this._currentSuite = '';
9
- this._retries = 0;
10
- this._organization = org;
11
- this._digitalProduct = digitalProduct;
12
- this._environment = environment;
13
- this._baseUrl = baseUrl;
14
- this._featureName = '';
15
- this._scenarioName = '';
16
- }
17
- set currentSuite(value) {
18
- this._currentSuite = value;
19
- }
20
- set retries(value) {
21
- this._retries = value;
22
- }
23
- get currentSuite() {
24
- return this._currentSuite;
25
- }
26
- get retries() {
27
- return this._retries;
28
- }
29
- get reportId() {
30
- return this._reportId;
31
- }
32
- set reportId(value) {
33
- this._reportId = value;
34
- }
35
- get nextSuites() {
36
- return this._nextSuites;
37
- }
38
- set nextSuites(value) {
39
- this._nextSuites = value;
40
- }
41
- get digitalProduct() {
42
- return this._digitalProduct;
43
- }
44
- set digitalProduct(value) {
45
- this._digitalProduct = value;
46
- }
47
- get organization() {
48
- return this._organization;
49
- }
50
- get baseUrl() {
51
- return this._baseUrl;
52
- }
53
- set baseUrl(value) {
54
- this._baseUrl = value;
55
- }
56
- get environment() {
57
- return this._environment;
58
- }
59
- set environment(value) {
60
- this._environment = value;
61
- }
62
- get featureName() {
63
- return this._featureName;
64
- }
65
- set featureName(value) {
66
- this._featureName = value;
67
- }
68
- get scenarioName() {
69
- return this._scenarioName;
70
- }
71
- set scenarioName(value) {
72
- this._scenarioName = value;
73
- }
74
- }
75
- exports.UploadModel = UploadModel;
@@ -1,26 +0,0 @@
1
- import { StatusOfStep } from "../enums/status-of.step";
2
- export interface Step {
3
- keyword: string;
4
- name: string;
5
- result: {
6
- status: StatusOfStep;
7
- duration: number;
8
- };
9
- }
10
- export declare class LogSteps {
11
- private stepLog;
12
- private lastStepTime;
13
- statusCounter: {
14
- passed: number;
15
- failed: number;
16
- skipped: number;
17
- suggestion: number;
18
- };
19
- addSuggestion(text: string): void;
20
- clear(): void;
21
- push(keyword: string, name: string, status: StatusOfStep): void;
22
- returnScenarioReport(): Step[];
23
- getStatusCount(status: StatusOfStep): number;
24
- }
25
- declare const log: LogSteps;
26
- export default log;
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LogSteps = void 0;
4
- const status_of_step_1 = require("../enums/status-of.step");
5
- class LogSteps {
6
- constructor() {
7
- this.stepLog = [];
8
- this.lastStepTime = new Date().getTime();
9
- this.statusCounter = {
10
- [status_of_step_1.StatusOfStep.PASSED]: 0,
11
- [status_of_step_1.StatusOfStep.FAILED]: 0,
12
- [status_of_step_1.StatusOfStep.SKIPPED]: 0,
13
- [status_of_step_1.StatusOfStep.SUGGESTION]: 0,
14
- };
15
- }
16
- addSuggestion(text) {
17
- this.statusCounter[status_of_step_1.StatusOfStep.SUGGESTION]++;
18
- this.stepLog.push({
19
- keyword: 'Suggestion', name: text, result: { status: status_of_step_1.StatusOfStep.SUGGESTION, duration: 0 }
20
- });
21
- }
22
- clear() {
23
- this.stepLog = [];
24
- this.statusCounter = {
25
- [status_of_step_1.StatusOfStep.PASSED]: 0,
26
- [status_of_step_1.StatusOfStep.FAILED]: 0,
27
- [status_of_step_1.StatusOfStep.SKIPPED]: 0,
28
- [status_of_step_1.StatusOfStep.SUGGESTION]: 0,
29
- };
30
- }
31
- push(keyword, name, status) {
32
- console.log(`System log -- status: ${status} -- : ${name} `);
33
- this.statusCounter[status]++;
34
- const currentStep = new Date().getTime();
35
- this.stepLog.push({ keyword, name, result: { status, duration: currentStep - this.lastStepTime } });
36
- this.lastStepTime = currentStep;
37
- }
38
- returnScenarioReport() {
39
- return this.stepLog;
40
- }
41
- getStatusCount(status) {
42
- return this.statusCounter[status];
43
- }
44
- }
45
- exports.LogSteps = LogSteps;
46
- const log = new LogSteps();
47
- exports.default = log;
@@ -1,36 +0,0 @@
1
- /// <reference types="node" />
2
- import { Step } from "./log.service";
3
- import { UploadModel } from "../models/upload.model";
4
- export interface Feature {
5
- featureId: string;
6
- featureName: string;
7
- featureUri: string;
8
- status: string;
9
- scenariosCount: number;
10
- }
11
- export interface Scenario {
12
- featureId: string;
13
- featureName: string;
14
- featureUri: string;
15
- status: string;
16
- scenariosCount: number;
17
- }
18
- export interface Steps {
19
- failedSteps: number;
20
- passedSteps: number;
21
- skippedSteps: number;
22
- suggestedSteps: number;
23
- }
24
- export declare function createEmptyReport(body: any): Promise<string>;
25
- export declare function uploadScenario(stepLog: Step[], scenarioName: string, screenshot?: Buffer, errMessage?: object): Promise<{
26
- scenarioRef: any;
27
- name: any;
28
- status: any;
29
- stepsCount: any;
30
- }[]>;
31
- export declare function uploadFeature(scenarioId: any[], scenarioName: string, uri: string, hasFailed: boolean): Promise<any>;
32
- export declare function updateReport(reportId: string, feature: Feature, steps: Steps, isFinal: boolean): Promise<void>;
33
- export declare function getReport(reportId: string): Promise<any>;
34
- export declare function getLastDayResults(): Promise<any>;
35
- export declare function postNotifications(body: UploadModel): Promise<void>;
36
- export declare function postNotificationsOnFail(body: UploadModel): Promise<void>;
@@ -1,164 +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.postNotificationsOnFail = exports.postNotifications = exports.getLastDayResults = exports.getReport = exports.updateReport = exports.uploadFeature = exports.uploadScenario = exports.createEmptyReport = void 0;
16
- const axios_1 = __importDefault(require("axios"));
17
- const config_1 = require("../configs/config");
18
- function headers(token) {
19
- return {
20
- headers: {
21
- 'Content-Type': 'application/json',
22
- 'cookie': `authToken=${token}`
23
- }
24
- };
25
- }
26
- function auth() {
27
- return __awaiter(this, void 0, void 0, function* () {
28
- return axios_1.default.post(config_1.config.auxtaURL + 'login', config_1.config.auxtaCredentials, {
29
- headers: {
30
- 'Content-Type': 'application/json',
31
- }
32
- })
33
- .then(({ data }) => {
34
- return data.token;
35
- })
36
- .catch(() => {
37
- throw new Error("Invalid login credentials");
38
- });
39
- });
40
- }
41
- function createEmptyReport(body) {
42
- return __awaiter(this, void 0, void 0, function* () {
43
- const token = yield auth();
44
- return (yield axios_1.default.post(config_1.config.auxtaURL + "create-empty-report", {
45
- environment: body.environment,
46
- digitalProductName: body.digitalProduct,
47
- start: new Date(),
48
- url: body.baseUrl
49
- }, headers(token))).data.reportId;
50
- });
51
- }
52
- exports.createEmptyReport = createEmptyReport;
53
- function uploadScenario(stepLog, scenarioName, screenshot, errMessage) {
54
- return __awaiter(this, void 0, void 0, function* () {
55
- let scenarios = [];
56
- let token = yield auth();
57
- let lastStep = stepLog[stepLog.length - 1];
58
- const stepLogFormat = JSON.parse(JSON.stringify(stepLog));
59
- stepLogFormat.pop();
60
- let output = (yield axios_1.default.post(config_1.config.auxtaURL + "create-scenario", {
61
- json: {
62
- name: scenarioName,
63
- steps: [
64
- ...stepLogFormat,
65
- (lastStep.result.status == 'failed')
66
- ? Object.assign(lastStep, {
67
- result: Object.assign(Object.assign({}, lastStep.result), { error_message: JSON.stringify(errMessage) })
68
- })
69
- : lastStep,
70
- {
71
- keyword: "After",
72
- result: {
73
- status: "passed",
74
- duration: 2678000000
75
- },
76
- embeddings: (screenshot) ? [{
77
- data: screenshot.toString("base64"),
78
- mime_type: "image/png"
79
- }] : undefined,
80
- }
81
- ],
82
- }
83
- }, headers(token))).data.scenarios;
84
- scenarios.push({
85
- scenarioRef: output.scenarioRef,
86
- name: output.name,
87
- status: output.status,
88
- stepsCount: output.stepsCount
89
- });
90
- return scenarios;
91
- });
92
- }
93
- exports.uploadScenario = uploadScenario;
94
- function uploadFeature(scenarioId, scenarioName, uri, hasFailed) {
95
- return __awaiter(this, void 0, void 0, function* () {
96
- let token = yield auth();
97
- return (yield axios_1.default.post(config_1.config.auxtaURL + "create-feature", {
98
- json: {
99
- name: scenarioName,
100
- uri: uri
101
- },
102
- scenarios: scenarioId,
103
- hasFailed: hasFailed
104
- }, headers(token))).data;
105
- });
106
- }
107
- exports.uploadFeature = uploadFeature;
108
- function updateReport(reportId, feature, steps, isFinal) {
109
- return __awaiter(this, void 0, void 0, function* () {
110
- let token = yield auth();
111
- yield axios_1.default.post(config_1.config.auxtaURL + "update-inprogress-report", {
112
- reportId: reportId,
113
- isFinal: isFinal,
114
- data: Object.assign({ feature: {
115
- featureRef: feature.featureId,
116
- name: feature.featureName,
117
- uri: feature.featureUri,
118
- status: feature.status,
119
- scenariosCount: feature.scenariosCount
120
- } }, steps)
121
- }, headers(token));
122
- });
123
- }
124
- exports.updateReport = updateReport;
125
- function getReport(reportId) {
126
- return __awaiter(this, void 0, void 0, function* () {
127
- let token = yield auth();
128
- return (yield axios_1.default.post(config_1.config.auxtaURL + "get-report", { reportId: reportId }, headers(token))).data;
129
- });
130
- }
131
- exports.getReport = getReport;
132
- function getLastDayResults() {
133
- return __awaiter(this, void 0, void 0, function* () {
134
- let token = yield auth();
135
- return (yield axios_1.default.get(config_1.config.auxtaURL + `get-last-day-results?url=${config_1.config.baseURL}`, headers(token))).data.results;
136
- });
137
- }
138
- exports.getLastDayResults = getLastDayResults;
139
- function postNotifications(body) {
140
- return __awaiter(this, void 0, void 0, function* () {
141
- let token = yield auth();
142
- yield axios_1.default.post(`${config_1.config.auxtaURL}post-notification-after-run-background`, {
143
- environmentName: body.environment,
144
- digitalProductName: body.digitalProduct,
145
- organizationName: body.organization,
146
- reportId: body.reportId,
147
- }, headers(token));
148
- });
149
- }
150
- exports.postNotifications = postNotifications;
151
- function postNotificationsOnFail(body) {
152
- return __awaiter(this, void 0, void 0, function* () {
153
- let token = yield auth();
154
- yield axios_1.default.post(`${config_1.config.auxtaURL}post-notifications-after-case-fail-background`, {
155
- environmentName: body.environment,
156
- digitalProductName: body.digitalProduct,
157
- organizationName: body.organization,
158
- reportId: body.reportId,
159
- featureName: body.featureName,
160
- scenarioName: body.scenarioName
161
- }, headers(token));
162
- });
163
- }
164
- exports.postNotificationsOnFail = postNotificationsOnFail;
@@ -1,16 +0,0 @@
1
- export interface RunTime {
2
- duration: String;
3
- startTime: Date;
4
- endTime: Date;
5
- }
6
- export declare class Runtime {
7
- private start;
8
- private end;
9
- private runtime;
10
- constructor(s: Date, e: Date);
11
- private calculateDuration;
12
- private splitAtDecimanlMinutes;
13
- private splitAtDecimanlHours;
14
- private formatRuntime;
15
- returnRuntime(): RunTime;
16
- }
@@ -1,41 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Runtime = void 0;
4
- class Runtime {
5
- constructor(s, e) {
6
- this.start = s;
7
- this.end = e;
8
- }
9
- calculateDuration() {
10
- let currentTime = new Date;
11
- let duration = currentTime.getTime() - this.start.getTime();
12
- return duration;
13
- }
14
- splitAtDecimanlMinutes(time) {
15
- let minutes = time.toFixed(2).toString().split('.');
16
- return `${minutes[0]}m ${(Number(minutes[1]) / 100 * 60).toFixed(0)}s`;
17
- }
18
- splitAtDecimanlHours(time) {
19
- let hours = time.toFixed(2).toString().split('.');
20
- let minutes = (Number(hours[1]) / 100 * 60).toFixed(2).toString().split('.');
21
- return `${hours[0]}h ${minutes[0]}m ${(Number(minutes[1]) / 100 * 60).toFixed(0)}s`;
22
- }
23
- formatRuntime(duration) {
24
- if (duration / 1000 < 60)
25
- return `${(duration / 1000).toFixed(0)}s`;
26
- else {
27
- if (duration / 60000 < 60)
28
- return this.splitAtDecimanlMinutes(duration / 60000);
29
- else
30
- return this.splitAtDecimanlHours(duration / 3600000);
31
- }
32
- }
33
- returnRuntime() {
34
- let duration = this.formatRuntime(this.calculateDuration());
35
- let startTime = this.start;
36
- let endTime = this.end;
37
- this.runtime = { duration, startTime, endTime };
38
- return this.runtime;
39
- }
40
- }
41
- exports.Runtime = Runtime;
@@ -1,15 +0,0 @@
1
- import { RunTime } from "../services/runtime.service";
2
- export declare class CalculateRuntime {
3
- private runtime;
4
- startTimeSeconds: string;
5
- startTimeMinutes: string;
6
- startTimeHours: string;
7
- startTimeDay: string;
8
- startTimeMonth: string;
9
- endTimeSeconds: string;
10
- endTimeMinutes: string;
11
- endTimeHours: string;
12
- endTimeDay: string;
13
- endTimeMonth: string;
14
- constructor(r: RunTime);
15
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CalculateRuntime = void 0;
4
- class CalculateRuntime {
5
- constructor(r) {
6
- this.runtime = r;
7
- this.startTimeSeconds = (this.runtime.startTime.getSeconds() < 10) ? `0${this.runtime.startTime.getSeconds()}` : `${this.runtime.startTime.getSeconds()}`;
8
- this.startTimeMinutes = (this.runtime.startTime.getMinutes() < 10) ? `0${this.runtime.startTime.getMinutes()}` : `${this.runtime.startTime.getMinutes()}`;
9
- this.startTimeHours = (this.runtime.startTime.getHours() < 10) ? `0${this.runtime.startTime.getHours()}` : `${this.runtime.startTime.getHours()}`;
10
- this.startTimeDay = (this.runtime.startTime.getDate() < 10) ? `0${this.runtime.startTime.getDate()}` : `${this.runtime.startTime.getDate()}`;
11
- this.startTimeMonth = (this.runtime.startTime.getMonth() + 1 < 10) ? `0${this.runtime.startTime.getMonth() + 1}` : `${this.runtime.startTime.getMonth() + 1}`;
12
- this.endTimeSeconds = (this.runtime.endTime.getSeconds() < 10) ? `0${this.runtime.endTime.getSeconds()}` : `${this.runtime.endTime.getSeconds()}`;
13
- this.endTimeMinutes = (this.runtime.endTime.getMinutes() < 10) ? `0${this.runtime.endTime.getMinutes()}` : `${this.runtime.endTime.getMinutes()}`;
14
- this.endTimeHours = (this.runtime.endTime.getHours() < 10) ? `0${this.runtime.endTime.getHours()}` : `${this.runtime.endTime.getHours()}`;
15
- this.endTimeDay = (this.runtime.endTime.getDate() < 10) ? `0${this.runtime.endTime.getDate()}` : `${this.runtime.endTime.getDate()}`;
16
- this.endTimeMonth = (this.runtime.endTime.getMonth() + 1 < 10) ? `0${this.runtime.endTime.getMonth() + 1}` : `${this.runtime.endTime.getMonth() + 1}`;
17
- }
18
- }
19
- exports.CalculateRuntime = CalculateRuntime;
@@ -1,2 +0,0 @@
1
- /// <reference types="node" />
2
- export declare function captureScreenshot(): Promise<Buffer | undefined>;
@@ -1,36 +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.captureScreenshot = void 0;
16
- const puppeteer_1 = __importDefault(require("../../puppeteer/puppeteer"));
17
- function captureScreenshot() {
18
- return __awaiter(this, void 0, void 0, function* () {
19
- try {
20
- const pages = yield puppeteer_1.default.defaultPage.browser().pages();
21
- if (!pages.length)
22
- return undefined;
23
- const lastPage = pages[pages.length - 1] || puppeteer_1.default.defaultPage;
24
- const screenshotBuffer = yield lastPage.screenshot({
25
- fullPage: true,
26
- encoding: 'binary'
27
- });
28
- if (Buffer.isBuffer(screenshotBuffer))
29
- return screenshotBuffer;
30
- }
31
- catch (e) {
32
- }
33
- return undefined;
34
- });
35
- }
36
- exports.captureScreenshot = captureScreenshot;
@@ -1,17 +0,0 @@
1
- export declare function startSuite(suites: string[], reportId?: string): Promise<{
2
- nextSuites?: undefined;
3
- reportId?: undefined;
4
- currentSuite?: undefined;
5
- retries?: undefined;
6
- } | {
7
- nextSuites: string[];
8
- reportId: string | undefined;
9
- currentSuite: string | undefined;
10
- retries: string;
11
- }>;
12
- export declare function retrySuite(suites: string[], reportId: string, currentSuite: string, retries: number): Promise<false | {
13
- nextSuites: string[];
14
- reportId: string;
15
- currentSuite: string;
16
- retries: number;
17
- }>;
@@ -1,31 +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
- exports.retrySuite = exports.startSuite = void 0;
13
- function startSuite(suites, reportId) {
14
- return __awaiter(this, void 0, void 0, function* () {
15
- if (suites.length === 0)
16
- return {};
17
- const next = suites.shift();
18
- return { nextSuites: suites, reportId: reportId, currentSuite: next, retries: "0" };
19
- });
20
- }
21
- exports.startSuite = startSuite;
22
- function retrySuite(suites, reportId, currentSuite, retries) {
23
- return __awaiter(this, void 0, void 0, function* () {
24
- console.log('I repeat again the current suite: ' + currentSuite);
25
- if (retries >= 2) {
26
- return false;
27
- }
28
- return { nextSuites: suites, reportId: reportId, currentSuite: currentSuite, retries: retries };
29
- });
30
- }
31
- exports.retrySuite = retrySuite;
@@ -1,7 +0,0 @@
1
- export declare class Aux2faAuth {
2
- authenticator(): any;
3
- verifyToken(token: string): boolean;
4
- private getSecret;
5
- }
6
- declare const _default: Aux2faAuth;
7
- export default _default;
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Aux2faAuth = void 0;
4
- const twofactor = require("node-2fa");
5
- class Aux2faAuth {
6
- authenticator() {
7
- const aux2fe_secret = this.getSecret();
8
- return twofactor.generateToken(aux2fe_secret).token;
9
- }
10
- verifyToken(token) {
11
- const aux2fe_secret = this.getSecret();
12
- const result = twofactor.verifyToken(aux2fe_secret, token);
13
- if (result != null) {
14
- if (result.delta == 0) {
15
- return true;
16
- }
17
- }
18
- return false;
19
- }
20
- getSecret() {
21
- const aux2fe_secret = process.env.aux2fe_secret;
22
- if (!aux2fe_secret) {
23
- throw new Error('No 2fe secret set');
24
- }
25
- return aux2fe_secret;
26
- }
27
- }
28
- exports.Aux2faAuth = Aux2faAuth;
29
- exports.default = new Aux2faAuth();
@@ -1,21 +0,0 @@
1
- import { StatusOfStep } from "../../auxta/enums/status-of.step";
2
- import { ExtendDefaultPage } from "./extend-default-page";
3
- export declare class FunctionHelper extends ExtendDefaultPage {
4
- log(keyword: string, name: string, status: StatusOfStep): void;
5
- suggest(name: string): void;
6
- private getEscapedText;
7
- clickByText(selector: string, text: string, dotOrText?: string, page?: import("puppeteer").Page, time?: number, log_message?: boolean): Promise<void>;
8
- clickByTextWithClass(class_selector: string, class_name: string, selector: string, text: string, dotOrText?: string, page?: import("puppeteer").Page): Promise<void>;
9
- waitForSelectorWithText(selector: string, text: string, dotOrText?: string, page?: import("puppeteer").Page): Promise<boolean>;
10
- timeout(timeout?: number, page?: import("puppeteer").Page): Promise<void>;
11
- waitForSelector(option: string, selector: string, time?: number, page?: import("puppeteer").Page, log_message?: boolean): Promise<void>;
12
- urlContains(selector: string, page?: import("puppeteer").Page): Promise<void>;
13
- pressEnter(page?: import("puppeteer").Page): Promise<void>;
14
- emulate(phone_name: string, page?: import("puppeteer").Page): Promise<void>;
15
- restartBrowser(): Promise<void>;
16
- clickAndWaitForPageToBeCreated(selector: string, page?: import("puppeteer").Page): Promise<void>;
17
- closeLastPage(page?: import("puppeteer").Page): Promise<void>;
18
- microsoftLogin(button: string, email: string, password: string): Promise<void>;
19
- }
20
- declare const _default: FunctionHelper;
21
- export default _default;