Skip to content

Add GitHub Actions workflow for Playwright .NET tests #3

Add GitHub Actions workflow for Playwright .NET tests

Add GitHub Actions workflow for Playwright .NET tests #3

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