Importing JUnit XML into QAlity Plus Advanced Edition

Description of Junit XML attributes used by advanced edition of QAlity Plus

 

image-20241212-123031.png
JUnit XML Simplified Schema*

 

*The test suites element is not required as a root element in all frameworks.

Supported elements for test execution import in QAlity Plus Advanced Edition

Since we want to support multiple formats from different frameworks, we only require the fields that are most common across all of them. Below is a brief description of the elements required by QAality to properly import your test executions.

Element

Supported attributes & children

Element

Supported attributes & children

<testsuite> … <testsuite>

CHILDREN: <testcase>(*required), <properties>(optional)

<testcase> … <testcase>

ATTRIBUTES: name(optional), classname(optional)

CHILDREN: <failure>(optional), <error>(optional), <skipped>(optional), <properties>(optional)

<properties>…

</properties>

CHILDREN: <property>(optional)

<property>…

</property>

ATTRIBUTES: name(*required), value (*required)

<failure>…

</failure>

ATTRIBUTES: message(optional)

<error>…

</error>

ATTRIBUTES: message(optional)

<skipped>…

</skipped>

If present we skip the test case.

 

Mapping JUnit XML <testcase> to TestExecution in QAlity Plus Advanced Edition

 

Execution status and description:

If the <testcase> element contained <error> or <failure> element we set the status to the first status in the "FAILED" category.

We set the ‘Execution Comment’ to contain the contents of either the error or failure element or, if neither is present, their message attributes.
Otherwise, we set the status to the first status in the "PASSED" category.

We omit test cases from the results if they contain skipped elements.

Test name to QAlity test issue summary:

In QAlity Plus Advanced Edition, the test case name attribute is directly mapped to the QAlity test issue summary. This mapping process relies on the identification of tests by their name and classname attribute. If a test’s name or its classname is modified, it is considered a distinct test case execution within advanced edition of QAlity Plus.

To maintain the continuity of test executions across changes, you can associate a <property> with each test case by including:

<property name="issue-key" value="ABC-123"/>

By attaching this property, QAlity Plus Advanced Edition will consistently map the test execution to the specified Jira issue, regardless of changes to the test’s name or classname attribute. This approach ensures that tests remain linked to their respective Jira issues, preserving the context of test executions across modifications.

 

Understanding the shouldCreateMissingTestCases flag

The shouldCreateMissingTestCases flag controls how QAlity Plus Advanced Edition handles test cases that do not yet exist in your system, the default value of this flag is ‘false’. Here’s how it works:

  1. When shouldCreateMissingTestCases is true:

    • It will automatically generate new test cases for any test execution that does not already have a corresponding test case.

    • This ensures that all test executions are linked to their own test cases, even if they were not pre-defined in your system.

    • Disclaimer: the first execution with this flag set to true may take longer than usual, as it needs to create all the missing test cases (issues) in your system. For example, creating 100 cases may take approximately 45 seconds.

  2. When shouldCreateMissingTestCases is false:

    • It will not create new test cases.

    • Instead, it will only map test executions to existing test cases based on their test case identifiers or associated properties (such as <property name="issue-key" value="ABC-123"/>).

    • Any test executions that do not match existing test cases will not be recorded.

    • IMPORTANT! You won’t be able to import data if one or more test cases cannot be associated with an already existing test case in your project.

This flag provides flexibility for managing test case creation, depending on whether you want to allow automatic generation or strictly control the mapping to pre-existing test cases.

 

Learn more about import test executions endpoint: https://apps-qalityplus.soldevelo.com/swagger-ui/index.html#/

Â