Integration tests, part 2 (notes on Cucumber and Selenium)

(This is part 2, some learnings a few weeks into the project described here: Integration tests = secucbootCucumber + Selenium + Spring Boot)

Selenium tricks:

Use the fluent wait instead of anything else, like here waiting for the expected messages to appear. Continue reading

Integration tests = Cucumber + Selenium + Spring Boot

Let’s say you had this web application with nice unit tests covering the backend calculations, where people keep calling wrong calculations from the frontend. Microservices or not, it happens, so you’ll need proper integration testing. Let’s say the integration testing is a well documented but tedious two days job of clicking around. Understandably, everybody does their best to avoid it…

My answer was: how about we rewrite the integration test scenarios in the Gherkin almost-human-readable language, so we can use Cucumber to run them automated, simulating with Selenium the user browser actions! The supporting stack will be Java and Spring, actually Spring Boot, because you know all I have is a hammer….

Continue reading