Chapter Contents


1 Introduction

Gaelyk Functional Test Tools is a set of helpers to make functional testing of Gaelyk applications easier. This is just some code that seemed common enough to be extracted as a separate library which got written while working on my blog that is written using Gaelyk.

Currently the library provides:

1.1 Project setup

This section assumes that you are using Gradle and gradle-gaelyk-plugin version 0.4 or newer to build your project.

1.1.1 Dependency on gaelyk-functional-test

The first step to use the library is to add a dependency on it to functionalTestCompile configuration:

dependencies {
    functionalTestCompile 'org.gaelyk:gaelyk-functional-test:0.2'
}

1.1.2 Setting up remote control endpoint

The library depends on a gaelyk-remote endpoint to be exposed at a specific url. To configure that you have to first add a runtime dependency on gaelyk-remote:

dependencies {
    runtime 'org.gaelyk:gaelyk-remote:0.1'
}

and also add a servlet mapping to your web.xml file:

<servlet>
    <servlet-name>RemoteControlServlet</servlet-name>
    <servlet-class>groovyx.gaelyk.remote.RemoteControlServlet</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>RemoteControlServlet</servlet-name>
    <url-pattern>/remote-control</url-pattern>
</servlet-mapping>

If you wish to expose gaelyk-remote servlet at different url you will need to override the default remote control url for the custom RemoteControl class delivered by the library

The custom RemoteControl class uses Geb's baseUrl configuration property to determine the base url of the gaelyk-remote servlet. The easiest way to configure that property is to apply gradle-gae-geb-plugin to the project:

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath "org.gradle.api.plugins:gradle-gae-geb-plugin:0.3"
    }
}

apply plugin: 'gae-geb'

1.1.3 Dependency on gaelyk-functional-test-datastore-builder

If you wish to use the DSL for setting up data in the datastore you also have to add a runtime dependency on datastore builder:

dependencies {
    runtime 'org.gaelyk:gaelyk-functional-test-datastore-builder:0.2'
}

1.2 Dependencies

The library integrates Gaelyk with gaelyk-remote, Spock and Geb. Currently it brings the following versions of the aforementioned tools into dependencies:

The library is simple enough to assume that newer versions of those dependencies should still work. Just simply specify them in your build.gradle and they will overwrite the ones specified in the library - by default the newest version of the dependency is used by Gradle if there is a conflict.


Gaelyk Functional Test Tools Documentation - 0.2 - December, 2012
Licensed under the Apache License, Version 2.0