fix(trace viewer): reveal stack for highlighted action
This commit is contained in:
parent
dbf7976dd8
commit
9a362c944b
|
|
@ -114,16 +114,16 @@ export const Workbench: React.FunctionComponent<{
|
|||
}
|
||||
}, [model, selectedCallId]);
|
||||
|
||||
const revealedStack = React.useMemo(() => {
|
||||
if (revealedError)
|
||||
return revealedError.stack;
|
||||
return selectedAction?.stack;
|
||||
}, [selectedAction, revealedError]);
|
||||
|
||||
const activeAction = React.useMemo(() => {
|
||||
return highlightedAction || selectedAction;
|
||||
}, [selectedAction, highlightedAction]);
|
||||
|
||||
const revealedStack = React.useMemo(() => {
|
||||
if (revealedError)
|
||||
return revealedError.stack;
|
||||
return activeAction?.stack;
|
||||
}, [activeAction, revealedError]);
|
||||
|
||||
const onActionSelected = React.useCallback((action: modelUtil.ActionTraceEventInContext) => {
|
||||
setSelectedAction(action);
|
||||
setHighlightedAction(undefined);
|
||||
|
|
|
|||
|
|
@ -76,6 +76,11 @@ class TraceViewerPage {
|
|||
await this.page.locator(`.action-title:has-text("${title}")`).nth(ordinal).click();
|
||||
}
|
||||
|
||||
@step
|
||||
async hoverAction(title: string, ordinal: number = 0) {
|
||||
await this.page.locator(`.action-title:has-text("${title}")`).nth(ordinal).hover();
|
||||
}
|
||||
|
||||
@step
|
||||
async selectSnapshot(name: string) {
|
||||
await this.page.click(`.snapshot-tab .tabbed-pane-tab-label:has-text("${name}")`);
|
||||
|
|
|
|||
|
|
@ -864,6 +864,9 @@ test('should show action source', async ({ showTraceViewer }) => {
|
|||
await page.click('text=Source');
|
||||
await expect(page.locator('.source-line-running')).toContainText('await page.getByText(\'Click\').click()');
|
||||
await expect(page.getByTestId('stack-trace-list').locator('.list-view-entry.selected')).toHaveText(/doClick.*trace-viewer\.spec\.ts:[\d]+/);
|
||||
|
||||
await traceViewer.hoverAction('page.waitForNavigation');
|
||||
await expect(page.locator('.source-line-running')).toContainText('page.waitForNavigation()');
|
||||
});
|
||||
|
||||
test('should follow redirects', async ({ page, runAndTrace, server, asset }) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue