Search code examples
testingspockgeb

Can I use Spock and Geb without Grails or Gradle or anything else?


I'm a QA and I want to use Spock + Geb for my testing. As I understand I have to setup grails (or gradle, or something like that) to use Spock + Geb. Or Grails is not required? In this case what is the minimal set of programs that I need to install to successfully test any application? Where I need to write test and how to run it? Sorry for such stupid questions, but all this stuff is new for me and I don't really understand how it works.


Solution

  • The Grails web framework isn't required at all, unless the web app you are testing is written in Grails.

    The Gradle build tool isn't necessarily required, but then you don't want to manually download Spock and Geb, manually compile the tests, manually run the tests, or manually set up an IDE. A build tool can automate all of this, and if you aren't using one already, Gradle is the easiest choice.

    The Geb Manual explains how to set up a Gradle build for Spock+Geb and links to a fully working example project. Cloning this project (or downloading the zip) will get you started quickly. You don't even have to install Gradle, but can just run it via the gradlew (*nix) or gradlew.bat (Windows) script (for example gradlew test).