mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
feat(trace): account for more action types in timeline (#5077)
This commit is contained in:
parent
45c33ae02f
commit
16249ccbda
@ -82,16 +82,28 @@
|
|||||||
box-shadow: 0 0 0 1px var(--action-color);
|
box-shadow: 0 0 0 1px var(--action-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.timeline-bar.click {
|
.timeline-bar.click,
|
||||||
|
.timeline-bar.dblclick,
|
||||||
|
.timeline-bar.hover,
|
||||||
|
.timeline-bar.check,
|
||||||
|
.timeline-bar.uncheck,
|
||||||
|
.timeline-bar.tap {
|
||||||
--action-color: var(--green);
|
--action-color: var(--green);
|
||||||
}
|
}
|
||||||
|
|
||||||
.timeline-bar.fill,
|
.timeline-bar.fill,
|
||||||
.timeline-bar.press {
|
.timeline-bar.press,
|
||||||
|
.timeline-bar.type,
|
||||||
|
.timeline-bar.selectOption,
|
||||||
|
.timeline-bar.setInputFiles {
|
||||||
--action-color: var(--orange);
|
--action-color: var(--orange);
|
||||||
}
|
}
|
||||||
|
|
||||||
.timeline-bar.goto {
|
.timeline-bar.goto,
|
||||||
|
.timeline-bar.setContent,
|
||||||
|
.timeline-bar.goBack,
|
||||||
|
.timeline-bar.goForward,
|
||||||
|
.timeline-bar.reload {
|
||||||
--action-color: var(--blue);
|
--action-color: var(--blue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -55,13 +55,16 @@ export const Timeline: React.FunctionComponent<{
|
|||||||
const bars: TimelineBar[] = [];
|
const bars: TimelineBar[] = [];
|
||||||
for (const page of context.pages) {
|
for (const page of context.pages) {
|
||||||
for (const entry of page.actions) {
|
for (const entry of page.actions) {
|
||||||
|
let detail = entry.action.selector || '';
|
||||||
|
if (entry.action.action === 'goto')
|
||||||
|
detail = entry.action.value || '';
|
||||||
bars.push({
|
bars.push({
|
||||||
entry,
|
entry,
|
||||||
leftTime: entry.action.startTime,
|
leftTime: entry.action.startTime,
|
||||||
rightTime: entry.action.endTime,
|
rightTime: entry.action.endTime,
|
||||||
leftPosition: timeToPosition(measure.width, boundaries, entry.action.startTime),
|
leftPosition: timeToPosition(measure.width, boundaries, entry.action.startTime),
|
||||||
rightPosition: timeToPosition(measure.width, boundaries, entry.action.endTime),
|
rightPosition: timeToPosition(measure.width, boundaries, entry.action.endTime),
|
||||||
label: entry.action.action + ' ' + (entry.action.selector || entry.action.value || ''),
|
label: entry.action.action + ' ' + detail,
|
||||||
type: entry.action.action,
|
type: entry.action.action,
|
||||||
priority: 0,
|
priority: 0,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -36,7 +36,7 @@ export const Workbench: React.FunctionComponent<{
|
|||||||
return actions;
|
return actions;
|
||||||
}, [context]);
|
}, [context]);
|
||||||
|
|
||||||
const snapshotSize = context.created.viewportSize!;
|
const snapshotSize = context.created.viewportSize || { width: 1280, height: 720 };
|
||||||
|
|
||||||
return <div className='vbox workbench'>
|
return <div className='vbox workbench'>
|
||||||
<div className='hbox header'>
|
<div className='hbox header'>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user