Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add a GH Actions summary #173

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,21 @@ jobs:
run: npm run env:start
- name: Test
run: npm run cypress:run
- name: Update summary
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