testng-to-ctrf
v1.0.0
Published
Convert TestNG XML Results to Ctrf JSON
Readme
Convert TestNG Results XML to CTRF JSON
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.
Acknowledgments & Attribution
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.
Usage
npx testng-to-ctrf path/to/testng-results.xmlOptions
-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.
Examples
Convert a TestNG XML report to the default CTRF report location (ctrf/ctrf-report.json):
npx testng-to-ctrf path/to/testng-results.xmlSpecify Output File
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.jsonInclude Tool Name
Convert a Testng XML report and include a tool name in the CTRF report:
npx testng-to-ctrf path/to/testng-results.xml -t ExampleToolInclude Environment Properties
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=MyBuildSee CTRF schema for possible environment properties
Full Command
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=MyBuildWhat is CTRF?
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.
Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Development Setup
- Clone the repository
- Install dependencies:
yarn install - Build the project:
yarn build
Changelog
v1.0.0
- Initial release
- Basic TestNG XML to CTRF JSON conversion
- Command-line interface with output and environment options
Support
- Create a GitHub Issue for bug reports and feature requests
License
This project is licensed under the MIT License - see the LICENSE file for details.
