11import type { FunctionalComponent } from "preact" ;
22import type { AwesomeTestResult } from "types" ;
33
4- import { getBodyItems } from "@/components/TestResult/bodyItems" ;
4+ import { getBodyItems , isDisplayableTestError } from "@/components/TestResult/bodyItems" ;
55import TestStepsEmpty from "@/components/TestResult/TestStepsEmpty" ;
66import { TrDescription } from "@/components/TestResult/TrDescription" ;
7+ import { TrError } from "@/components/TestResult/TrError" ;
78import { TrLinks } from "@/components/TestResult/TrLinks" ;
89import { TrMetadata } from "@/components/TestResult/TrMetadata" ;
910import { TrParameters } from "@/components/TestResult/TrParameters" ;
@@ -23,17 +24,23 @@ export type TrOverviewProps = {
2324
2425export const TrOverview : FunctionalComponent < TrOverviewProps > = ( { testResult } ) => {
2526 useTestResultOverviewFocusScroll ( ) ;
26- const { parameters, groupedLabels, links, descriptionHtml, setup, teardown, id } = testResult || { } ;
27+ const { parameters, groupedLabels, links, descriptionHtml, setup, teardown, id, error , status } = testResult || { } ;
2728 const testResultId = id ?? currentTrId . value ;
2829 const { t } = useI18n ( "ui" ) ;
2930 const bodyItems = getBodyItems ( testResult , t ( "error" ) ) ;
3031 const isNoSteps = ! setup ?. length && ! bodyItems . length && ! teardown ?. length ;
3132 const pwTraces = testResult ?. attachments ?. filter (
3233 ( attachment ) => attachment . link . contentType === "application/vnd.allure.playwright-trace" ,
3334 ) ;
35+ const showTopError = ( status === "failed" || status === "broken" ) && isDisplayableTestError ( error ) ;
3436
3537 return (
3638 < >
39+ { showTopError && (
40+ < div className = { styles [ "test-result-errors" ] } >
41+ < TrError { ...error } status = { status } />
42+ </ div >
43+ ) }
3744 { Boolean ( pwTraces ?. length ) && < TrPwTraces pwTraces = { pwTraces } /> }
3845 { Boolean ( parameters ?. length ) && < TrParameters id = { testResultId } parameters = { parameters } /> }
3946 { Boolean ( groupedLabels && Object . keys ( groupedLabels || { } ) ?. length ) && (
0 commit comments