Skip to content

Commit

Permalink
Add some end-to-end tests with Selenium via GitHub actions #1038 (#1039)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaifroid authored Aug 7, 2023
1 parent 56b0086 commit 97f7ca5
Show file tree
Hide file tree
Showing 9 changed files with 1,897 additions and 173 deletions.
41 changes: 31 additions & 10 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ on:
jobs:

# Tests the list of offline files in the Service Worker and compares it to the contents of the www directory
tests-files-build-windows:
# Also runs end-to-end tests on Windows (taking advantage of the build)
tests-files-windows:
# We want to run on external PRs, but not on our own internal PRs as they'll be run by the push to the branch
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: windows-latest
Expand All @@ -20,21 +21,16 @@ jobs:
run: npm ci

- name: Test the list of offline files in Service Worker
shell: pwsh
run: ./scripts/Check-OfflineFilesList.ps1

- name: Test that the app can be built
shell: pwsh
run: npm run build

# This job runs always, including for remote pull requests, and
# has external dependencies or special permission needs, besides a
# local install of Node.js, Firefox, and Chromium or Chrome.
#
# You can run these same tests locally in your own developer
# environment via `npm ci && npm test`.

tests-unit-linux:
tests-linux:
# We want to run on external PRs, but not on our own internal PRs as they'll be run by the push to the branch
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-20.04
Expand All @@ -43,7 +39,6 @@ jobs:
- uses: actions/checkout@v3

- name: Test integrity of app parameters
shell: bash
run: |
# Check that values of assetsCache and appVersion are correctly duplicated
chmod +x ./scripts/test_duplicate_values.sh
Expand All @@ -57,8 +52,22 @@ jobs:

- name: Unit tests (Linux)
run: npm run test-unit-browsers

- name: Test a full build of the app
run: npm run build

- name: End-to-end tests (Linux)
env:
GITHUB_ACTION: ${{ github.event_name }}
run: |
echo -e "\n\e[0;32mTesting on Edge Chromium..."
npm run test-e2e-edge
echo -e "\n\e[0;32mTesting on Chrome..."
npm run test-e2e-chrome
echo -e "\n\e[0;32mTesting on Firefox..."
npm run test-e2e-firefox
tests-unit-windows:
tests-windows:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: windows-latest
steps:
Expand All @@ -69,11 +78,23 @@ jobs:
run: npm ci

- name: Unit tests (Windows)
shell: pwsh
run: |
npm run test-unit-edge
npm run test-unit-firefox
- name: End-to-end tests (Windows)
env:
GITHUB_ACTION: ${{ github.event_name }}
run: |
Write-Host "`n*** Building the app... ***" -ForegroundColor Green
npm run build-min
Write-Host "`n*** Testing on Edge Chromium... ***" -ForegroundColor Green
npm run test-e2e-edge
Write-Host "`n*** Testing on Firefox... ***" -ForegroundColor Green
npm run test-e2e-firefox
Write-Host "`n*** Testing on IE11... ***" -ForegroundColor Green
npm run test-e2e-iemode
# tests-unit-mac:
# if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
# runs-on: macos-latest
Expand Down
Loading

0 comments on commit 97f7ca5

Please sign in to comment.