@@ -72,6 +72,22 @@ function validateResults(results) {
72
72
return true ;
73
73
}
74
74
75
+ function readTestcaseFile ( filename ) {
76
+ if ( filename == undefined ) {
77
+ console . error ( "Testcase file not defined" ) ;
78
+ return "Testcase file not defined" ;
79
+ }
80
+ try {
81
+ var testcaseFileContent = file . readFileSync ( filename , "utf8" ) ;
82
+ testcaseFileContent =
83
+ testcaseFileContent . replace ( / \n / g, "<br> " ) ;
84
+ return testcaseFileContent ;
85
+ } catch ( err ) {
86
+ console . error ( "Error reading file ${filename}:" , err ) ;
87
+ return "Error reading file ${filename}: ${err}" ;
88
+ }
89
+ }
90
+
75
91
function setTestResults ( results ) {
76
92
if ( ! validateResults ( results ) ) {
77
93
return ;
@@ -82,17 +98,30 @@ function setTestResults(results) {
82
98
let html = `
83
99
<p>Duration: ${ results . duration_ms } ms</p>
84
100
<p>Status: ${ results . status } </p>
85
- <p>Testcase Name : ${ results . testcase_name } </p>
101
+ <p>Testcase Filter : ${ results . testcase_filter_name } </p>
86
102
<hr>
87
103
` ;
88
104
89
- html += results . tests . map ( test => `
90
- <p>Testcase Name: ${ test . testcase_name } </p>
91
- <p>Status: ${ test . status } </p>
92
- <hr>
93
- ` ) . join ( '' ) ;
105
+ html += results . tests . map ( test => {
106
+
107
+ var testcase ;
108
+ if ( test . testcase_file !== undefined ) {
109
+ testcase = readTestcaseFile ( test . testcase_file ) ;
110
+ }
111
+
112
+ return `
113
+ <p>Testcase Name: ${ test . testcase_name } </p>
114
+ <p>Status: ${ test . status } </p>
115
+ ${ test . actual ? `<p>Actual: ${ test . actual } </p>` : '' }
116
+ ${ test . expected ? `<p>Expected: ${ test . expected } </p>` : '' }
117
+ ${ test . reason ? `<p>Reason: ${ test . reason } </p>` : '' }
118
+ ${ testcase ? `<p>Testcase: ${ testcase } </p>` : '' }
119
+ <hr>
120
+ ` ;
121
+ } ) . join ( '' ) ;
94
122
95
123
div . innerHTML = html ;
124
+ document . getElementById ( 'tab-test-results-button' ) . click ( ) ;
96
125
}
97
126
98
127
function run ( ) {
@@ -265,7 +294,7 @@ document.addEventListener('DOMContentLoaded', (event) => {
265
294
266
295
Split ( [ '#top-right-panel' , '#bottom-right-panel' ] , {
267
296
minSize : 100 ,
268
- sizes : [ 75 , 25 ] ,
297
+ sizes : [ 60 , 40 ] ,
269
298
gutterSize : 5 ,
270
299
direction : 'vertical' ,
271
300
cursor : 'row-resize' ,
0 commit comments