Skip to content

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

feat(ui): hovering actions highlights timeline segment (#37211)

Adam Gastineau863ec8a65ac9
diff --git a/packages/trace-viewer/src/ui/timeline.tsx b/packages/trace-viewer/src/ui/timeline.tsx
index 4e8b194b1a..05da35e444 100644
--- a/packages/trace-viewer/src/ui/timeline.tsx
+++ b/packages/trace-viewer/src/ui/timeline.tsx
@@ -74,8 +74,6 @@ export const Timeline: React.FunctionComponent<{
const bars = React.useMemo(() => {
const bars: TimelineBar[] = [];
for (const entry of actions || []) {
- if (entry.class === 'Test')
- continue;
bars.push({
action: entry,
leftTime: entry.startTime,
@@ -254,22 +252,24 @@ export const Timeline: React.FunctionComponent<{
<div style={{ height: 8 }}></div>
<FilmStrip model={model} boundaries={boundaries} previewPoint={previewPoint} />
<div className='timeline-bars'>{
- bars.map((bar, index) => {
- return <div key={index}
- className={clsx('timeline-bar',
- bar.action && 'action',
- bar.resource && 'network',
- bar.consoleMessage && 'console-message',
- bar.active && 'active',
- bar.error && 'error')}
- style={{
- left: bar.leftPosition,
- width: Math.max(5, bar.rightPosition - bar.leftPosition),
- top: barTop(bar),
- bottom: 0,
- }}
- ></div>;
- })
+ bars
+ .filter(bar => !bar.action || bar.action.class !== 'Test')
+ .map((bar, index) => {
+ return <div key={index}
+ className={clsx('timeline-bar',
+ bar.action && 'action',
+ bar.resource && 'network',
+ bar.consoleMessage && 'console-message',
+ bar.active && 'active',
+ bar.error && 'error')}
+ style={{
+ left: bar.leftPosition,
+ width: Math.max(5, bar.rightPosition - bar.leftPosition),
+ top: barTop(bar),
+ bottom: 0,
+ }}
+ ></div>;
+ })
}</div>
<div className='timeline-marker' style={{
display: (previewPoint !== undefined) ? 'block' : 'none',