Convert TestNG results XML to (CTRF reports)[https://ctrf.io/docs/intro]
This package is useful if there isn't a CTRF reporter available for your test framework.
This project is a fork of junit-to-ctrf by Matthew Thomas. The TestNG adaptation was developed by Sahil Goyal while maintaining the same high standards and principles of the original project.
For a complete list of third-party libraries and their licenses used in this project, please see our Third Party Attributions file.
npx testng-to-ctrf path/to/testng-results.xml
-o
, --output
: Output directory and filename for the CTRF report. If not provided, defaults to ctrf/ctrf-report.json.
-t
, --tool
: Tool name to include in the CTRF report.
-e
, --env
: Environment properties to include in the CTRF report. Accepts multiple properties in the format KEY=value.
Convert a TestNG XML report to the default CTRF report location (ctrf/ctrf-report.json):
npx testng-to-ctrf path/to/testng-results.xml
Convert a Testng XML report to a specified output file:
npx testng-to-ctrf path/to/testng-results.xml -o path/to/output/ctrf-report.json
Convert a Testng XML report and include a tool name in the CTRF report:
npx testng-to-ctrf path/to/testng-results.xml -t ExampleTool
Convert a Testng XML report and include environment properties in the CTRF report:
npx testng-to-ctrf path/to/testng-results.xml -e appName=MyApp buildName=MyBuild
See CTRF schema for possible environment properties
Combine all options in a single command:
testng-to-ctrf path/to/testng-results.xml -o path/to/output/ctrf-report.json -t ExampleTool -e appName=MyApp buildName=MyBuild
CTRF is a universal JSON test report schema that addresses the lack of a standardized format for JSON test reports.
Consistency Across Tools: Different testing tools and frameworks often produce reports in varied formats. CTRF ensures a uniform structure, making it easier to understand and compare reports, regardless of the testing tool used.
Language and Framework Agnostic: It provides a universal reporting schema that works seamlessly with any programming language and testing framework.
Facilitates Better Analysis: With a standardized format, programatically analyzing test outcomes across multiple platforms becomes more straightforward.
We welcome contributions! Please see our Contributing Guidelines for details.
- Clone the repository
- Install dependencies:
yarn install
- Build the project:
yarn build
- Initial release
- Basic TestNG XML to CTRF JSON conversion
- Command-line interface with output and environment options
- Create a GitHub Issue for bug reports and feature requests
This project is licensed under the MIT License - see the LICENSE file for details.