fix(e2e): resolve E2E test failures — PageLoadStrategy, browse URL, select casing #26
Workflow file for this run
This file contains hidden or 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: Continuous Integration | |
| # {CI workflow for pull requests and feature branches} | |
| # {Runs tests and code quality checks without deployment} | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| - develop | |
| # {Run on pull requests to main branches} | |
| push: | |
| branches-ignore: | |
| - main | |
| - master | |
| # {Run on pushes to feature branches, but not main} | |
| env: | |
| JAVA_VERSION: '11' | |
| jobs: | |
| ci: | |
| name: CI - Build and Test | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| java-version: ['11'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK ${{ matrix.java-version }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ matrix.java-version }} | |
| distribution: 'temurin' | |
| cache: 'maven' | |
| - name: Verify Chrome is available | |
| run: google-chrome --version || chromium-browser --version | |
| # {GitHub ubuntu-latest includes Chrome; this confirms it before E2E tests} | |
| - name: Build with Maven | |
| run: mvn clean compile | |
| # {Compile code to check for compilation errors} | |
| - name: Start Jetty server (background) | |
| run: nohup mvn jetty:run -q > jetty.log 2>&1 & | |
| # {Non-blocking: starts Jetty on :8080 so E2E Selenium tests can connect} | |
| - name: Wait for Jetty to be ready | |
| run: | | |
| echo "Waiting for Jetty on localhost:8080..." | |
| for i in $(seq 1 30); do | |
| if curl -sf http://localhost:8080/ > /dev/null 2>&1; then | |
| echo "✅ Jetty is ready (attempt $i)" | |
| break | |
| fi | |
| if [ $i -eq 30 ]; then | |
| echo "❌ Jetty did not start within 90 seconds" | |
| cat jetty.log | |
| exit 1 | |
| fi | |
| echo " Attempt $i/30 — sleeping 3s..." | |
| sleep 3 | |
| done | |
| - name: Run Tests | |
| run: mvn test | |
| # {Run all tests — unit + E2E (Jetty is now running on :8080)} | |
| continue-on-error: false | |
| - name: Generate Test Report | |
| if: always() | |
| uses: dorny/test-reporter@v1 | |
| with: | |
| name: Maven Tests | |
| path: target/surefire-reports/*.xml | |
| reporter: java-junit | |
| fail-on-error: false | |
| # {Generate test report visible in GitHub PR} | |
| - name: Stop Jetty server | |
| if: always() | |
| run: pkill -f "jetty:run" || true | |
| # {Always stop Jetty, even if tests failed} | |
| - name: Build WAR file | |
| run: mvn package -DskipTests | |
| # {Build WAR file to verify packaging works} | |
| continue-on-error: false | |
| - name: Check WAR file exists | |
| run: | | |
| if ls target/*.war 1>/dev/null 2>&1; then | |
| echo "✅ WAR file built successfully" | |
| ls -lh target/*.war | |
| else | |
| echo "❌ WAR file not found" | |
| exit 1 | |
| fi | |