playwright-slack-report-burak 1.3.1 → 1.3.3
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/dist/src/LayoutGenerator.js +24 -12
- package/dist/src/SlackReporter.js +1 -1
- package/package.json +1 -1
|
@@ -128,11 +128,15 @@ const generateProblemCaseList = async (summaryResults) => {
|
|
|
128
128
|
for (let i = 0; i < summaryResults.failures.length; i += 1) {
|
|
129
129
|
const { suiteName } = summaryResults.failures[i];
|
|
130
130
|
const capitalizedSuiteName = suiteName.charAt(0).toUpperCase() + suiteName.slice(1);
|
|
131
|
-
const parts = capitalizedSuiteName.split('/')
|
|
131
|
+
const parts = capitalizedSuiteName.split('/').slice(0, 2).join('/');
|
|
132
132
|
const backSlashedParts = parts.split('\\')[0];
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
const [category, feature] = backSlashedParts.split('/');
|
|
134
|
+
const formattedSuiteName = feature
|
|
135
|
+
? `${feature.split('-').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ')} (${category})`
|
|
136
|
+
: backSlashedParts;
|
|
137
|
+
if (formattedSuiteName !== previousSuiteName) {
|
|
138
|
+
failedSuites.push(formattedSuiteName);
|
|
139
|
+
previousSuiteName = formattedSuiteName;
|
|
136
140
|
}
|
|
137
141
|
}
|
|
138
142
|
previousSuiteName = undefined;
|
|
@@ -142,11 +146,15 @@ const generateProblemCaseList = async (summaryResults) => {
|
|
|
142
146
|
if (result.retry > 0 && result.status === 'passed') {
|
|
143
147
|
const suiteName = result.suiteName;
|
|
144
148
|
const capitalizedSuiteName = suiteName.charAt(0).toUpperCase() + suiteName.slice(1);
|
|
145
|
-
const parts = capitalizedSuiteName.split('/')
|
|
149
|
+
const parts = capitalizedSuiteName.split('/').slice(0, 2).join('/');
|
|
146
150
|
const backSlashedParts = parts.split('\\')[0];
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
151
|
+
const [category, feature] = backSlashedParts.split('/');
|
|
152
|
+
const formattedSuiteName = feature
|
|
153
|
+
? `${feature.split('-').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ')} (${category})`
|
|
154
|
+
: backSlashedParts;
|
|
155
|
+
if (formattedSuiteName !== previousSuiteName) {
|
|
156
|
+
flakySuites.push(formattedSuiteName);
|
|
157
|
+
previousSuiteName = formattedSuiteName;
|
|
150
158
|
}
|
|
151
159
|
}
|
|
152
160
|
}
|
|
@@ -158,11 +166,15 @@ const generateProblemCaseList = async (summaryResults) => {
|
|
|
158
166
|
if (result.status === 'skipped') {
|
|
159
167
|
const suiteName = result.suiteName;
|
|
160
168
|
const capitalizedSuiteName = suiteName.charAt(0).toUpperCase() + suiteName.slice(1);
|
|
161
|
-
const parts = capitalizedSuiteName.split('/')
|
|
169
|
+
const parts = capitalizedSuiteName.split('/').slice(0, 2).join('/');
|
|
162
170
|
const backSlashedParts = parts.split('\\')[0];
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
171
|
+
const [category, feature] = backSlashedParts.split('/');
|
|
172
|
+
const formattedSuiteName = feature
|
|
173
|
+
? `${feature.split('-').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ')} (${category})`
|
|
174
|
+
: backSlashedParts;
|
|
175
|
+
if (formattedSuiteName !== previousSuiteName) {
|
|
176
|
+
skippedSuites.push(formattedSuiteName);
|
|
177
|
+
previousSuiteName = formattedSuiteName;
|
|
166
178
|
}
|
|
167
179
|
}
|
|
168
180
|
}
|
|
@@ -111,7 +111,7 @@ class SlackReporter {
|
|
|
111
111
|
});
|
|
112
112
|
// eslint-disable-next-line no-console
|
|
113
113
|
console.log(JSON.stringify(result, null, 2));
|
|
114
|
-
if (this.showInThread && (resultSummary.failures.length > 0 || resultSummary.skipped > 0 || resultSummary.
|
|
114
|
+
if (this.showInThread && (resultSummary.failures.length > 0 || resultSummary.skipped > 0 || resultSummary.flaky > 0)) {
|
|
115
115
|
/* for (let i = 0; i < result.length; i += 1) {
|
|
116
116
|
// eslint-disable-next-line no-await-in-loop
|
|
117
117
|
await slackClient.attachDetailsToThread({
|
package/package.json
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"lint-fix": "npx eslint . --ext .ts --fix"
|
|
31
31
|
},
|
|
32
32
|
"name": "playwright-slack-report-burak",
|
|
33
|
-
"version": "1.3.
|
|
33
|
+
"version": "1.3.3",
|
|
34
34
|
"main": "index.js",
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"repository": "git@github.com:ryanrosello-og/playwright-slack-report.git",
|