mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: show innermost error in ui mode (#26840)
This commit is contained in:
parent
a339bead09
commit
1c5f53f216
@ -96,4 +96,5 @@
|
|||||||
|
|
||||||
.call-tab .error-message {
|
.call-tab .error-message {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
|
line-height: 17px;
|
||||||
}
|
}
|
||||||
|
@ -90,6 +90,11 @@ export class MultiTraceModel {
|
|||||||
this.resources.sort((a1, a2) => a1._monotonicTime! - a2._monotonicTime!);
|
this.resources.sort((a1, a2) => a1._monotonicTime! - a2._monotonicTime!);
|
||||||
this.sources = collectSources(this.actions);
|
this.sources = collectSources(this.actions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
failedAction() {
|
||||||
|
// This find innermost action for nested ones.
|
||||||
|
return this.actions.findLast(a => a.error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function indexModel(context: ContextEntry) {
|
function indexModel(context: ContextEntry) {
|
||||||
|
@ -65,7 +65,7 @@ export const Workbench: React.FunctionComponent<{
|
|||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (selectedAction && model?.actions.includes(selectedAction))
|
if (selectedAction && model?.actions.includes(selectedAction))
|
||||||
return;
|
return;
|
||||||
const failedAction = model?.actions.find(a => a.error);
|
const failedAction = model?.failedAction();
|
||||||
if (initialSelection && model?.actions.includes(initialSelection))
|
if (initialSelection && model?.actions.includes(initialSelection))
|
||||||
setSelectedAction(initialSelection);
|
setSelectedAction(initialSelection);
|
||||||
else if (failedAction)
|
else if (failedAction)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user