Test Automation: Seamless Integration of Tools and Frameworks

In this article, I want to give you an overview of how well the latest technologies can be integrated seamlessly into a test automation framework. Test automation is also an integral part of the software development lifecycle, and we want our test automation framework to contain all the latest features with minimal effect.

In this article, we build a sample test automation framework that consists of tools like Spring Boot, Cucumber, Java 8, and Serenity to test a sample Calculator application.

Serenity Ensure – Fluent Assertions in Serenity Screenplay

Assertions are an important part of any test automation framework, and Serenity gives us many options. You can, of course, use standard JUnit, Hamcrest or AssertJ assertions at any point in a Screenplay test. But more recent versions of Serenity Screenplay provide an alternative approach, which many developers find easier to use and faster to write: the serenity-ensure module.

Introducing serenity-ensure

The Ensure class produces a Performable, so you can integrate them directly into the attemptsTo() method. It also has a very readable DSL and lets you use code completion to discover the assertions you can use for different values, making writing assertions easier and quicker.

Getting Started With Serenity BDD and Cucumber 4

Serenity BDD is a library that makes it easier to write high-quality automated acceptance tests, with powerful reporting and living documentation features. It has strong support for both web testing with Selenium, and API testing using RestAssured.

Image titleSerenity strongly encourages good test automation design, and supports several design patterns, including classic Page Objects, the newer Lean Page Objects/Action Classes approach, and the more sophisticated and flexible Screenplay pattern.