In this tutorial, we will create a JUnit Test Case in Java, using the Appium library for automation of Windows applications.
The following automated test class validates the "Calculator" Windows native application using several methods (i.e., Tests) for validating each arithmetic operation.
This example is taken from the public Github repository https://github.com/Microsoft/WinAppDriver/tree/master/Samples/Java/CalculatorTest. It also provides examples for other languages.
- WinAppDriver must be running in the destination machine (i.e., the one having Windows and the "Calculator" application), or the Appium Desktop.
We will make a simple update to the pom.xml file in order to generate a JUnit xml report.
The class implementing the automated tests needs to be updated in order to properly set up the IP of the Appium server.
Tests can be run using Maven.
After successfully running the Test cases and generating the JUnit XML report (e.g., TEST-CalculatorTest.xml), it can be imported to Xray (either by the REST API or through the Import Execution Results action within the Test Execution).
Each JUnit's Test Case is mapped to a Generic Test in Jira, and the Generic Test Definition field contains the name of the class and the method name that implements the Test Case.
The Execution Details of the Generic Test contains information about the Test Suite, which in this case corresponds to the Test Case class.