E2E Tests #1
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: E2E Tests | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| # Nightly at 02:00 UTC | |
| - cron: '0 2 * * *' | |
| jobs: | |
| playwright-wasm: | |
| name: E2E — Playwright (Blazor WASM) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Install WASM workload | |
| run: dotnet workload install wasm-tools | |
| - name: Restore | |
| run: dotnet restore MakerPrompt.E2E.Wasm/MakerPrompt.E2E.Wasm.csproj | |
| - name: Build E2E project | |
| run: dotnet build MakerPrompt.E2E.Wasm/MakerPrompt.E2E.Wasm.csproj --no-restore -c Release | |
| - name: Install Playwright browsers | |
| run: pwsh MakerPrompt.E2E.Wasm/bin/Release/net10.0/playwright.ps1 install --with-deps chromium | |
| - name: Run Playwright E2E tests | |
| env: | |
| E2E_HEADLESS: "true" | |
| run: | | |
| dotnet test MakerPrompt.E2E.Wasm/MakerPrompt.E2E.Wasm.csproj \ | |
| --no-build \ | |
| --configuration Release \ | |
| --logger "trx;LogFileName=wasm-e2e-results.trx" \ | |
| --results-directory ./e2e-results/wasm | |
| - name: Upload Playwright traces and results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-wasm-results | |
| path: ./e2e-results/wasm/ | |
| if-no-files-found: ignore | |
| playwright-maui: | |
| name: E2E — Playwright (MAUI Windows) | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Add MSBuild to PATH | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Install MAUI workloads | |
| run: | | |
| dotnet workload install maui | |
| dotnet workload install maui-windows | |
| - name: Build MAUI app (Debug — enables CDP debugging port) | |
| run: > | |
| dotnet build MakerPrompt.MAUI/MakerPrompt.MAUI.csproj | |
| -c Debug | |
| -f net10.0-windows10.0.19041.0 | |
| -p:RuntimeIdentifierOverride=win-x64 | |
| - name: Restore E2E.Maui | |
| run: dotnet restore MakerPrompt.E2E.Maui/MakerPrompt.E2E.Maui.csproj | |
| - name: Build E2E.Maui project | |
| run: dotnet build MakerPrompt.E2E.Maui/MakerPrompt.E2E.Maui.csproj --no-restore -c Release | |
| - name: Install Playwright browsers | |
| run: pwsh MakerPrompt.E2E.Maui/bin/Release/net10.0/playwright.ps1 install --with-deps chromium | |
| - name: Run MAUI E2E tests | |
| env: | |
| MAUI_APP_PATH: ${{ github.workspace }}\MakerPrompt.MAUI\bin\Debug\net10.0-windows10.0.19041.0\win-x64\MakerPrompt.MAUI.exe | |
| run: | | |
| dotnet test MakerPrompt.E2E.Maui/MakerPrompt.E2E.Maui.csproj ` | |
| --no-build ` | |
| --configuration Release ` | |
| --logger "trx;LogFileName=maui-e2e-results.trx" ` | |
| --results-directory ./e2e-results/maui | |
| - name: Upload MAUI E2E results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-maui-results | |
| path: ./e2e-results/maui/ | |
| if-no-files-found: ignore |