UI Automation with Geb & Spock (Part 1)

Maven, Groovy, Selenium, IntelliJ

Software Development & Testing Blog

I've recently moved on from a .Net software developer role have started working with Java. A recent project requirement for the creation of a testing framework from scratch led to my discovery of the groovy based Geb wrapper (pronounced jeb) and the Spock framework.

Geb is described as "bringing together the power of WebDriver, the elegance of jQuery content selection, the robustness of Page Object modelling and the expressiveness of the Groovy language".

Geb is a wrapper for the Selenium WebDriver API and works incredibly well with the testing and specification framework Spock. Being from a .Net background I had never used things like Java (although it feels very familiar), Maven, POM files, etc. so in this series of blog posts I will guide you through the set up process and build a specification based automated testing framework from scratch using Geb, Spock, Maven and the IntelliJ IDE.

You may now have to import all the dependencies we've just added. You can do this in IntelliJ by pressing Ctrl-Shift-A to bring up the Action window, then typing reimport and selecting Reimport All Maven Projects:

That's it for Part 1 - We're now ready to start modelling some pages and creating some tests!