@auxcode/auxta 1.3.15 → 1.3.17-beta.0

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/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 +23 -21
  31. package/build/cjs/macros/helpers/code.helper.js +166 -192
  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 +200 -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 +23 -21
  65. package/build/esm/macros/helpers/code.helper.js +159 -185
  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 +192 -192
  70. package/build/tsconfig-cjs.tsbuildinfo +1 -1
  71. package/build/tsconfig.tsbuildinfo +1 -1
  72. package/package.json +29 -29
@@ -1,26 +1,26 @@
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
+ 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 +1,47 @@
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
+ "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 +1,36 @@
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
+ /// <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 +1,164 @@
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
+ "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 +1,16 @@
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
+ 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
+ }