Add GitHub Actions workflow for Playwright .NET tests #3
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: Playwright Tests (.NET) | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build project | |
| run: dotnet build --configuration Release --no-restore | |
| - name: Install Playwright browsers for .NET | |
| run: pwsh bin/Debug/net8.0/playwright.ps1 install --with-deps | |
| - name: Run Playwright Tests | |
| run: dotnet test --configuration Release --logger "trx;LogFileName=test_results.trx" | |
| - name: Upload Test Results | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: playwright-test-results | |
| path: TestResults/ | |
| - name: Print working directory and files | |
| run: ls -R |