playwright-slack-report-burak 1.3.6 → 1.3.7

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.
@@ -144,30 +144,29 @@ const generateAllRunSuites = async (summaryResults) => {
144
144
  allSuitesTitle[0] = '*Suites Run:*\n';
145
145
  }
146
146
 
147
- // Push data into array to create the "List of Problematic Test Suites"
148
- if (summaryResults.tests.length !== summaryResults.passed){
149
- suitesResults.push({
150
- type: 'section',
151
- text: {
152
- type: 'mrkdwn',
153
- text:
154
- `${allSuitesTitle}${[...new Set(allSuites)].map((value, index) => `*${index + 1}.* ${value}`).join('\n')}`
155
- },
147
+ // Push data into array to create the "List of All Run Test Suites"
148
+ suitesResults.push({
149
+ type: 'section',
150
+ text: {
151
+ type: 'mrkdwn',
152
+ text:
153
+ `${allSuitesTitle}${[...new Set(allSuites)].map((value, index) => `*${index + 1}.* ${value}`).join('\n')}`
156
154
  },
157
- {
158
- type: 'section',
159
- text: {
160
- type: 'mrkdwn',
161
- text: ` `,
162
- },
163
- },
164
- {
165
- type: 'divider',
155
+ },
156
+ {
157
+ type: 'section',
158
+ text: {
159
+ type: 'mrkdwn',
160
+ text: ` `,
166
161
  },
167
- )}
168
- return [
169
- ...suitesResults,
170
- ];
162
+ },
163
+ {
164
+ type: 'divider',
165
+ },
166
+ )
167
+ return [
168
+ ...suitesResults,
169
+ ];
171
170
  };
172
171
 
173
172
  const generateProblemSuiteList = async (summaryResults) => {
@@ -111,8 +111,8 @@ 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.flaky > 0)) {
115
- /* for (let i = 0; i < result.length; i += 1) {
114
+ if (this.showInThread) {
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({
118
118
  channelIds: [result[i].channel],
@@ -120,7 +120,7 @@ class SlackReporter {
120
120
  summaryResults: resultSummary,
121
121
  maxNumberOfFailures: this.maxNumberOfFailuresToShow,
122
122
  });
123
- }*/
123
+ }*/
124
124
  for (let i = 0; i < result.length; i += 1) {
125
125
  // eslint-disable-next-line no-await-in-loop
126
126
  await slackClient.attachDetailsToThreadRuns({
@@ -131,35 +131,37 @@ class SlackReporter {
131
131
  });
132
132
  }
133
133
 
134
- for (let i = 0; i < result.length; i += 1) {
135
- // eslint-disable-next-line no-await-in-loop
136
- await slackClient.attachDetailsToThreadSuites({
137
- channelIds: [result[i].channel],
138
- ts: result[i].ts,
139
- summaryResults: resultSummary,
140
- maxNumberOfFailures: this.maxNumberOfFailuresToShow,
141
- });
142
- }
134
+ if ((resultSummary.failures.length > 0 || resultSummary.skipped > 0 || resultSummary.flaky > 0)) {
135
+ for (let i = 0; i < result.length; i += 1) {
136
+ // eslint-disable-next-line no-await-in-loop
137
+ await slackClient.attachDetailsToThreadSuites({
138
+ channelIds: [result[i].channel],
139
+ ts: result[i].ts,
140
+ summaryResults: resultSummary,
141
+ maxNumberOfFailures: this.maxNumberOfFailuresToShow,
142
+ });
143
+ }
143
144
 
144
- for (let i = 0; i < result.length; i += 1) {
145
- // eslint-disable-next-line no-await-in-loop
146
- await slackClient.attachDetailsToThreadCases({
147
- channelIds: [result[i].channel],
148
- ts: result[i].ts,
149
- summaryResults: resultSummary,
150
- maxNumberOfFailures: this.maxNumberOfFailuresToShow,
151
- });
152
- }
153
-
154
- for (let i = 0; i < result.length; i += 1) {
155
- // eslint-disable-next-line no-await-in-loop
156
- await slackClient.attachDetailsToThreadReasons({
157
- channelIds: [result[i].channel],
158
- ts: result[i].ts,
159
- summaryResults: resultSummary,
160
- maxNumberOfFailures: this.maxNumberOfFailuresToShow,
161
- });
162
- }
145
+ for (let i = 0; i < result.length; i += 1) {
146
+ // eslint-disable-next-line no-await-in-loop
147
+ await slackClient.attachDetailsToThreadCases({
148
+ channelIds: [result[i].channel],
149
+ ts: result[i].ts,
150
+ summaryResults: resultSummary,
151
+ maxNumberOfFailures: this.maxNumberOfFailuresToShow,
152
+ });
153
+ }
154
+
155
+ for (let i = 0; i < result.length; i += 1) {
156
+ // eslint-disable-next-line no-await-in-loop
157
+ await slackClient.attachDetailsToThreadReasons({
158
+ channelIds: [result[i].channel],
159
+ ts: result[i].ts,
160
+ summaryResults: resultSummary,
161
+ maxNumberOfFailures: this.maxNumberOfFailuresToShow,
162
+ });
163
+ }
164
+ }
163
165
  }
164
166
  }
165
167
  }
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.6",
33
+ "version": "1.3.7",
34
34
  "main": "index.js",
35
35
  "types": "dist/index.d.ts",
36
36
  "repository": "git@github.com:ryanrosello-og/playwright-slack-report.git",