E2E Tests (cross-browser) #268
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: E2E Tests (cross-browser) | |
on: | |
push: | |
branches: | |
- master | |
- release | |
schedule: | |
- cron: "0 0 * * *" # end of every day | |
jobs: | |
E2E-testing: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false # ensure both tests run even if one fails | |
matrix: | |
include: | |
- os: ubuntu-latest | |
browser: chrome | |
- os: windows-latest | |
browser: edge | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
- name: Cache Gradle packages | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Update Property File | |
run: mv src/e2e/resources/test.ci-${{ matrix.browser }}.properties src/e2e/resources/test.properties | |
- name: Remove Solr setting | |
if: matrix.os == 'windows-latest' | |
run: sed -i 's/app.search.service.host=http\\:\/\/localhost\\:8983\/solr/app.search.service.host=/g' src/main/resources/build.template.properties | |
- name: Run Solr search service + local Datastore emulator | |
if: matrix.os == 'ubuntu-latest' | |
run: docker-compose up -d | |
- name: Create Config Files | |
run: ./gradlew createConfigs testClasses generateTypes | |
- name: Install Frontend Dependencies | |
run: npm ci | |
- name: Build Frontend Bundle | |
run: npm run build | |
- name: Start Server | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
./gradlew serverRun & | |
./wait-for-server.sh | |
- name: Start Tests | |
if: matrix.os == 'ubuntu-latest' | |
run: xvfb-run --server-args="-screen 0 1024x768x24" ./gradlew e2eTests | |
- name: Start Server and Tests | |
if: matrix.os == 'windows-latest' | |
run: | | |
./gradlew runDatastoreEmulator | |
./gradlew serverRun & | |
./gradlew e2eTests |