A basic example of using geb functional testing from a brand new grails project using bonigarcia's Web Driver Manager to setup chrome, phantom and ie browsers.
run grails -Dgeb.env=chrome test-app
to see it in action. see below for other browser options.
Follow below step to do configuration
testCompile "org.grails:grails-plugin-testing" testCompile "org.grails.plugins:geb" // Note: It is recommended to update to a more robust driver (Chrome, Firefox etc.) testRuntime 'org.seleniumhq.selenium:selenium-htmlunit-driver:2.44.0'
//GEB testCompile "org.seleniumhq.selenium:selenium-java:3.4.0" testCompile("com.codeborne:phantomjsdriver:1.4.3") { transitive = false } testCompile "io.github.bonigarcia:webdrivermanager:1.4.9"
grails create-functional-test geb.FaceBook
grails test-app --integration
integrationTest { systemProperties System.properties }
Environments setup for
- phantom -
-Dgeb.env=phantom test-app
- chrome -
-Dgeb.env=chrome test-app