@auxcode/auxta 1.3.44 → 1.3.45-beta.1

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.
@@ -49,7 +49,7 @@ function setupOverrideConfig(overrideConfig) {
49
49
  }
50
50
  exports.setupOverrideConfig = setupOverrideConfig;
51
51
  exports.config = {
52
- auxtaURL: "https://auxta.live/.netlify/functions/",
52
+ auxtaURL: "http://localhost:8888/.netlify/functions/",
53
53
  baseURL: "",
54
54
  siteURL: "",
55
55
  organization: "",
@@ -25,12 +25,12 @@ function onTestEnd(body, featureName, scenarioName, statusCode, screenshotBuffer
25
25
  console.log('--- Uploading scenario and feature for AUXTA report ---');
26
26
  const stepsArr = log_service_1.default.returnScenarioReport();
27
27
  try {
28
- const scenarioRes = yield (0, report_service_1.uploadScenario)(stepsArr, scenarioName, screenshotBuffer, errMessage);
29
- const featureRes = yield (0, report_service_1.uploadFeature)(scenarioRes, featureName, (0, path_1.basename)(__filename), (statusCode != 200));
30
- const feature = {
31
- featureId: featureRes.featureRef,
32
- featureName: featureRes.name,
33
- featureUri: featureRes.uri,
28
+ const stepRes = yield (0, report_service_1.uploadStep)(stepsArr, scenarioName, screenshotBuffer, errMessage);
29
+ const featureRes = yield (0, report_service_1.uploadFeature)(stepRes, featureName, (0, path_1.basename)(__filename), (statusCode != 200));
30
+ const scenario = {
31
+ scenarioId: featureRes.featureRef,
32
+ scenarioName: featureRes.name,
33
+ scenarioUri: featureRes.uri,
34
34
  status: featureRes.status,
35
35
  scenariosCount: featureRes.scenariosCount,
36
36
  lastFiveStepsHash: featureRes.lastFiveStepsHash
@@ -42,7 +42,7 @@ function onTestEnd(body, featureName, scenarioName, statusCode, screenshotBuffer
42
42
  suggestedSteps: log_service_1.default.getStatusCount(status_of_step_1.StatusOfStep.SUGGESTION)
43
43
  };
44
44
  isFinal = (!(body.nextSuites && body.nextSuites.length > 0));
45
- yield (0, report_service_1.updateReport)(body.reportId, feature, stepCounts, isFinal);
45
+ yield (0, report_service_1.updateReport)(body.reportId, scenario, stepCounts, isFinal);
46
46
  console.log('--- Finished uploading report data to AUXTA ---');
47
47
  }
48
48
  catch (error) {
@@ -1,10 +1,10 @@
1
1
  /// <reference types="node" />
2
2
  import { Step } from "./log.service";
3
3
  import { UploadModel } from "../models/upload.model";
4
- export interface Feature {
5
- featureId: string;
6
- featureName: string;
7
- featureUri: string;
4
+ export interface Scenarios {
5
+ scenarioId: string;
6
+ scenarioName: string;
7
+ scenarioUri: string;
8
8
  status: string;
9
9
  scenariosCount: number;
10
10
  lastFiveStepsHash: number;
@@ -16,14 +16,14 @@ export interface Steps {
16
16
  suggestedSteps: number;
17
17
  }
18
18
  export declare function createEmptyReport(body: any): Promise<string>;
19
- export declare function uploadScenario(stepLog: Step[], scenarioName: string, screenshot?: Buffer, errMessage?: object): Promise<{
20
- scenarioRef: any;
19
+ export declare function uploadStep(stepLog: Step[], scenarioName: string, screenshot?: Buffer, errMessage?: object): Promise<{
20
+ stepRef: any;
21
21
  name: any;
22
22
  status: any;
23
23
  stepsCount: any;
24
24
  }[]>;
25
- export declare function uploadFeature(scenarioId: any[], scenarioName: string, uri: string, hasFailed: boolean): Promise<any>;
26
- export declare function updateReport(reportId: string, feature: Feature, steps: Steps, isFinal: boolean): Promise<void>;
25
+ export declare function uploadFeature(stepRes: any[], scenarioName: string, uri: string, hasFailed: boolean): Promise<any>;
26
+ export declare function updateReport(reportId: string, scenario: Scenarios, steps: Steps, isFinal: boolean): Promise<void>;
27
27
  export declare function getReport(reportId: string): Promise<any>;
28
28
  export declare function getLastDayResults(): Promise<any>;
29
29
  export declare function postNotifications(body: UploadModel): Promise<void>;
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
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;
15
+ exports.postNotificationsOnFail = exports.postNotifications = exports.getLastDayResults = exports.getReport = exports.updateReport = exports.uploadFeature = exports.uploadStep = exports.createEmptyReport = void 0;
16
16
  const axios_1 = __importDefault(require("axios"));
17
17
  const config_1 = require("../configs/config");
18
18
  function headers(token) {
@@ -51,14 +51,14 @@ function createEmptyReport(body) {
51
51
  });
52
52
  }
53
53
  exports.createEmptyReport = createEmptyReport;
54
- function uploadScenario(stepLog, scenarioName, screenshot, errMessage) {
54
+ function uploadStep(stepLog, scenarioName, screenshot, errMessage) {
55
55
  return __awaiter(this, void 0, void 0, function* () {
56
56
  let scenarios = [];
57
57
  let token = yield auth();
58
58
  let lastStep = stepLog[stepLog.length - 1];
59
59
  const stepLogFormat = JSON.parse(JSON.stringify(stepLog));
60
60
  stepLogFormat.pop();
61
- let output = (yield axios_1.default.post(config_1.config.auxtaURL + "create-scenario", {
61
+ let output = (yield axios_1.default.post(config_1.config.auxtaURL + "create-steps", {
62
62
  json: {
63
63
  name: scenarioName,
64
64
  steps: [
@@ -83,7 +83,7 @@ function uploadScenario(stepLog, scenarioName, screenshot, errMessage) {
83
83
  }
84
84
  }, headers(token))).data.scenarios;
85
85
  scenarios.push({
86
- scenarioRef: output.scenarioRef,
86
+ stepRef: output.stepRef,
87
87
  name: output.name,
88
88
  status: output.status,
89
89
  stepsCount: output.stepsCount
@@ -91,8 +91,8 @@ function uploadScenario(stepLog, scenarioName, screenshot, errMessage) {
91
91
  return scenarios;
92
92
  });
93
93
  }
94
- exports.uploadScenario = uploadScenario;
95
- function uploadFeature(scenarioId, scenarioName, uri, hasFailed) {
94
+ exports.uploadStep = uploadStep;
95
+ function uploadFeature(stepRes, scenarioName, uri, hasFailed) {
96
96
  return __awaiter(this, void 0, void 0, function* () {
97
97
  let token = yield auth();
98
98
  return (yield axios_1.default.post(config_1.config.auxtaURL + "create-feature", {
@@ -100,25 +100,25 @@ function uploadFeature(scenarioId, scenarioName, uri, hasFailed) {
100
100
  name: scenarioName,
101
101
  uri: uri
102
102
  },
103
- scenarios: scenarioId,
103
+ scenarios: stepRes,
104
104
  hasFailed: hasFailed
105
105
  }, headers(token))).data;
106
106
  });
107
107
  }
108
108
  exports.uploadFeature = uploadFeature;
109
- function updateReport(reportId, feature, steps, isFinal) {
109
+ function updateReport(reportId, scenario, steps, isFinal) {
110
110
  return __awaiter(this, void 0, void 0, function* () {
111
111
  let token = yield auth();
112
112
  yield axios_1.default.post(config_1.config.auxtaURL + "update-inprogress-report", {
113
113
  reportId: reportId,
114
114
  isFinal: isFinal,
115
- data: Object.assign({ feature: {
116
- featureRef: feature.featureId,
117
- name: feature.featureName,
118
- uri: feature.featureUri,
119
- status: feature.status,
120
- scenariosCount: feature.scenariosCount,
121
- lastFiveStepsHash: feature.lastFiveStepsHash
115
+ data: Object.assign({ scenario: {
116
+ stepRef: scenario.scenarioId,
117
+ name: scenario.scenarioName,
118
+ uri: scenario.scenarioUri,
119
+ status: scenario.status,
120
+ scenariosCount: scenario.scenariosCount,
121
+ lastFiveStepsHash: scenario.lastFiveStepsHash
122
122
  } }, steps)
123
123
  }, headers(token));
124
124
  });
@@ -44,7 +44,7 @@ export function setupOverrideConfig(overrideConfig) {
44
44
  return config;
45
45
  }
46
46
  export let config = {
47
- auxtaURL: "https://auxta.live/.netlify/functions/",
47
+ auxtaURL: "http://localhost:8888/.netlify/functions/",
48
48
  baseURL: "",
49
49
  siteURL: "",
50
50
  organization: "",
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { basename } from 'path';
11
11
  import log from "../services/log.service";
12
- import { postNotifications, updateReport, uploadFeature, uploadScenario } from '../services/report.service';
12
+ import { postNotifications, updateReport, uploadFeature, uploadStep } from '../services/report.service';
13
13
  import { startSuite } from '../utilities/start-suite.helper';
14
14
  import { StatusOfStep } from "../enums/status-of.step";
15
15
  export function onTestEnd(body, featureName, scenarioName, statusCode, screenshotBuffer, errMessage) {
@@ -19,12 +19,12 @@ export function onTestEnd(body, featureName, scenarioName, statusCode, screensho
19
19
  console.log('--- Uploading scenario and feature for AUXTA report ---');
20
20
  const stepsArr = log.returnScenarioReport();
21
21
  try {
22
- const scenarioRes = yield uploadScenario(stepsArr, scenarioName, screenshotBuffer, errMessage);
23
- const featureRes = yield uploadFeature(scenarioRes, featureName, basename(__filename), (statusCode != 200));
24
- const feature = {
25
- featureId: featureRes.featureRef,
26
- featureName: featureRes.name,
27
- featureUri: featureRes.uri,
22
+ const stepRes = yield uploadStep(stepsArr, scenarioName, screenshotBuffer, errMessage);
23
+ const featureRes = yield uploadFeature(stepRes, featureName, basename(__filename), (statusCode != 200));
24
+ const scenario = {
25
+ scenarioId: featureRes.featureRef,
26
+ scenarioName: featureRes.name,
27
+ scenarioUri: featureRes.uri,
28
28
  status: featureRes.status,
29
29
  scenariosCount: featureRes.scenariosCount,
30
30
  lastFiveStepsHash: featureRes.lastFiveStepsHash
@@ -36,7 +36,7 @@ export function onTestEnd(body, featureName, scenarioName, statusCode, screensho
36
36
  suggestedSteps: log.getStatusCount(StatusOfStep.SUGGESTION)
37
37
  };
38
38
  isFinal = (!(body.nextSuites && body.nextSuites.length > 0));
39
- yield updateReport(body.reportId, feature, stepCounts, isFinal);
39
+ yield updateReport(body.reportId, scenario, stepCounts, isFinal);
40
40
  console.log('--- Finished uploading report data to AUXTA ---');
41
41
  }
42
42
  catch (error) {
@@ -1,10 +1,10 @@
1
1
  /// <reference types="node" />
2
2
  import { Step } from "./log.service";
3
3
  import { UploadModel } from "../models/upload.model";
4
- export interface Feature {
5
- featureId: string;
6
- featureName: string;
7
- featureUri: string;
4
+ export interface Scenarios {
5
+ scenarioId: string;
6
+ scenarioName: string;
7
+ scenarioUri: string;
8
8
  status: string;
9
9
  scenariosCount: number;
10
10
  lastFiveStepsHash: number;
@@ -16,14 +16,14 @@ export interface Steps {
16
16
  suggestedSteps: number;
17
17
  }
18
18
  export declare function createEmptyReport(body: any): Promise<string>;
19
- export declare function uploadScenario(stepLog: Step[], scenarioName: string, screenshot?: Buffer, errMessage?: object): Promise<{
20
- scenarioRef: any;
19
+ export declare function uploadStep(stepLog: Step[], scenarioName: string, screenshot?: Buffer, errMessage?: object): Promise<{
20
+ stepRef: any;
21
21
  name: any;
22
22
  status: any;
23
23
  stepsCount: any;
24
24
  }[]>;
25
- export declare function uploadFeature(scenarioId: any[], scenarioName: string, uri: string, hasFailed: boolean): Promise<any>;
26
- export declare function updateReport(reportId: string, feature: Feature, steps: Steps, isFinal: boolean): Promise<void>;
25
+ export declare function uploadFeature(stepRes: any[], scenarioName: string, uri: string, hasFailed: boolean): Promise<any>;
26
+ export declare function updateReport(reportId: string, scenario: Scenarios, steps: Steps, isFinal: boolean): Promise<void>;
27
27
  export declare function getReport(reportId: string): Promise<any>;
28
28
  export declare function getLastDayResults(): Promise<any>;
29
29
  export declare function postNotifications(body: UploadModel): Promise<void>;
@@ -44,14 +44,14 @@ export function createEmptyReport(body) {
44
44
  }, headers(token))).data.reportId;
45
45
  });
46
46
  }
47
- export function uploadScenario(stepLog, scenarioName, screenshot, errMessage) {
47
+ export function uploadStep(stepLog, scenarioName, screenshot, errMessage) {
48
48
  return __awaiter(this, void 0, void 0, function* () {
49
49
  let scenarios = [];
50
50
  let token = yield auth();
51
51
  let lastStep = stepLog[stepLog.length - 1];
52
52
  const stepLogFormat = JSON.parse(JSON.stringify(stepLog));
53
53
  stepLogFormat.pop();
54
- let output = (yield axios.post(config.auxtaURL + "create-scenario", {
54
+ let output = (yield axios.post(config.auxtaURL + "create-steps", {
55
55
  json: {
56
56
  name: scenarioName,
57
57
  steps: [
@@ -76,7 +76,7 @@ export function uploadScenario(stepLog, scenarioName, screenshot, errMessage) {
76
76
  }
77
77
  }, headers(token))).data.scenarios;
78
78
  scenarios.push({
79
- scenarioRef: output.scenarioRef,
79
+ stepRef: output.stepRef,
80
80
  name: output.name,
81
81
  status: output.status,
82
82
  stepsCount: output.stepsCount
@@ -84,7 +84,7 @@ export function uploadScenario(stepLog, scenarioName, screenshot, errMessage) {
84
84
  return scenarios;
85
85
  });
86
86
  }
87
- export function uploadFeature(scenarioId, scenarioName, uri, hasFailed) {
87
+ export function uploadFeature(stepRes, scenarioName, uri, hasFailed) {
88
88
  return __awaiter(this, void 0, void 0, function* () {
89
89
  let token = yield auth();
90
90
  return (yield axios.post(config.auxtaURL + "create-feature", {
@@ -92,24 +92,24 @@ export function uploadFeature(scenarioId, scenarioName, uri, hasFailed) {
92
92
  name: scenarioName,
93
93
  uri: uri
94
94
  },
95
- scenarios: scenarioId,
95
+ scenarios: stepRes,
96
96
  hasFailed: hasFailed
97
97
  }, headers(token))).data;
98
98
  });
99
99
  }
100
- export function updateReport(reportId, feature, steps, isFinal) {
100
+ export function updateReport(reportId, scenario, steps, isFinal) {
101
101
  return __awaiter(this, void 0, void 0, function* () {
102
102
  let token = yield auth();
103
103
  yield axios.post(config.auxtaURL + "update-inprogress-report", {
104
104
  reportId: reportId,
105
105
  isFinal: isFinal,
106
- data: Object.assign({ feature: {
107
- featureRef: feature.featureId,
108
- name: feature.featureName,
109
- uri: feature.featureUri,
110
- status: feature.status,
111
- scenariosCount: feature.scenariosCount,
112
- lastFiveStepsHash: feature.lastFiveStepsHash
106
+ data: Object.assign({ scenario: {
107
+ stepRef: scenario.scenarioId,
108
+ name: scenario.scenarioName,
109
+ uri: scenario.scenarioUri,
110
+ status: scenario.status,
111
+ scenariosCount: scenario.scenariosCount,
112
+ lastFiveStepsHash: scenario.lastFiveStepsHash
113
113
  } }, steps)
114
114
  }, headers(token));
115
115
  });