As a team, we are always striving to have better integration of our all test results in one centralized place. The QA Touch team provided the sample snippet for Selenium with TestNG with a sample project. But in our organization, we have a test automation environment with Selenium, Java, BDD, and Junit framework. So, we extended that and updated it to be compatible with the BDD cucumber framework. I wanted to share my journey with the QA Touch community, so everyone who is using this automation setup will benefit.
Let us see an example of how you can set it up.
Setting up the Automation Code
Make a note that this article is written in mind that the Selenium and Test Automation environment is already available. We are going to see how to set up the syncing of test results of the sample automation project, Selenium, Cucumber BDD, and Junit framework to QA Touch. Note that the screenshots and the execution steps mentioned in the article are based on IntelliJ IDE.
Download the sample project from the Github repository from Selenium Java – BDD – QA Touch Integration Sample and import it into your test automation environment. Execute as a Scenario to confirm the test is executed without any errors because of the environment changes.
Recommended Read: Selenium With Python Tutorial
Sync Test Results from Java Selenium BDD to QA Touch
Next, we are going to see about setting up the synchronization of the test results process. The steps are below:
- Login in QA Touch.
- Click the Project in which you want to sync the test automation results.
- Create a test run for the test automation execution.
- In this sample project, we have a single test case. Add the test case code from QA Touch. For example, it is TC0001. The below screenshot shows this.
5. Go to your sample test automation project, open the feature file, update the method name under Scenario: TC0001_Google Search and Save it. The snippet will look like below:
6. Set up the project folder structure like the screenshot below:
7. Access the QA Touch application and get the details from the Test run – config popup.
8. Configure the data API token, and domain name in the file QAtouchAPIClient.java as shown below:
9. Update the project and test run ID details in the Hooks.java file.
10. Run the Test in the Feature file with the Run Scenario option as below screenshot.
11. The execution log is below:
12. Go to the test run in QA Touch to see the test results. The test result snapshot after the update.
I hope this blog helps to understand how can we automate the test run result sync
process by leveraging QA Touch API for Java Cucumber BDD test results.
Feel free to reach out to the team at firstname.lastname@example.org for new feature requests.