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 http://localhost:8080/myApp/home/


Software Development Blogs - BlogCatalog Blog Directory

Popular posts from this blog

How to set up a SQL Server 2008 Local Database

Spring Boot Internationalization with Default Locale for Message Strings

Change Port on a Spring Boot Application when using intelliJ