JUnit XML Format Support

Test management XML support for JUnit (JUnit), Python (Pytest), Minitest (Ruby), and PHPUnit (PHP). Also, this testing tool will not only create a run report but also collect all information about tests, including source code, and create tests in a system.

Test management tool testomat.io supports the JUnit test reporter by using the JUnit XML file of your test runner. This is one way to easily integrate your automated tests with test management. The output will be represented by importing all tests to the tree project, namely the content of test suites. Using this you can generate informative HTML reports with rich analytics for the needs of your Agile team and business purposes through our test management solution.

What is JUnit?

JUnit is a popular open-source testing framework, it is used to write and run repeatable automated tests. Yeah, it is for Java language mostly focused and on unit testing but that can also be used for integration testing, regression testing, API testing and e2e testing, making use of other libraries such as Selenium. JUnit testing framework is evolving every time. And now JUnit is a popular testing tool not only among Java community. Its XML test result reports have become a de facto standard for test result reporting.

The JUnit testing framework introduces an XML file format to report on the test suite execution. JUnit XML results format is standard among test runners on various platforms.

JUnit vs XML format

Since JUnit XML results format is standard among test runners on various platforms. JUnit XML reports may be created by many different testing frameworks for Java, JavaScript, Ruby, Python, or any other language. For instance, within going an SDLC, these XML files can be processed by programs like Jenkins with the JUnit plugin to display the results of the tests. Continuous integration system like TravisCI as well. Or your testing tool like PHPUnit framework, Selenium, Jest, Mocha etc. Just transform your test results into JUnit XML format.

Note, there is no official spec XML schema, so sometimes it is a little tricky to nail down the right format for integrating it with other testing tools. So, imported data will differ within different frameworks, the appearance will be a little different in the tree structure.

Our tests are contained in a package named XML test, so we need to explicitly declare the package name in the test. Output can be in either text or XML format. The advantage of receiving output in XML is that it allows you to generate aggregate reports in the end.

Test management JUnit integration

Once your results are transformed. After you’ve imported an XML file from your testing tool. shell script that compiles the code, runs tests and pushes the code into Testomatio

You can see how the JUnit XML file views in our test management solution. Now to write the code that takes those results and put them in testomatio. You can find that code in .java

Our solution can load XML reports from test runners and create tests in a project from it. If your framework is not supported yet by our test management, generate JUnit report and upload it into testomat.io

Testomat.io will not only create a run report but also collect all information about tests, including source code, and create tests in a system as regular importer do. The only difference that normal process of Testomat.io import does not require executing tests on import, while importing via repoter requires to have tests executed and XML report provided.

Via JUnit reports testomatio officially supports such frameworks and languages as:

  • JUnit (JUnit)
  • Python (Pytest)
  • Minitest (Ruby)
  • PHPUnit (PHP)

How do I create a test report with JUnit testomatio test management?

At this point we have a mechanism to run our JUnit tests and get output that connects the test case number to the test

Taking advantage of JUnit XML reports

  1. The main advantage of the JUnit framework is it’s universal. It allows integration of your testing with our test management solution if your framework is not yet supported.
  2. You are able to collect mixed tests in one place. Manual tests, automated tests, a few testing frameworks used in different programming languages and map them from your code to Jira
  3. Track all tests’ visibility and traceability through informative reports and analytics.