Skip to content

Add code coverage and condense unit test actions #9

Add code coverage and condense unit test actions

Add code coverage and condense unit test actions #9

name: End to End Tests
on:
pull_request:
branches: [ "main" ]
jobs:
build:
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '9.x' ]
browser: [ "chromium", "firefox", "webkit" ]
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Ensure browsers are installed
timeout-minutes: 5
run: pwsh tests/EndToEndTests/bin/Debug/net9.0/playwright.ps1 install --with-deps ${{ matrix.browser }}
- name: Test
run: dotnet test tests/EndToEndTests --settings:tests/EndToEndTests/${{ matrix.browser }}.runsettings --no-build --verbosity normal --logger trx --results-directory "EndToEndTestResults-${{ matrix.browser }}-${{ matrix.dotnet-version }}"
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: dotnet-end-to-end-test-results-${{ matrix.browser }}-${{ matrix.dotnet-version }}
path: EndToEndTestResults-${{ matrix.browser }}-${{ matrix.dotnet-version }}
if: ${{ always() }}
- name: Upload playwright trace results
uses: actions/upload-artifact@v4
with:
name: playwright-traces-${{ matrix.browser }}-${{ matrix.dotnet-version }}
path: tests/EndToEndTests/bin/Debug/net9.0/playwright-traces
if-no-files-found: ignore
if: ${{ always() }}