Initial Commit: Clean Playwright .NET Automation Framework with CI/CD… #18
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@v4 | |
| - 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 .NET CLI tool | |
| run: dotnet tool install --global Microsoft.Playwright.CLI | |
| - name: Install Playwright browsers | |
| run: playwright 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@v4 | |
| with: | |
| name: playwright-test-results | |
| path: TestResults/ |