|
41 | 41 | - Converts **<traits>** elements to to JUnit **<properties>**. |
42 | 42 | - Converts skipped `test` **<reason>** elements to JUnit **<skipped>** with message. |
43 | 43 | - Converts `test` **<failure>** elements to JUnit **<failure>** with message and stack trace. |
44 | | -- Supports single **<assembly>** per file, if multiple assemblies are present only first will be converted. |
| 44 | +- Supports single **<assembly>** per file, if multiple assemblies are present, only the first will be converted. |
45 | 45 |
|
46 | 46 | ### MSTest TRX |
47 | 47 |
|
| 48 | +`dotnet test` generates TRX style files unless different logger is used.` |
| 49 | + |
| 50 | +- Converts `Output/ErrorInfo/ErrorInfo` to JUnit **<failure>** with message. |
48 | 51 | - Converts `Output/ErrorInfo/Message` to JUnit **<failure>** message. |
49 | 52 | - Converts `Output/ErrorInfo/StackTrace` to JUnit **<failure>** stack trace. |
50 | 53 | - Converts `Output/StdErr` to JUnit **<system-err>**. |
@@ -86,25 +89,26 @@ converter.toJson(options).then((result) =>{/*do something with result*/}); |
86 | 89 | npm i -g junit-converter |
87 | 90 | ``` |
88 | 91 |
|
| 92 | +#### Convert test report to JUnit format and save to file |
89 | 93 | ```bash |
90 | 94 | junit-converter --testFile mytests/nunit.xml --testType nunit |
91 | 95 | ``` |
92 | 96 |
|
93 | 97 | ### Options |
94 | 98 |
|
95 | | -| Option | Type | Default | Description | |
96 | | -|:--------------------------|:--------|:--------------------------|:------------------------------------------------------------------------------------------------| |
97 | | -| `testFile` **(required)** | string | | Path to test file for conversion | |
98 | | -| `testType` **(required)** | string | | [Test report type](https://github.com/agracio/mochawesome-converter#supported-testtype-options) | |
99 | | -| `reportDir` | string | ./report | Converted report output path when saving file | |
100 | | -| `reportFilename` | string | `testFile.name`-junit.xml | JUnit report name when saving file | |
101 | | -| `splitByClassname` | boolean | false | Split into multiple test suites by test classname | |
102 | | -| `minify` | boolean | false | Minify XML result | |
| 99 | +| Option | Type | Default | Description | |
| 100 | +|:--------------------------|:--------|:--------------------------|:--------------------------------------------------| |
| 101 | +| `testFile` **(required)** | string | | Path to test file for conversion | |
| 102 | +| `testType` **(required)** | string | | [Test report type](#supported-testtype-options) | |
| 103 | +| `reportDir` | string | ./report | Converted report output path when saving file | |
| 104 | +| `reportFile` | string | `testFile.name`-junit.xml | JUnit report file name | |
| 105 | +| `splitByClassname` | boolean | false | Split into multiple test suites by test classname | |
| 106 | +| `minify` | boolean | false | Minify XML result | |
103 | 107 |
|
104 | 108 | - `testFile` - relative or absolute path to input test file. |
105 | 109 | - `testType` - type of test report, not case-sensitive. |
106 | 110 | - `reportDir` - will be created if path does not exist. Only used when saving to file. |
107 | | -- `reportFilename` - JUnit file name. Only used when saving to file. |
| 111 | +- `reportFile` - JUnit file name. Only used when saving to file. |
108 | 112 | - `splitByClassname` - If true, splits test cases into multiple test suites by classname. |
109 | 113 | This is useful for test runners that generate tests under a single test suite such as `dotnet test` when using JUnit loggers. |
110 | 114 | Should only be set to true if test report file contains single test suite. |
|
0 commit comments