playwright-slack-report-burak 1.2.4 → 1.2.6
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 +28 -18
- package/package.json +1 -1
|
@@ -122,14 +122,24 @@ const generateFailuresReasons = async (summaryResults) => {
|
|
|
122
122
|
const { failureReason, test, suiteName } = summaryResults.failures[i];
|
|
123
123
|
const parts = suiteName.split('/')[suiteName.split('/').length-1].replace('.spec.ts', '');
|
|
124
124
|
const backSlashedParts = parts.split('\\')[parts.split('\\').length-1];
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
125
|
+
if (failureReason.length > 750) {
|
|
126
|
+
failsList.push({
|
|
127
|
+
type: 'section',
|
|
128
|
+
text: {
|
|
129
|
+
type: 'mrkdwn',
|
|
130
|
+
text: `${i+1}. ${test.split(' [')[0]} (${backSlashedParts})\n:exclamation:Failure reason is too long, only first 750 characters are shown:exclamation:\n\`\`\`${failureReason.substring(0, 750)}\`\`\``,
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
} else {
|
|
134
|
+
failsList.push({
|
|
135
|
+
type: 'section',
|
|
136
|
+
text: {
|
|
137
|
+
type: 'mrkdwn',
|
|
138
|
+
text: `${i+1}. ${test.split(' [')[0]} (${backSlashedParts})\n\`\`\`${failureReason}\`\`\``,
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
} else if (summaryResults.failures.length > 3 && summaryResults.failures.length < 25) {
|
|
133
143
|
const { failureReason, test, suiteName } = summaryResults.failures[i];
|
|
134
144
|
const parts = suiteName.split('/')[suiteName.split('/').length-1].replace('.spec.ts', '');
|
|
135
145
|
const backSlashedParts = parts.split('\\')[parts.split('\\').length-1];
|
|
@@ -140,8 +150,8 @@ const generateFailuresReasons = async (summaryResults) => {
|
|
|
140
150
|
text: `${i+1}. ${test.split(' [')[0]} (${backSlashedParts})\n\`\`\`${failureReason.split('\n')[0]}\`\`\``,
|
|
141
151
|
},
|
|
142
152
|
});
|
|
143
|
-
if (i === summaryResults.failures.length) {
|
|
144
|
-
|
|
153
|
+
if (i === summaryResults.failures.length-1) {
|
|
154
|
+
failsList.push({
|
|
145
155
|
type: 'section',
|
|
146
156
|
text: {
|
|
147
157
|
type: 'mrkdwn',
|
|
@@ -162,6 +172,7 @@ const generateFailuresReasons = async (summaryResults) => {
|
|
|
162
172
|
}
|
|
163
173
|
]
|
|
164
174
|
});
|
|
175
|
+
break;
|
|
165
176
|
}
|
|
166
177
|
} else if (summaryResults.failures.length >= 25) {
|
|
167
178
|
const { failureReason, test, suiteName } = summaryResults.failures[i];
|
|
@@ -174,8 +185,8 @@ const generateFailuresReasons = async (summaryResults) => {
|
|
|
174
185
|
text: `${i+1}. ${test.split(' [')[0]} (${backSlashedParts})\n\`\`\`${failureReason.split('\n')[0]}\`\`\``,
|
|
175
186
|
},
|
|
176
187
|
});
|
|
177
|
-
if (i >
|
|
178
|
-
|
|
188
|
+
if (i > 23) {
|
|
189
|
+
failsList.push({
|
|
179
190
|
type: 'section',
|
|
180
191
|
text: {
|
|
181
192
|
type: 'mrkdwn',
|
|
@@ -185,18 +196,17 @@ const generateFailuresReasons = async (summaryResults) => {
|
|
|
185
196
|
},
|
|
186
197
|
{
|
|
187
198
|
type: 'actions',
|
|
188
|
-
elements: [
|
|
189
|
-
{
|
|
199
|
+
elements: [{
|
|
190
200
|
type: 'button',
|
|
191
201
|
text: {
|
|
192
202
|
type: 'plain_text',
|
|
193
203
|
text: 'Go to Build Details'
|
|
194
204
|
},
|
|
195
205
|
url: process.env.CIRCLE_BUILD_URL
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
206
|
+
}]
|
|
207
|
+
});
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
200
210
|
}
|
|
201
211
|
}
|
|
202
212
|
|
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.2.
|
|
33
|
+
"version": "1.2.6",
|
|
34
34
|
"main": "index.js",
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"repository": "git@github.com:ryanrosello-og/playwright-slack-report.git",
|