Embed URL


SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Geb DB test helpers

View MyBaseGebTest.groovy
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
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.