Skip to content

Commit

Permalink
Merge pull request #174 from 10up/gh-summary
Browse files Browse the repository at this point in the history
Added GH Actions summary
  • Loading branch information
faisal-alvi authored Dec 12, 2022
2 parents 5871992 + a234e62 commit c7b54df
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,22 @@ jobs:
run: npm run env:start
- name: Test
run: npm run cypress:run
- name: Update summary
if: ${{ always() }}
run: |
npx mochawesome-merge ./tests/cypress/reports/*.json -o tests/cypress/reports/mochawesome.json
rm -rf ./tests/cypress/reports/mochawesome-*.json
npx mochawesome-json-to-md -p ./tests/cypress/reports/mochawesome.json -o ./tests/cypress/reports/mochawesome.md
npx mochawesome-report-generator tests/cypress/reports/mochawesome.json -o tests/cypress/reports/
cat ./tests/cypress/reports/mochawesome.md >> $GITHUB_STEP_SUMMARY
- name: Make artifacts available
uses: actions/upload-artifact@v2
if: failure()
with:
name: cypress-artifact
retention-days: 2
path: |
${{ github.workspace }}/tests/cypress/screenshots/
${{ github.workspace }}/tests/cypress/videos/
${{ github.workspace }}/tests/cypress/logs/
${{ github.workspace }}/tests/cypress/reports/
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,8 @@ Session.vim
# Windows
Thumbs.db
Desktop.ini

# Cypress
tests/cypress/screenshots
tests/cypress/videos
tests/cypress/reports
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@wordpress/env": "^5.2.0",
"@wordpress/scripts": "^23.0.0",
"cypress": "^9.5.4",
"cypress-file-upload": "^5.0.8"
"cypress-file-upload": "^5.0.8",
"cypress-mochawesome-reporter": "^3.0.1"
}
}
8 changes: 8 additions & 0 deletions tests/cypress/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
"downloadsFolder": "tests/cypress/downloads",
"supportFile": "tests/cypress/support/index.js",
"video": false,
"reporter": "mochawesome",
"reporterOptions": {
"reportFilename": "mochawesome-[name]",
"reportDir": "tests/cypress/reports",
"overwrite": false,
"html": false,
"json": true
},
"testFiles": [
"set-avatar.test.js",
"choose-default-avatar.test.js",
Expand Down

0 comments on commit c7b54df

Please sign in to comment.