Skip to content

Commit e5cb2f3

Browse files
renemadsenclaude
andcommitted
feat: always record Playwright video + upload artifacts on success
- Change video from 'retain-on-failure' to 'on' in playwright.config.ts - Change artifact upload from 'if: failure()' to 'if: always()' in both CI workflows (master + PR) - Video recordings now available as downloadable artifacts for every test run, regardless of pass/fail status Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 22d33e6 commit e5cb2f3

4 files changed

Lines changed: 30 additions & 3 deletions

File tree

.github/workflows/dotnet-core-master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ jobs:
196196
if: ${{ failure() }}
197197
run: cat docker_run_log
198198
- name: Archive Playwright report
199-
if: failure()
199+
if: always()
200200
uses: actions/upload-artifact@v4
201201
with:
202202
name: playwright-report-${{ matrix.test }}

.github/workflows/dotnet-core-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ jobs:
185185
if: ${{ failure() }}
186186
run: cat docker_run_log
187187
- name: Archive Playwright report
188-
if: failure()
188+
if: always()
189189
uses: actions/upload-artifact@v4
190190
with:
191191
name: playwright-report-${{ matrix.test }}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Playwright Always-Record Video Design
2+
3+
## Context
4+
5+
Playwright tests currently only capture video/screenshot on failure (`retain-on-failure`). This makes it impossible to review test behavior when tests pass. We want video recordings always available as CI artifacts, similar to Cypress video recording.
6+
7+
## Changes
8+
9+
### 1. playwright.config.ts - Always record video
10+
11+
Change `video` from `'retain-on-failure'` to `'on'`. Keep screenshot as `'only-on-failure'` (screenshots are less useful when video exists). Skip trace (large files, not needed for general monitoring).
12+
13+
### 2. CI workflow - Upload artifacts always
14+
15+
Change artifact upload condition from `if: failure()` to `if: always()` in both workflow files. This ensures video recordings are available as downloadable artifacts even when all tests pass.
16+
17+
### Files to modify
18+
19+
| File | Change |
20+
|------|--------|
21+
| `eform-client/playwright.config.ts` | `video: 'retain-on-failure'` -> `video: 'on'` |
22+
| `.github/workflows/dotnet-core-master.yml` | `if: failure()` -> `if: always()` on artifact upload step |
23+
| `.github/workflows/dotnet-core-pr.yml` | Same change |
24+
25+
## Verification
26+
27+
After merge, check any CI run's artifacts - every playwright-report-{a..o} artifact should contain video files (`.webm`) regardless of test outcome.

eform-client/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default defineConfig({
66
use: {
77
baseURL: 'http://localhost:4200',
88
viewport: { width: 1920, height: 1080 },
9-
video: 'retain-on-failure',
9+
video: 'on',
1010
screenshot: 'only-on-failure',
1111
},
1212
reporter: [

0 commit comments

Comments
 (0)