Improve performance of Cypress tests & save screenshots of failed tests #92
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: End to end tests | |
on: | |
push: | |
branches: | |
- main | |
- development | |
pull_request: | |
branches: | |
- main | |
- development | |
jobs: | |
tests: | |
runs-on: self-hosted | |
strategy: | |
# don't fail the entire matrix on failure | |
fail-fast: false | |
matrix: | |
test-platform: [firefox] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: ./.github/prepare-action | |
with: | |
openai-api-key: ${{ secrets.OPENAI_API_KEY }} | |
app-debug: false | |
wp-username: ${{ secrets.WP_USERNAME }} | |
wp-password: ${{ secrets.WP_PASSWORD }} | |
node-version: 16.x | |
- name: Cypress run | |
uses: cypress-io/github-action@v6 | |
with: | |
start: npm run web | |
browser: ${{ matrix.test-platform }} | |
- name: Upload screenshots of failed tests | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: cypress-screenshots | |
path: cypress/screenshots | |
retention-days: 1 | |
- uses: ./.github/pr-comment-action | |
if: failure() | |
with: | |
github-token: ${{ github.token }} | |
workflow-run-event-object: ${{ toJSON(github.event.workflow_run) }} | |
owner: ${{ github.repository_owner }} | |
repository: ${{ github.event.repository.name }} | |
- uses: ./.github/cleanup-action | |
if: always() |