@@ -2,7 +2,7 @@ import {assertValueIsNotNull} from '../../asserts';
22import { generalLog } from '../../generalLog' ;
33import { getDurationWithUnits } from '../../getDurationWithUnits' ;
44
5- import { sanitizeHtml } from '../client' ;
5+ import { createJsxRuntime , sanitizeHtml } from '../client' ;
66import { getImgCspHosts } from '../getImgCspHosts' ;
77import { getRetriesProps } from '../getRetriesProps' ;
88
@@ -12,10 +12,14 @@ import {renderHead} from './renderHead';
1212import { renderJsonData } from './renderJsonData' ;
1313import { renderNavigation } from './renderNavigation' ;
1414import { renderRetries } from './renderRetries' ;
15- import { renderWarnings } from './renderWarnings ' ;
15+ import { Warnings } from './Warnings ' ;
1616
1717import type { ReportData , SafeHtml , UtcTimeInMs } from '../../../types/internal' ;
1818
19+ declare const jsx : JSX . Runtime ;
20+
21+ Object . assign ( globalThis , { jsx : createJsxRuntime ( ) } ) ;
22+
1923/**
2024 * Renders report data to HTML report page.
2125 * @internal
@@ -33,28 +37,39 @@ export const renderReportToHtml = (reportData: ReportData): SafeHtml => {
3337 const retryNumbers = retries . map ( ( { retryIndex} ) => retryIndex ) ;
3438 const maxRetry = Math . max ( ...retryNumbers ) ;
3539
36- const safeHtml = sanitizeHtml `<!DOCTYPE html>
37- <html lang="en">
38- ${ renderHead ( reportFileName , imgCspHosts ) }
39- <body>
40- ${ renderNavigation ( { retries} ) }
41- <div class="main" role="tabpanel">
42- <section class="main__section _position_left" aria-label="Retry ${ maxRetry } " ${ locator ( 'column1' ) } >
43- ${ renderRetries ( { retries} ) }
44- ${ renderErrors ( reportData . errors ) }
45- ${ renderWarnings ( reportData . warnings ) }
46- </section>
47- <div class="drag-container"></div>
48- <section
49- aria-label="Tests results"
50- class="main__section _position_right"
51- id="e2edRightColumnContainer"
52- ${ locator ( 'column2' ) }
53- ><div class="test-details-empty"><p>No test selected</p></div></section>
54- </div>
55- ${ renderJsonData ( reportData ) }
56- </body>
57- </html>` ;
40+ const page = (
41+ < html lang = "en" >
42+ { renderHead ( reportFileName , imgCspHosts ) }
43+ < body >
44+ { renderNavigation ( { retries} ) }
45+ < div class = "main" role = "tabpanel" >
46+ < section
47+ class = "main__section _position_left"
48+ aria-label = { `Retry ${ maxRetry } ` }
49+ { ...locator ( 'column1' ) }
50+ >
51+ { renderRetries ( { retries} ) }
52+ { renderErrors ( reportData . errors ) }
53+ < Warnings warnings = { reportData . warnings } />
54+ </ section >
55+ < div class = "drag-container" > </ div >
56+ < section
57+ aria-label = "Tests results"
58+ class = "main__section _position_right"
59+ id = "e2edRightColumnContainer"
60+ { ...locator ( 'column2' ) }
61+ >
62+ < div class = "test-details-empty" >
63+ < p > No test selected</ p >
64+ </ div >
65+ </ section >
66+ </ div >
67+ { renderJsonData ( reportData ) }
68+ </ body >
69+ </ html >
70+ ) ;
71+
72+ const safeHtml = sanitizeHtml `<!DOCTYPE html>${ page } ` ;
5873
5974 const durationWithUnits = getDurationWithUnits ( Date . now ( ) - startTimeInMs ) ;
6075
0 commit comments