7.4. Functional testing of web applications with Spock

The previous section covered functional tests for back-end Java applications that aren’t interactive. This section shows you how to test front-end applications that sport a web interface accessible via the browser.

For these kinds of tests, you need a way to control the browser and replicate the actions (for example, fill forms or click buttons) that a human user typically performs. Spock doesn’t have built-in support for this and instead collaborates with Geb, the Groovy browser automation library.

7.4.1. Browser automation with Geb

Geb is a library that provides a Groovy abstraction on top of the popular Selenium/WebDriver[18] framework for automating a browser. If you’ve worked with Selenium, ...

Get Java Testing with Spock now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.