Skip to content

Commit

Permalink
Switch to using Cypress docker image for running tests
Browse files Browse the repository at this point in the history
- This will ensure the browser versions remain static
- We will also use the Cypress action to run the tests for maximum caching and compatibility
  • Loading branch information
DrizzlyOwl committed Dec 16, 2024
1 parent d8d79de commit c8f18e0
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/cypress-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Cypress tests
name: Cypress Tests using Cypress Docker Image

on:
workflow_call:
Expand All @@ -21,14 +21,18 @@ on:
concurrency:
group: ${{ github.workflow }}

env:
NODE_VERSION: 18.x

jobs:
cypress-tests:
name: Run Cypress Tests
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
strategy:
matrix:
browser: [
"edge"
]
container:
image: cypress/browsers:22.12.0
defaults:
run:
working-directory: CypressTests/
Expand All @@ -37,21 +41,18 @@ jobs:
with:
ref: ${{ github.ref }}

- name: Setup node.js
uses: actions/setup-node@v4
- name: Run
uses: cypress-io/github-action@v6
env:
CYPRESS_apiKey: ${{ secrets.TRAMS_API_KEY }}
CYPRESS_url: ${{ secrets.TRAMS_API_BASE_URL }}
with:
node-version: ${{ env.NODE_VERSION }}

- name: Npm install
run: npm install

- name: Run Cypress (${{ inputs.environment }})
if: inputs.environment == 'test' || inputs.environment == 'development'
run: npm run cy:run -- --env apiKey="${{ secrets.TRAMS_API_KEY }}",url="${{ secrets.TRAMS_API_BASE_URL }}"
browser: ${{ matrix.browser }}
working-directory: CypressTests

- name: Upload screenshots
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: screenshots-${{ needs.set-env.outputs.environment }}
path: screenshots
name: screenshots-${{ inputs.environment }}-${{ matrix.browser }}
path: screenshots

0 comments on commit c8f18e0

Please sign in to comment.