Skip to content

Commit be5c367

Browse files
bruno-garciaclaude
andcommitted
ci: Add Playwright workflow for Blazor WASM E2E tests
Adds a lightweight CI workflow that runs the Blazor WebAssembly Playwright tests. Only triggers on PRs that touch Blazor WASM, core SDK, or ASP.NET Core code. Uses a minimal setup (just .NET SDK + Chromium) instead of the heavy shared environment action that installs Java, Android SDK, Mono, etc. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6983ba1 commit be5c367

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Blazor WASM Playwright Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release/*
8+
pull_request:
9+
paths:
10+
- 'src/Sentry/**'
11+
- 'src/Sentry.AspNetCore/**'
12+
- 'src/Sentry.AspNetCore.Blazor.WebAssembly/**'
13+
- 'src/Sentry.Extensions.Logging/**'
14+
- 'test/Sentry.AspNetCore.Blazor.WebAssembly.PlaywrightTests/**'
15+
- 'test/Sentry.AspNetCore.Blazor.WebAssembly.PlaywrightTests.TestApp/**'
16+
- 'global.json'
17+
- 'Directory.Build.props'
18+
- 'Directory.Build.targets'
19+
- 'nuget.config'
20+
- '.github/workflows/playwright-blazor-wasm.yml'
21+
workflow_dispatch:
22+
23+
jobs:
24+
playwright:
25+
name: Blazor WASM E2E
26+
runs-on: ubuntu-latest
27+
env:
28+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
29+
DOTNET_NOLOGO: 1
30+
steps:
31+
- name: Cancel Previous Runs
32+
if: github.ref_name != 'main' && !startsWith(github.ref_name, 'release/')
33+
uses: styfle/cancel-workflow-action@3155a141048f8f89c06b4cdae32e7853e97536bc # 0.13.0
34+
35+
- name: Checkout
36+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
37+
with:
38+
submodules: recursive
39+
40+
- name: Install .NET SDK
41+
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
42+
with:
43+
global-json-file: global.json
44+
45+
- name: Install .NET Workloads
46+
run: dotnet workload restore --temp-dir "${{ runner.temp }}" --skip-sign-check
47+
48+
- name: Build
49+
run: dotnet build test/Sentry.AspNetCore.Blazor.WebAssembly.PlaywrightTests -c Release
50+
51+
- name: Install Playwright Browsers
52+
run: pwsh test/Sentry.AspNetCore.Blazor.WebAssembly.PlaywrightTests/bin/Release/net10.0/playwright.ps1 install chromium --with-deps
53+
54+
- name: Run Playwright Tests
55+
run: dotnet test test/Sentry.AspNetCore.Blazor.WebAssembly.PlaywrightTests -c Release --no-build --logger "trx;LogFileName=results.trx"
56+
57+
- name: Upload Test Results
58+
if: failure()
59+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
60+
with:
61+
name: playwright-blazor-wasm-results
62+
path: test/Sentry.AspNetCore.Blazor.WebAssembly.PlaywrightTests/TestResults/

0 commit comments

Comments
 (0)