Skip to main content

Posts

Geb Browser Automation Quick Start for Continuous Integration Linux

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: 58 58 // You usually only need one of these, but this project uses both 59 59 test "org.gebish:geb-spock:$gebVe...

Geb Configuration

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 fields formFields { //Guest donate to a Non-profit Flow: Form field parameters form1 { field1 = "value1" field2 = "value2" } } Then you can reference those form fields in your functional tests that extend GebReportingTest like so: String searchValueParam = browser . config . rawConfig . formFields . form1 . field1 This way you can have custom fields for each form for each functional test. Custom baseUrl You can set a custom baseUrl as a VM parameter using the following 1 -Dgeb.build.baseUrl= http://localhost:8080/app/ This will be the base URL that your pages build their static url off.  For instance your home page object with the static url static url = /home/ Will resolve to h...

Geb Browser Automation Quick Start Windows

How to Stand Up a Geb Sample Application in Windows 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 focuses on using the Chrome browser for testing.  Please update chrome to the most recent version available because chromedriver only works with versions  12.0.712.0  and higher. If you are trying to setup geb on Linux please use the following link instead: Setting up geb on linux 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 Ensure you have Chrome.exe installed in the expected location OS Expected Location of Chrome executable  Linux /usr/bin/google-chrome 1 Mac /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome Windows XP %HOMEPATH%\Local Settings\Application Data\Google\Chrome\A...

Run Forked Tests in Grails on IntelliJ IDEA

How to resolve issues with Running Forked Tests in Grails on IntelliJ IDEA When trying to run test-app on a Grails project in Intellij you may see a error similar to the following: | Error Error running forked test - app : Could not load grails build listener class java . lang . RuntimeException : Could not load grails build listener class at org . codehaus . groovy . grails . cli . support . GrailsBuildEventListener . addGrailsBuildListener ( GrailsBuildEventListener . java : 258 ) at org . codehaus . groovy . grails . cli . support . GrailsBuildEventListener . loadGrailsBuildListeners ( GrailsBuildEventListener . java : 106 ) at org . codehaus . groovy . grails . cli . support . GrailsBuildEventListener . initialize ( GrailsBuildEventListener . java : 73 ) at org . codehaus . groovy . grails . cli . fork . ForkedGrailsProjectClassExecutor . createEventListener ( ForkedGrailsProjectClassExecutor . groovy : 102 ) at org . codehaus . groo...