Importing TestNG/JUnit
If you have existing TestNG/JUnit you can now import them and use RedwoodHQ for their execution and results tracking. This can be a very useful feature since the framework allows for execution and results tracking of ANY Java/GROOVY code (API, REST/SOAP, etc.) or tool (Selenium, Appium, etc.).
Upload TestNG/JUnit Files
Before Importing test cases we first need to upload all the script files which contain all the code. In this example we’ll be using sample TestNG test cases which can be downloaded here: AmazonTests After you download the sample zip file make sure to unzip it in to any folder you want afterwards.
- Click on Scripts tab
- Expand ‘src’ folder in left pane
- Right click on ‘src’ folder, select New -> Upload Directories
- On a new popup screen navigate to folder where you have unzipped sample test cases to
- Left click on ‘AmazonTests’ folder and click on Open button
- Click ‘OK’ button for ‘Files have been uploaded.’ message box
- All files and folders are now uploaded in to RedwoodHQ
- Click on ‘Git Push’ button so that all users will be able to use these scripts
Import TestNG/JUnit Test Cases
Now that you have uploaded your script files we need to make sure that Test Case entries exist for each @Test method so they can be executed as part of Execution.
- Click on ‘Import Test Cases’ button
- On a ‘Select Test Cases to Import’ popup check the check-boxes for all tests and click on OK
- Click ‘OK’ button for ‘Imported 3 test cases.’
- Click on Test Cases tab
- You will now see all the test cases that were imported from newly uploaded files with names generated based on this pattern (which can be modified after import):
<Package>.<Class Name>.<Method>
- Create a new test set and execution to run the new test cases
Execution from Script page
TestNG and JUnit tests can also be executed right in the Scripts IDE page that will run the script right on current client machine (make sure you have Agent installed on it). This can be very useful for creating/doing modifications to a script and then running a quick validation of it without running through Execution.
- Click on Scripts tab
- Expand ‘src’ folder in left pane
- Expand ‘AmazonTests’ folder
- Double click on ‘ProductSearching.java’
- Click on ‘Run TestNG/JUnit Test Case in opened script’ button (green play arrow)
- Check the check-box for ‘AmazonTests.ProductSearching.LordofTheRingsSearchSelenium’ test (only one can be selected at a time)
- Click on ‘OK’ button
- Test case runs through and the following result appears on the bottom ‘Output’ pane:
Starting Test…
[TestNG] Running: Command line suite
=========================================== Command line suite Total tests run: 1, Failures: 0, Skips: 0 ===========================================
Test Passed
Post your comment on this topic.
Sunny wrote: Nov 4, 2016
Finally, my team member has just submitted a complete working code of RedwoodHQ integration with Appium for mobile functional test automation.
We call it Wheat.
Here is the link .. https://github.com/Talentica/Wheat