Skip to content

Commit

Permalink
Merge pull request #630 from DFE-Digital/patch/cypress-workflow
Browse files Browse the repository at this point in the history
Switch to using Cypress docker image for running tests
  • Loading branch information
DrizzlyOwl authored Dec 16, 2024
2 parents fd89e2c + 412e5ca commit f21c909
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 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,38 +21,38 @@ on:
concurrency:
group: ${{ github.workflow }}

env:
NODE_VERSION: 18.x

jobs:
cypress-tests:
name: Run Cypress tests
if: inputs.environment == 'test' || inputs.environment == 'development'
environment: ${{ inputs.environment }}
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
strategy:
matrix:
browser: [
"edge"
]
container:
image: cypress/browsers:22.12.0
defaults:
run:
working-directory: CypressTests
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/checkout@v4
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.API_KEY }}
CYPRESS_url: ${{ secrets.URL }}
with:
node-version: ${{ env.NODE_VERSION }}

- name: Npm install
run: npm install

- name: Run cypress
run: npm run cy:run -- --env apiKey=${{ secrets.API_KEY }},url=${{ secrets.URL }}
browser: ${{ matrix.browser }}
working-directory: CypressTests

- name: Upload artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: screenshots-${{ inputs.environment }}
name: screenshots-${{ inputs.environment }}-${{ matrix.browser }}
path: CypressTests/cypress/screenshots

0 comments on commit f21c909

Please sign in to comment.