Posts

Showing posts from April, 2014

Geb Browser Automation Quick Start for Continuous Integration Linux

Image
How to Stand Up a Geb Sample Application On a CI Server(Continuous Integration) Linux
This guide will show you step-by-step how to setup a simple Geb app to get started using the automated testing framework.

This guide is intended for setting up automated browser tests on a Linux continuous integration server that is command line only with no UI enabled.

This guide focuses on using a headless browser for testing.


If you are trying to setup Geb on Windows instead please use the following link:

Setup Geb on Windows

Pull a copy of the Geb Sample App
 First, pull the Geb sample application from Github:

https://github.com/geb/geb-example-grails


HTTPS Clone URL:
https://github.com/geb/geb-example-grails.git



Add the GhostDriver library to your grails app
Add the following line to your BuildConfig.groovy:






5858 // You usually only need one of these, but this project uses both5959 test "org.gebish:geb-spock:$gebVersion"

Geb Configuration

Image
Geb Configuration Tips

Setting up parameterized form fields
Place the GebConfig.groovy in your test/functional  folder


Then you add a block of code similar to the following:


//Values for form fieldsformFields {//Guest donate to a Non-profit Flow: Form field parametersform1{field1="value1"field2="value2"}}Then you can reference those form fields in your functional tests that extend GebReportingTest like so:




StringsearchValueParam=browser.config.rawConfig.formFields.form1.field1

This way you can have custom fields for each form for each functional test.



Custom baseUrlYou can set a custom baseUrl as a VM parameter using the following


1