diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..dc818a3 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,45 @@ +name: UI Tests + +on: + push: + branches: [ main ] + # optionally: + # workflow_dispatch: + +jobs: + selenium-tests: + runs-on: ubuntu-latest + + services: + selenium: + image: selenium/standalone-chromium + ports: + - 4444:4444 + options: >- + --shm-size=2g + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' + + - name: Restore dependencies + run: dotnet restore src/ + + - name: Build solution + run: dotnet build src/ --configuration Release --no-restore + + - name: Run Selenium tests + env: + SELENIUM_HUB_URL: http://localhost:4444/wd/hub + run: dotnet test tests/Berufsschule_HAM.E2ETests/ --logger "trx;LogFileName=test-results.trx" + + - name: Upload test results + uses: actions/upload-artifact@v4 + with: + name: selenium-test-results + path: "**/TestResults/*.trx" \ No newline at end of file