@@ -16,6 +16,8 @@ interface JUnitTestCase {
16
16
errorTrace : string | undefined ,
17
17
errorMessage : string | undefined ,
18
18
errorType : string | undefined ,
19
+ file ?: string ,
20
+ lineno ?: string ,
19
21
skipped ?: boolean ;
20
22
}
21
23
@@ -28,7 +30,7 @@ async function parseJUnitReport(filePath: string): Promise<JUnitTestCase[]> {
28
30
const parseTestSuite = ( suite : any , suiteName : string ) => {
29
31
if ( suite . testcase ) {
30
32
suite . testcase . forEach ( ( testCase : any ) => {
31
- const { classname, name, time } = testCase . $ ;
33
+ const { classname, file , lineno , name, time } = testCase . $ ;
32
34
33
35
const hasFailure = testCase . failure !== undefined ;
34
36
const failureTrace = hasFailure ? ( testCase . failure [ 0 ] ?. _ || '' ) : undefined ;
@@ -46,6 +48,8 @@ async function parseJUnitReport(filePath: string): Promise<JUnitTestCase[]> {
46
48
classname,
47
49
name,
48
50
time,
51
+ file,
52
+ lineno,
49
53
hasFailure,
50
54
failureTrace,
51
55
failureMessage,
@@ -101,10 +105,14 @@ function convertToCTRFTest(testCase: JUnitTestCase, useSuiteName: boolean): Ctrf
101
105
? `${ testCase . suite } : ${ testCase . name } `
102
106
: testCase . name ;
103
107
108
+ const line = testCase . lineno ? parseInt ( testCase . lineno ) : undefined ;
109
+
104
110
return {
105
111
name : testName ,
106
112
status,
107
113
duration : durationMs ,
114
+ filePath : testCase . file ,
115
+ line : line ,
108
116
message : testCase . failureMessage || testCase . errorMessage || undefined ,
109
117
trace : testCase . failureTrace || testCase . errorTrace || undefined ,
110
118
suite : testCase . suite || '' ,
0 commit comments