@testomatio/reporter 1.1.0-beta.codeceptjs-before-suite-logs → 1.1.0-beta.label-assign
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/Changelog.md +8 -0
- package/lib/adapter/codecept.js +3 -31
- package/lib/pipe/testomatio.js +2 -0
- package/package.json +1 -1
package/Changelog.md
CHANGED
package/lib/adapter/codecept.js
CHANGED
|
@@ -78,35 +78,8 @@ function CodeceptReporter(config) {
|
|
|
78
78
|
global.testomatioDataStore.steps = [];
|
|
79
79
|
});
|
|
80
80
|
|
|
81
|
-
let hookSteps = [];
|
|
82
|
-
let suiteHookRunning = false;
|
|
83
|
-
|
|
84
|
-
event.dispatcher.on(event.suite.before, (suite) => {
|
|
85
|
-
suiteHookRunning = true;
|
|
86
|
-
hookSteps = [];
|
|
87
|
-
global.testomatioDataStore.steps = [];
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
event.dispatcher.on(event.test.before, () => {
|
|
91
|
-
suiteHookRunning = false;
|
|
92
|
-
global.testomatioDataStore.steps = []
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
event.dispatcher.on(event.hook.started, (suite) => {
|
|
96
|
-
// global.testomatioDataStore.steps = [];
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
event.dispatcher.on(event.hook.passed, (suite) => {
|
|
100
|
-
if (suiteHookRunning) hookSteps.push(...global.testomatioDataStore.steps);
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
event.dispatcher.on(event.hook.failed, (suite) => {
|
|
104
|
-
if (suiteHookRunning) hookSteps.push(...global.testomatioDataStore.steps);
|
|
105
|
-
});
|
|
106
|
-
|
|
107
81
|
event.dispatcher.on(event.test.started, test => {
|
|
108
82
|
testTimeMap[test.id] = Date.now();
|
|
109
|
-
|
|
110
83
|
if (global.testomatioDataStore) global.testomatioDataStore.currentlyRunningTestId = getIdFromTestTitle(test.title);
|
|
111
84
|
});
|
|
112
85
|
|
|
@@ -116,7 +89,7 @@ function CodeceptReporter(config) {
|
|
|
116
89
|
await Promise.all(reportTestPromises);
|
|
117
90
|
|
|
118
91
|
if (upload.isArtifactsEnabled()) {
|
|
119
|
-
uploadAttachments(client, videos, '🎞️
|
|
92
|
+
uploadAttachments(client, videos, '🎞️ Uploading', 'video');
|
|
120
93
|
uploadAttachments(client, traces, '📁 Uploading', 'trace');
|
|
121
94
|
}
|
|
122
95
|
|
|
@@ -136,7 +109,7 @@ function CodeceptReporter(config) {
|
|
|
136
109
|
suite_title: test.parent && test.parent.title,
|
|
137
110
|
message: testObj.message,
|
|
138
111
|
time: getDuration(test),
|
|
139
|
-
steps:
|
|
112
|
+
steps: global.testomatioDataStore.steps.join('\n') || null,
|
|
140
113
|
test_id: testId,
|
|
141
114
|
});
|
|
142
115
|
// output.stop();
|
|
@@ -160,7 +133,6 @@ function CodeceptReporter(config) {
|
|
|
160
133
|
...stripExampleFromTitle(title),
|
|
161
134
|
suite_title: suite.title,
|
|
162
135
|
test_id: testId,
|
|
163
|
-
steps: hookSteps.join('\n') || null,
|
|
164
136
|
error,
|
|
165
137
|
time: 0,
|
|
166
138
|
});
|
|
@@ -189,7 +161,7 @@ function CodeceptReporter(config) {
|
|
|
189
161
|
message: testObj.message,
|
|
190
162
|
time: getDuration(test),
|
|
191
163
|
files,
|
|
192
|
-
steps:
|
|
164
|
+
steps: global.testomatioDataStore?.steps?.join('\n') || null,
|
|
193
165
|
})
|
|
194
166
|
.then(pipes => {
|
|
195
167
|
testId = pipes.filter(p => p.pipe.includes('Testomatio'))[0]?.result?.data?.test_id;
|
package/lib/pipe/testomatio.js
CHANGED
|
@@ -32,6 +32,7 @@ class TestomatioPipe {
|
|
|
32
32
|
this.sharedRun = !!process.env.TESTOMATIO_SHARED_RUN;
|
|
33
33
|
this.groupTitle = params.groupTitle || process.env.TESTOMATIO_RUNGROUP_TITLE;
|
|
34
34
|
this.env = process.env.TESTOMATIO_ENV;
|
|
35
|
+
this.label = process.env.TESTOMATIO_LABEL;
|
|
35
36
|
|
|
36
37
|
this.axios = axios.create({
|
|
37
38
|
baseURL: `${this.url.trim()}`,
|
|
@@ -130,6 +131,7 @@ class TestomatioPipe {
|
|
|
130
131
|
jira_id: this.jiraId,
|
|
131
132
|
env: this.env,
|
|
132
133
|
title: this.title,
|
|
134
|
+
label: this.label,
|
|
133
135
|
shared_run: this.sharedRun,
|
|
134
136
|
}).filter(([, value]) => !!value),
|
|
135
137
|
);
|
package/package.json
CHANGED