Skip to content

Commit

Permalink
Rewrite e2e tests with new helper classes, use strategy matrix in git…
Browse files Browse the repository at this point in the history
…hub e2e test workflow to speed up tests and general e2e test cleanup
  • Loading branch information
RandomTannenbaum committed Nov 20, 2024
1 parent fbe4aae commit 6d53f89
Show file tree
Hide file tree
Showing 47 changed files with 1,994 additions and 1,855 deletions.
32 changes: 24 additions & 8 deletions .github/workflows/frontend-test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,28 @@ jobs:
- name: Run unit tests
run: npm test

get-e2e-files:
runs-on: ubuntu-24.04
outputs:
file_list: ${{ steps.generate-file-list.outputs.file_list }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Generate file list
id: generate-file-list
run: |
FILES=$(ls frontend/cypress/e2e | jq -R . | jq -s . | jq -c)
echo $FILES
echo "file_list=$FILES" >> $GITHUB_OUTPUT
e2e:
needs: get-e2e-files
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
file: ${{ fromJSON(needs.get-e2e-files.outputs.file_list) }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -32,12 +52,7 @@ jobs:
uses: actions/setup-java@v4
with:
java-version: ${{vars.JAVA_VERSION}}
distribution: 'adopt'

- uses: abhi1693/[email protected]
with:
browser: chrome
version: latest
distribution: 'temurin'

- name: run keycloak docker
run: |
Expand All @@ -61,12 +76,13 @@ jobs:
wait-on: 'http://pitc.okr.localhost:8080/config, http://pitc.okr.localhost:4200, http://localhost:8544'
wait-on-timeout: 120
browser: chrome
headed: true
headed: false
spec: cypress/e2e/${{ matrix.file }}

- uses: actions/upload-artifact@v4
if: always()
with:
name: cypress-screenshots
name: cypress-screenshots for ${{ matrix.file }}
path: frontend/cypress/screenshots

- name: remove docker containers
Expand Down
3 changes: 3 additions & 0 deletions frontend/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ export default defineConfig({
e2e: {
baseUrl: 'http://pitc.okr.localhost:4200',
experimentalMemoryManagement: true,
testIsolation: true,
viewportWidth: 1920,
viewportHeight: 1080,
},
env: {
login_url: 'http://localhost:8544',
Expand Down
Loading

0 comments on commit 6d53f89

Please sign in to comment.