@auxcode/auxta 1.3.105 → 1.3.107-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.
- package/build/auxta/enums/status-of.step.d.ts +2 -1
- package/build/auxta/enums/status-of.step.js +1 -0
- package/build/auxta/hooks/report.hook.js +2 -1
- package/build/auxta/services/log.service.d.ts +4 -0
- package/build/auxta/services/log.service.js +4 -2
- package/build/auxta/services/report.service.d.ts +1 -0
- package/build/auxta/services/report.service.js +5 -2
- package/build/macros/helpers/code.helper.js +3 -1
- package/build/macros/helpers/extend-default-page.js +22 -7
- package/package.json +1 -1
|
@@ -8,5 +8,6 @@ var StatusOfStep;
|
|
|
8
8
|
StatusOfStep["SKIPPED"] = "skipped";
|
|
9
9
|
StatusOfStep["SUGGESTION"] = "suggestion";
|
|
10
10
|
StatusOfStep["PERFORMANCE_FAIL"] = "performanceFailure";
|
|
11
|
+
StatusOfStep["LOG"] = "log";
|
|
11
12
|
})(StatusOfStep || (exports.StatusOfStep = StatusOfStep = {}));
|
|
12
13
|
exports.default = StatusOfStep;
|
|
@@ -40,7 +40,8 @@ function onTestEnd(body, featureName, scenarioName, statusCode, screenshotBuffer
|
|
|
40
40
|
passedSteps: log_service_1.default.getStatusCount(status_of_step_1.StatusOfStep.PASSED),
|
|
41
41
|
skippedSteps: log_service_1.default.getStatusCount(status_of_step_1.StatusOfStep.SKIPPED),
|
|
42
42
|
suggestedSteps: log_service_1.default.getStatusCount(status_of_step_1.StatusOfStep.SUGGESTION),
|
|
43
|
-
performanceFailure: log_service_1.default.getStatusCount(status_of_step_1.StatusOfStep.PERFORMANCE_FAIL)
|
|
43
|
+
performanceFailure: log_service_1.default.getStatusCount(status_of_step_1.StatusOfStep.PERFORMANCE_FAIL),
|
|
44
|
+
log: log_service_1.default.getStatusCount(status_of_step_1.StatusOfStep.LOG)
|
|
44
45
|
};
|
|
45
46
|
isFinal = (!(body.nextSuites && body.nextSuites.length > 0));
|
|
46
47
|
yield (0, report_service_1.updateReport)(body.reportId, scenario, stepCounts, isFinal);
|
|
@@ -3,6 +3,9 @@ export interface Step {
|
|
|
3
3
|
keyword: string;
|
|
4
4
|
tag: string;
|
|
5
5
|
name: string;
|
|
6
|
+
isChecked?: boolean;
|
|
7
|
+
timeStamp?: Date;
|
|
8
|
+
userId?: string;
|
|
6
9
|
imageCompareKey: string;
|
|
7
10
|
result: {
|
|
8
11
|
status: StatusOfStep;
|
|
@@ -20,6 +23,7 @@ export declare class LogSteps {
|
|
|
20
23
|
skipped: number;
|
|
21
24
|
suggestion: number;
|
|
22
25
|
performanceFailure: number;
|
|
26
|
+
log: number;
|
|
23
27
|
};
|
|
24
28
|
private stepLog;
|
|
25
29
|
private lastStepTime;
|
|
@@ -9,7 +9,8 @@ class LogSteps {
|
|
|
9
9
|
[status_of_step_1.StatusOfStep.FAILED]: 0,
|
|
10
10
|
[status_of_step_1.StatusOfStep.SKIPPED]: 0,
|
|
11
11
|
[status_of_step_1.StatusOfStep.SUGGESTION]: 0,
|
|
12
|
-
[status_of_step_1.StatusOfStep.PERFORMANCE_FAIL]: 0
|
|
12
|
+
[status_of_step_1.StatusOfStep.PERFORMANCE_FAIL]: 0,
|
|
13
|
+
[status_of_step_1.StatusOfStep.LOG]: 0
|
|
13
14
|
};
|
|
14
15
|
this.stepLog = [];
|
|
15
16
|
this.lastStepTime = new Date().getTime();
|
|
@@ -55,7 +56,8 @@ class LogSteps {
|
|
|
55
56
|
[status_of_step_1.StatusOfStep.FAILED]: 0,
|
|
56
57
|
[status_of_step_1.StatusOfStep.SKIPPED]: 0,
|
|
57
58
|
[status_of_step_1.StatusOfStep.SUGGESTION]: 0,
|
|
58
|
-
[status_of_step_1.StatusOfStep.PERFORMANCE_FAIL]: 0
|
|
59
|
+
[status_of_step_1.StatusOfStep.PERFORMANCE_FAIL]: 0,
|
|
60
|
+
[status_of_step_1.StatusOfStep.LOG]: 0
|
|
59
61
|
};
|
|
60
62
|
}
|
|
61
63
|
push(keyword, tag, name, status, screenshot = new ArrayBuffer(0), imageCompareKey = '') {
|
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.getVerifyReceivedEmail = exports.postNotificationsOnFail = exports.postNotifications = exports.compareScreenshots = exports.getLastDayResults = exports.getReport = exports.updateReport = exports.uploadScenario = exports.uploadStep = exports.createEmptyReport = exports.setEmailProvider = exports.setTimeZone = void 0;
|
|
16
16
|
const axios_1 = __importDefault(require("axios"));
|
|
17
17
|
const config_1 = require("../configs/config");
|
|
18
|
+
const isManualChecklist = process.argv.includes('--create-manual-checklist');
|
|
18
19
|
function headers(token) {
|
|
19
20
|
return {
|
|
20
21
|
headers: {
|
|
@@ -82,7 +83,8 @@ function createEmptyReport(body) {
|
|
|
82
83
|
bucket: body.bucket,
|
|
83
84
|
start: moment().tz(config_1.config.timezone),
|
|
84
85
|
emailProvider: config_1.config.emailProvider,
|
|
85
|
-
url: body.baseUrl
|
|
86
|
+
url: body.baseUrl,
|
|
87
|
+
isManualChecklist
|
|
86
88
|
}, headers(token))).data.reportId;
|
|
87
89
|
});
|
|
88
90
|
}
|
|
@@ -137,7 +139,8 @@ function uploadScenario(stepRes, scenarioName, uri, hasFailed) {
|
|
|
137
139
|
uri: uri
|
|
138
140
|
},
|
|
139
141
|
scenarios: stepRes,
|
|
140
|
-
hasFailed: hasFailed
|
|
142
|
+
hasFailed: hasFailed,
|
|
143
|
+
isManualChecklist
|
|
141
144
|
}, headers(token))).data;
|
|
142
145
|
});
|
|
143
146
|
}
|
|
@@ -26,7 +26,9 @@ class FunctionHelper extends extend_default_page_1.ExtendDefaultPage {
|
|
|
26
26
|
log_service_1.default.push(keyword, log_service_1.default.tag, name, status, screenshot);
|
|
27
27
|
}
|
|
28
28
|
setTag(tag) {
|
|
29
|
-
log_service_1.default.tag
|
|
29
|
+
if (!log_service_1.default.tag || log_service_1.default.tag === 'default') {
|
|
30
|
+
log_service_1.default.tag = tag;
|
|
31
|
+
}
|
|
30
32
|
}
|
|
31
33
|
clearTag() {
|
|
32
34
|
log_service_1.default.tag = '';
|
|
@@ -16,6 +16,7 @@ exports.ExtendDefaultPage = void 0;
|
|
|
16
16
|
const log_service_1 = __importDefault(require("../../auxta/services/log.service"));
|
|
17
17
|
const status_of_step_1 = require("../../auxta/enums/status-of.step");
|
|
18
18
|
const config_1 = require("../../auxta/configs/config");
|
|
19
|
+
const isManualChecklist = process.argv.includes('--create-manual-checklist');
|
|
19
20
|
class ExtendDefaultPage {
|
|
20
21
|
constructor() {
|
|
21
22
|
this.defaultTimeout = config_1.config.timeout;
|
|
@@ -26,7 +27,9 @@ class ExtendDefaultPage {
|
|
|
26
27
|
const { goto: original_goto, click: original_click, type: original_type, waitForNetworkIdle: original_waitForNetworkIdle } = page;
|
|
27
28
|
page.goto = function goto(url, options) {
|
|
28
29
|
log_service_1.default.push('Then', log_service_1.default.tag, `I go to the '${url}' page`, status_of_step_1.StatusOfStep.PASSED);
|
|
29
|
-
|
|
30
|
+
if (!isManualChecklist) {
|
|
31
|
+
return original_goto.apply(page, arguments);
|
|
32
|
+
}
|
|
30
33
|
};
|
|
31
34
|
page.click = function click(selector, options) {
|
|
32
35
|
return __awaiter(this, arguments, void 0, function* () {
|
|
@@ -37,13 +40,17 @@ class ExtendDefaultPage {
|
|
|
37
40
|
let elementName = yield page.$eval(selector, (e) => e.textContent);
|
|
38
41
|
if (!elementName || elementName === ' ')
|
|
39
42
|
elementName = selector;
|
|
40
|
-
|
|
43
|
+
if (!isManualChecklist) {
|
|
44
|
+
yield original_click.apply(page, arguments);
|
|
45
|
+
}
|
|
41
46
|
log_service_1.default.push('Then', log_service_1.default.tag, `I click on the '${elementName}'`, status_of_step_1.StatusOfStep.PASSED);
|
|
42
47
|
}
|
|
43
48
|
catch (e) {
|
|
44
49
|
const msg = `I click on the '${selector}'`;
|
|
45
50
|
log_service_1.default.push('Then', log_service_1.default.tag, msg, status_of_step_1.StatusOfStep.FAILED);
|
|
46
|
-
|
|
51
|
+
if (!isManualChecklist) {
|
|
52
|
+
throw new Error(msg);
|
|
53
|
+
}
|
|
47
54
|
}
|
|
48
55
|
});
|
|
49
56
|
};
|
|
@@ -52,12 +59,16 @@ class ExtendDefaultPage {
|
|
|
52
59
|
let message = 'I wait for the page to load';
|
|
53
60
|
let result;
|
|
54
61
|
try {
|
|
55
|
-
|
|
62
|
+
if (!isManualChecklist) {
|
|
63
|
+
result = yield original_waitForNetworkIdle.apply(page, arguments);
|
|
64
|
+
}
|
|
56
65
|
log_service_1.default.push('Then', log_service_1.default.tag, message, status_of_step_1.StatusOfStep.PASSED);
|
|
57
66
|
}
|
|
58
67
|
catch (e) {
|
|
59
68
|
log_service_1.default.push('Then', log_service_1.default.tag, message, status_of_step_1.StatusOfStep.FAILED);
|
|
60
|
-
|
|
69
|
+
if (!isManualChecklist) {
|
|
70
|
+
throw new Error(message);
|
|
71
|
+
}
|
|
61
72
|
}
|
|
62
73
|
return result;
|
|
63
74
|
});
|
|
@@ -68,7 +79,9 @@ class ExtendDefaultPage {
|
|
|
68
79
|
yield page.waitForSelector(field, {
|
|
69
80
|
timeout: time
|
|
70
81
|
});
|
|
71
|
-
|
|
82
|
+
if (!isManualChecklist) {
|
|
83
|
+
yield original_type.apply(page, arguments);
|
|
84
|
+
}
|
|
72
85
|
let elementName = yield page.$eval(field, (e) => e.textContent);
|
|
73
86
|
if (!elementName || elementName === ' ')
|
|
74
87
|
elementName = field;
|
|
@@ -77,7 +90,9 @@ class ExtendDefaultPage {
|
|
|
77
90
|
catch (e) {
|
|
78
91
|
const msg = `I type '${value}' into the '${field}' field`;
|
|
79
92
|
log_service_1.default.push('Then', log_service_1.default.tag, msg, status_of_step_1.StatusOfStep.FAILED);
|
|
80
|
-
|
|
93
|
+
if (!isManualChecklist) {
|
|
94
|
+
throw new Error(msg);
|
|
95
|
+
}
|
|
81
96
|
}
|
|
82
97
|
});
|
|
83
98
|
};
|