Quite pleased with my short time with
Geb (a
groovy browser automation solution.) All 76 permutations of form filling now automated!! (took about 2 hours.) Now integration testing is going to be a breeze.
I used this short gradle script:
apply plugin: 'groovy'
apply plugin: 'idea'
repositories {
mavenRepo urls: ["http://repo1.maven.org/maven2"]
mavenCentral()
}
dependencies {
groovy group: 'org.codehaus.groovy', name: 'groovy', version: '1.7.5'
compile "org.codehaus.geb:geb-core:latest.release",
"org.seleniumhq.selenium:selenium-firefox-driver:latest.release"
testCompile 'junit:junit:4.7'
}
task(console, dependsOn: 'classes', type: JavaExec) {
main = 'groovy.ui.Console'
classpath = sourceSets.main.runtimeClasspath
}
Which lets you bring up a groovy console to test out groovy/geb code. Like so
$ gradle console
And then noodle with a script until it's ready to be knighted as a unit test....
import geb.*
import org.openqa.selenium.firefox.FirefoxDriver
Browser.drive( new FirefoxDriver(), "http://google.com" ){
go()
assert title == "Google"
$("input", name: "q").value("wikipedia")
$("input", value: "Google Search").click()
}
Extra sweet!!