File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 11import { TestCase } from "@playwright/test/reporter" ;
2+ import Convert from "ansi-to-html" ;
23
34export const getHtmlTable = ( tests : TestCase [ ] ) : string => {
5+ const convert = new Convert ( ) ;
6+
47 const content : string [ ] = [ ] ;
58
69 content . push ( `<br>` ) ;
@@ -11,6 +14,7 @@ export const getHtmlTable = (tests: TestCase[]): string => {
1114 content . push ( `<th>Status</th>` ) ;
1215 content . push ( `<th>Duration</th>` ) ;
1316 content . push ( `<th>Retries</th>` ) ;
17+ content . push ( `<th>Error</th>` ) ;
1418 content . push ( `</tr>` ) ;
1519 content . push ( `</thead>` ) ;
1620 content . push ( `<tbody>` ) ;
@@ -26,6 +30,13 @@ export const getHtmlTable = (tests: TestCase[]): string => {
2630 ) ;
2731 content . push ( `<td>${ result . duration / 1000 } s</td>` ) ;
2832 content . push ( `<td>${ result . retry } </td>` ) ;
33+ content . push (
34+ `<td>${
35+ result . error && result . error . message
36+ ? convert . toHtml ( result . error . message ! )
37+ : ""
38+ } </td>`
39+ ) ;
2940 content . push ( `</tr>` ) ;
3041 }
3142
You can’t perform that action at this time.
0 commit comments