Skip to content

Commit

Permalink
Merge pull request #4 from valscion/cypress-firefox
Browse files Browse the repository at this point in the history
Run tests also with Firefox
  • Loading branch information
valscion authored Jan 24, 2023
2 parents bc572f5 + 0e29f7e commit 53eddc4
Showing 1 changed file with 43 additions and 4 deletions.
47 changes: 43 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Cypress Tests
on: [push]

jobs:
cypress-run:
cypress-chrome:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -27,17 +27,56 @@ jobs:
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
name: chrome-cypress-screenshots
path: cypress/screenshots
# Test run video was always captured, so this action uses "always()" condition
- uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-videos
name: chrome-cypress-videos
path: cypress/videos
# A Rails server log is always generated so we use "always()"
- uses: actions/upload-artifact@v3
if: always()
with:
name: rails-test-log
name: chrome-rails-test-log
path: log/test.log
cypress-firefox:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install ruby dependencies
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
# Install NPM dependencies, cache them correctly
# and run all Cypress tests
- name: Cypress run
uses: cypress-io/github-action@v5
with:
browser: firefox
start: npm run cypress:rails
# after the test run completes
# store videos and any screenshots
# NOTE: screenshots will be generated only if E2E test failed
# thus we store screenshots only on failures
# Alternative: create and commit an empty cypress/screenshots folder
# to always have something to upload
- uses: actions/upload-artifact@v3
if: failure()
with:
name: firefox-cypress-screenshots
path: cypress/screenshots
# Test run video was always captured, so this action uses "always()" condition
- uses: actions/upload-artifact@v3
if: always()
with:
name: firefox-cypress-videos
path: cypress/videos
# A Rails server log is always generated so we use "always()"
- uses: actions/upload-artifact@v3
if: always()
with:
name: firefox-rails-test-log
path: log/test.log

0 comments on commit 53eddc4

Please sign in to comment.