playwright-slack-report
Advanced tools
Comparing version 1.1.55 to 1.1.56
@@ -41,3 +41,3 @@ "use strict"; | ||
const parsedData = JSON.parse(data); | ||
const { retries } = parsedData.config.projects[0]; | ||
const retries = parsedData.config.projects[0]?.retries || 0; | ||
await this.parseTestSuite(parsedData.suites, retries); | ||
@@ -44,0 +44,0 @@ const failures = await this.getFailures(); |
@@ -38,3 +38,3 @@ { | ||
"name": "playwright-slack-report", | ||
"version": "1.1.55", | ||
"version": "1.1.56", | ||
"bin": { | ||
@@ -41,0 +41,0 @@ "playwright-slack-report": "dist/cli.js" |
@@ -187,5 +187,5 @@ # playwright-slack-report ![Builds](https://github.com/ryanrosello-og/playwright-slack-report/actions/workflows/playwright.yml/badge.svg) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ryanrosello-og/playwright-slack-report/blob/master/LICENSE) [![Coverage Status](https://coveralls.io/repos/github/ryanrosello-og/playwright-slack-report/badge.svg?branch=main)](https://coveralls.io/github/ryanrosello-og/playwright-slack-report?branch=main) | ||
`SLACK_BOT_USER_OAUTH_TOKEN=[your Slack bot user OAUTH token] npx playwright-slack-report -c cli_config.json -j ./merged_tests_results.json` | ||
`SLACK_BOT_USER_OAUTH_TOKEN=[your Slack bot user OAUTH token] npx playwright-slack-report -c cli_config.json -j > merged_tests_results.json` | ||
Both the `-c` and `-j` options are required. The `-c` option is the path to your config file and the `-j` option is the path to your merged JSON report. | ||
Both the `-c` and `-j` options are required. The `-c` option is the path to your config file and the `-j` option is the path to your merged JSON report. You will also need to pipe the output to a json file, using the `>` operator. | ||
@@ -208,2 +208,41 @@ ### Additional notes | ||
### Sample Github Actions workflow | ||
```yaml | ||
... | ||
merge-reports: | ||
# Merge reports after playwright-tests, even if some shards have failed | ||
if: always() | ||
needs: [playwright-tests] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Download blob reports from GitHub Actions Artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: all-blob-reports | ||
path: all-blob-reports | ||
- name: Merge into JSON Report | ||
run: npx playwright merge-reports --reporter json ./all-blob-reports > merged_tests_results.json | ||
- name: View merged results | ||
run: cat ${GITHUB_WORKSPACE}/merged_tests_results.json | ||
- name: Send report to Slack using CLI | ||
env: | ||
SLACK_BOT_USER_OAUTH_TOKEN: ${{ secrets.SLACK_BOT_USER_OAUTH_TOKEN }} | ||
run: npx playwright-slack-report --config="${GITHUB_WORKSPACE}/cli_config.json" --json-results="${GITHUB_WORKSPACE}/merged_tests_results.json" | ||
... | ||
``` | ||
```json | ||
@@ -210,0 +249,0 @@ { |
Sorry, the diff of this file is not supported yet
100331
752