playwright-slack-report 1.0.6 → 1.0.10

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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  Publish your Playwright test results to your favorite Slack channel(s).
6
6
 
7
- ![Gif](https://github.com/ryanrosello-og/playwright-slack-report/blob/main/assets/2022-08-13_8-35-26.gif?raw=true)
7
+ ![Gif](https://github.com/ryanrosello-og/playwright-slack-report/blob/main/assets/2022-08-15_20-22-59.png?raw=true)
8
8
 
9
9
  ## 🚀 Features
10
10
 
@@ -5,13 +5,18 @@ const generateBlocks = async (summaryResults) => {
5
5
  const maxNumberOfFailureLength = 650;
6
6
  const fails = [];
7
7
  const meta = [];
8
+ const header = {
9
+ type: 'section',
10
+ text: {
11
+ type: 'mrkdwn',
12
+ text: '🎭 *Playwright Results*',
13
+ },
14
+ };
8
15
  const summary = {
9
16
  type: 'section',
10
17
  text: {
11
18
  type: 'mrkdwn',
12
- text: `:white_check_mark: *${summaryResults.passed}* Tests ran successfully \n\n :red_circle: *${summaryResults.failed}* Tests failed \n\n ${summaryResults.skipped > 0
13
- ? `:fast_forward: *${summaryResults.skipped}* skipped`
14
- : ''} \n\n `,
19
+ text: `✅ *${summaryResults.passed}* | *${summaryResults.failed}* | *${summaryResults.skipped}*`,
15
20
  },
16
21
  };
17
22
  for (let i = 0; i < summaryResults.failures.length; i += 1) {
@@ -53,6 +58,7 @@ const generateBlocks = async (summaryResults) => {
53
58
  }
54
59
  }
55
60
  return [
61
+ header,
56
62
  summary,
57
63
  ...meta,
58
64
  {
@@ -35,8 +35,9 @@ class SlackReporter {
35
35
  }
36
36
  const resultSummary = await this.resultsParser.getParsedResults();
37
37
  resultSummary.meta = this.meta;
38
+ const maxRetry = Math.max(...resultSummary.tests.map((o) => o.retry));
38
39
  if (this.sendResults === 'on-failure'
39
- && resultSummary.failures.length === 0) {
40
+ && resultSummary.tests.filter((z) => z.status === 'failed' && z.retry === maxRetry).length === 0) {
40
41
  this.log('⏩ Slack reporter - no failures found');
41
42
  return;
42
43
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "dependencies": {
3
+ "@slack/web-api": "^6.7.2"
4
+ },
5
+ "devDependencies": {
3
6
  "@playwright/test": "^1.23.3",
4
- "@slack/web-api": "^6.7.2",
5
7
  "dotenv": "^16.0.1",
6
8
  "playwright": "^1.23.3",
7
9
  "typescript": "^4.7.4",
8
- "@slack/types": "^2.7.0"
9
- },
10
- "devDependencies": {
10
+ "@slack/types": "^2.7.0",
11
11
  "@typescript-eslint/eslint-plugin": "^5.30.6",
12
12
  "@typescript-eslint/parser": "^5.30.6",
13
13
  "eslint": "^7.32.0 || ^8.2.0",
@@ -28,7 +28,7 @@
28
28
  "lint":"npx eslint . --ext .ts"
29
29
  },
30
30
  "name": "playwright-slack-report",
31
- "version": "1.0.6",
31
+ "version": "1.0.10",
32
32
  "main": "index.js",
33
33
  "types": "dist/index.d.ts",
34
34
  "repository": "git@github.com:ryanrosello-og/playwright-slack-report.git",