Test using JUnit

Introduction

JUnit is a simple framework for writing repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks.

Automation Hierarchy

Test Cycle

Test Case

Test Step

Automation Hierarchy

Test Cycle

Test Case

Test Step

1 (Default)

 

NA

testsuite> name

Or

testcase > classname

testcase name

2

testsuite > name

If there are multiple test suites in the result file then multiple test cycles will be created based on the suite name.

If the testsuite name is not there in the file, it will take classname as test cycle name.

→ The parameter Test Cycle to Reuse will be ignored in the Automation.

testcase name

NA

3

 

The test cycle name will be created as per the Summary passed by the user. In the absence of the Summary, the test cycle name will be auto-generated.

If there are multiple suites in the result file then only a single cycle will be created.

→ If the value is provided for the Test Cycle to Reuse parameter, then the suite name in the files will be ignored. All the test case results for all suites and files will be uplaoded in a single cycle similar to Hierarchy 1 (default).

testcase name

 

NA

Note: If the Test Name or Test Suite Name length is more than 255 characters, the name will be truncated.

Supported Version: 1.2.5

Supported file types: XML

Sample Test Result File

The following is the screenshot of the file. Click to download the Sample Test Result File.

image-20240717-050927.png

Test Case Reusability

Keyword

Download Sample File

Description

Keyword

Download Sample File

Description

testcasekey

 

 

While importing the test result file, if you want to reuse the test case then it is possible.

  • The mapping of test steps depends on the matchTestSteps parameter.

    • → If the matchTestSteps parameter is set as “True” (Default): Create/Reuse a test case with a summary and test steps that exactly match the automated test case uploaded through the result file. The execution results and other execution details of the test case and steps will be imported from the automation result file.

      • If Test Case Summary and Test Step Summary (for all steps) match with the automated Test Case Name ( testcase classname) and Steps (testcase name), the Test Case Key and version will be reused.

      • If Test Case Summary matches and Test Step Summary do not match (for any of the steps) with the automated Test Case ( testcase classname), Test Case Key will be reused but a new version will be created.

      • If Test Case Summary does not match, a new test case will be created.

    • → If the matchTestSteps parameter is set as “False”:

When the Test Cycle is not been Reused

→ Create/Reuse a test case with a summary or test case key that exactly matches the automated test case uploaded through the result file, and exclude matching of test steps. The execution results of the test case will be imported or calculated based on the test case/step results from the automation result file. The execution result of the test case will be propagated to the test steps in the case of test case reuse/creation. Individual test case steps will not be matched and their execution results/details will not be picked from the result file.

When the Test Cycle is been Reused

→ When the Test Case Key is mapped in the result file and the Test Case Key is found linked to the Test Cycle.

The existing linked test case version, which is part of the Test Cycle will be used. If multiple versions of the same test case key are linked to the test cycle, the one which traced first will be used. The test steps will not be matched to create a new version or link a different version.

→ When the Test Case Key is mapped in the result file and the Test Case Key is not linked to the Test Cycle and the Test Case Key exists in the Test Case Library.

The existing latest version of the test case that matches based on the test case summary will be linked to the existing Test Cycle. If there are multiple test cases with the same summary exist, the one which is traced first will be linked to the existing Test Cycle. The test steps will not be matched to create a new version or link a different version.

→ When the Test Case Key is mapped in the result file and the Test Case Key is not found linked to the Test Cycle and the Test Case Key is not found in the Test Case Library, and the Test Case Summary matches with any existing test cases linked to the Test Cycle.

The existing linked Test Case version which is part of the Test Cycle will be used. The test steps will not be matched to create a new version.

→ The Test Case Key is not mentioned in the result file and the Test Case Summary matches any existing test case that is already linked to the Test Cycle.

The existing linked Test Case version which is part of the Test Cycle will be used based on the summary. The test steps will not be matched to create a new version.

→ When the Test Case Key is mapped in the result file and the Test Case Key does not exist in the Test Cycle OR is Not found in Library and the Test Case Summary also does not match any existing Test case in the Test Cycle and Test Case with the same summary is found in the Test Case Library.

The existing latest version of the test case that matches based on the test case summary will be linked to the existing Test Cycle. If there are multiple test cases with the same summary exist, the one which is traced first will be linked to the existing Test Cycle. The test steps will not be matched to create a new version or link a different version.

→ When the Test Case Key is mapped in the result file and the Test Case Key does not exist in the Test Cycle OR is Not found in Library and the Test Case Summary also does not match any existing Test case in the Test Cycle OR is not found in the Test Case Library.

A new test case without steps will be created and will be linked to the Test Cycle being reused.

The execution results of the test case will be imported or calculated based on the test case/step results from the automation result file. The execution result of the test case will be propagated to the test steps in the case of test case reuse/creation. Individual test case steps will not be matched and their execution results/details will not be picked from the result file.

In a project where propagation is off, the status of step will not be mapped or changed.

  • Multiple test case keys (i.e. testcasekey) can be linked with a single test suite, which will update/create multiple test cases and link these test cases with an automated test suite. Multiple test case keys can be passed in the same tag e.g.

testcasekey="FIT-TC-1 FIT-TC-2 FIT-TC-3"

Link Requirements to Test Case

Keyword

Download Sample File

Description

storykey

 

 

  • Users can auto-link stories with Junit test cases using the keyword "storykey" to specify the entity key in the result file. The specified stories will be linked to the created/reused test case. 

  • Users can also link cross-project stories to the test case.

    • Users should have access to the cross project

    • Users should have the Test Case Edit and Requirement Edit permissions.

  • Multiple “storykey” can be used in the same tag in the file to link multiple stories to the test cases. e.g. 

storykey="FIT-1 FIT-2 FIT-3 FTA-154"