Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(html): update video when clicking previous/next (#35309)

Simon Knott071e49687cd5
diff --git a/packages/html-reporter/src/testResultView.tsx b/packages/html-reporter/src/testResultView.tsx
index 060a1aaba4..0e3fb1002d 100644
--- a/packages/html-reporter/src/testResultView.tsx
+++ b/packages/html-reporter/src/testResultView.tsx
@@ -127,7 +127,7 @@ export const TestResultView: React.FC<{
{!!videos.length && <Anchor id='attachment-video'><AutoChip header='Videos' revealOnAnchorId='attachment-video'>
{videos.map((a, i) => <div key={`video-${i}`}>
- <video controls>
+ <video key={a.path} controls> {/* key is required to ensure video is updated when the path changes */}
<source src={a.path} type={a.contentType}/>
</video>
<AttachmentLink attachment={a} result={result}></AttachmentLink>