Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Geb DB test helpers
abstract class MyBaseGebTest extends GebReportingTest {
SessionFactory sessionFactory = ApplicationHolder.application.mainContext.sessionFactory
def inTransaction(closure) {
inNewSession {
def inNewSession(closure) {
// GORM class is arbitrary, I just picked one of ours
MyModelClass.withNewSession { session ->

Do you have the configuration for Spring injection ? Also, how do you use this in your child classes. Say for example need to do verification of webpage elements values are reflecting a DB table values (filter based on a combo / input / radio ), do you have a piece of code to illustrate the same ? Thanks a lot in advance, by the way only one post I could find integrating DB with GEB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.