How to Implement BDD Test Automation Framework: Cucumber, RestAssured, Selenium and ExtentReports (1/7)
This article starts the series of tutorials which share my experience in implementation of test automation frameworks.
DISCLAIMER 1: Presented implementation is far from the Best Practices, but works for me and my team very good for a long time across different projects.
DISCLAIMER 2: These articles are not BDD, Selenium, RestAssured or Cucumber tutorials, however, links to the related documentation pages are added. The scope of these articles is how to combine all these tools into the one working solution for the test automation execution.
Together we will build test automation framework from the scratch. We will use Java programming language, Gherkin for the test cases definition, implement API and Web automated tests, reporting to the HTML file and integrate the tool with the CI pipeline (Azure DevOps).
The final version of the framework is stored here. Check branches to find a code from each article.
If you have any questions or improvement suggestions, do not hesitate to write a comment or contact me.
Test automation framework structure
The framework will be divided into three level:
1. Test Cases
2. Page Objects
On a Test Cases level, tester designee test cases using predefined methods from a Page Object level. As a result, test cases written in a business language, fully understandable for each person in a project.
Page Object level uses Clients from a level below to implement methods, which cover all business processes for the test and provides this method for the Test Cases level.
Clients level implements protocol communication (API, AMQP, Browser Communication) and provide high level interface for the Page Object.
For example, Client level can provide methods like that:
• extecuteGetRequest(String url)
• openUrlInBrowser(String url)
• getAllEventsFromQueue(String queueName)
As a Web and an API clients we will use Selenium and RestAssured libraries accordingly.
With the next 7 articles (you almost finished the first one) we will:
1. Describe test automation framework,
2. Create maven application with the Cucumber support,
3. Implement Selenium automated tests,
4. Implement API automated tests,
5. Add listeners support,
6. Add reporting to the HTML and log files,
7. Integrate framework with the CI pipeline.