Skip to content

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

chore(html): align trace button so it doesn't resize the test row (#36815)

Adam Gastineaub16ff91fd882
diff --git a/packages/html-reporter/src/testFileView.css b/packages/html-reporter/src/testFileView.css
index 5140214f0a..4c2b11abae 100644
--- a/packages/html-reporter/src/testFileView.css
+++ b/packages/html-reporter/src/testFileView.css
@@ -41,6 +41,21 @@
align-items: center;
}
+.test-file-details-row-items {
+ display: flex;
+ height: 16px;
+}
+
+.test-file-details-row-items > .link-badge {
+ /* Align badges */
+ margin-top: -2px;
+}
+
+.test-file-details-row-items > .trace-link {
+ /* Center in row */
+ margin-top: -4px;
+}
+
.test-file-path {
text-overflow: ellipsis;
overflow: hidden;
diff --git a/packages/html-reporter/src/testFileView.tsx b/packages/html-reporter/src/testFileView.tsx
index d8a9670100..49af0f4b10 100644
--- a/packages/html-reporter/src/testFileView.tsx
+++ b/packages/html-reporter/src/testFileView.tsx
@@ -59,12 +59,14 @@ export const TestFileView: React.FC<React.PropsWithChildren<{
<span data-testid='test-duration' style={{ minWidth: '50px', textAlign: 'right' }}>{msToString(test.duration)}</span>
</div>
<div className='test-file-details-row'>
- <Link href={testResultHref({ test })} title={[...test.path, test.title].join(' › ')} className='test-file-path-link'>
- <span className='test-file-path'>{test.location.file}:{test.location.line}</span>
- </Link>
- {imageDiffBadge(test)}
- {videoBadge(test)}
- <TraceLink test={test} dim={true} />
+ <div className='test-file-details-row-items'>
+ <Link href={testResultHref({ test })} title={[...test.path, test.title].join(' › ')} className='test-file-path-link'>
+ <span className='test-file-path'>{test.location.file}:{test.location.line}</span>
+ </Link>
+ {imageDiffBadge(test)}
+ {videoBadge(test)}
+ <TraceLink test={test} dim={true} />
+ </div>
</div>
</div>
)}