Global toWait?

37 views
Skip to first unread message

Trey Turner

unread,
Apr 1, 2020, 9:09:24 PM4/1/20
to Geb User Mailing List
Hi there,
I had assumed that a content element declared with a (to:PageName) parameter would use the target page's (or default) atCheckWaiting value, but it seems I must also specify the toWait in each case. Is there any way to specify a global toWait? The need for this is pervasive in my complex SPA.

Thanks,
Trey

Alexander Kriegisch

unread,
Apr 2, 2020, 12:30:37 AM4/2/20
to geb-...@googlegroups.com
Have you tried setting it in GebConfig.groovy?

https://gebish.org/manual/current/#template-options-default-values

--
Alexander Kriegisch
https://scrum-master.de

Marcin Erdmann

unread,
Apr 2, 2020, 2:40:46 AM4/2/20
to geb-...@googlegroups.com
Hi Trey,

What makes you believe that the value for atCheckWaiting of a page is ignored when using it as an argument for to: configuration option of a content template? Are you seeing at check failures that do not contain WaitTimeoutException in the stacktrace? From what I can see in the code atCheckWaiting setting for a page will not be ignored in that case which makes me wonder why you believe it is.

Marcin

--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/c863c7b9-70d3-4f4e-bd57-14cfe2d2a4b8%40googlegroups.com.

Trey Turner

unread,
Apr 2, 2020, 11:37:53 AM4/2/20
to geb-...@googlegroups.com
Hi Marcin,
Here's the stack thrown without the toWait defined using Geb 3.3. I don't see the WaitTimeoutException. This at-check passes if I add the toWait.

At checker page verification failed for page net.kapsch.roms.qa.ui.page.ServiceIssues
geb.error.UnexpectedPageException: At checker page verification failed for page net.kapsch.roms.qa.ui.page.ServiceIssues
at geb.navigator.DefaultNavigator.click(DefaultNavigator.groovy:705)
at geb.navigator.DefaultNavigator.click(DefaultNavigator.groovy:682)
at geb.Module.click(Module.groovy:186)
at geb.content.TemplateDerivedPageContent.click(TemplateDerivedPageContent.groovy:83)
at net.kapsch.roms.qa.ui.spec.home.HomeSpec.should be able to open the service issues tab(HomeSpec.groovy:24)
Caused by: geb.error.RequiredPageContentNotPresent: The required page content 'net.kapsch.roms.qa.ui.page.ServiceIssues -> toolbar: net.kapsch.roms.qa.ui.module.service_issues.Toolbar' is not present
at geb.content.TemplateDerivedPageContent.require(TemplateDerivedPageContent.groovy:64)
at geb.content.PageContentTemplate.create_closure1(PageContentTemplate.groovy:63)
at geb.content.PageContentTemplate.create_closure1(PageContentTemplate.groovy)
at geb.content.PageContentTemplate.create(PageContentTemplate.groovy:87)
at geb.content.PageContentTemplate.get(PageContentTemplate.groovy:54)
at geb.content.DefaultPageContentSupport.getContent(DefaultPageContentSupport.groovy:42)
at geb.content.PageContentSupport.propertyMissing(PageContentSupport.groovy:41)
at geb.Page.propertyMissing(Page.groovy:110)
at groovy.lang.Closure.getPropertyTryThese(Closure.java:313)
at groovy.lang.Closure.getPropertyDelegateFirst(Closure.java:303)
at groovy.lang.Closure.getProperty(Closure.java:288)
at net.kapsch.roms.qa.ui.page.ServiceIssues._clinit__closure1(ServiceIssues.groovy:15)
at net.kapsch.roms.qa.ui.page.ServiceIssues._clinit__closure1(ServiceIssues.groovy)
at geb.waiting.PotentiallyWaitingExecutor.execute(PotentiallyWaitingExecutor.groovy:30)
at geb.Page.verifyThisPageAtOnly(Page.groovy:420)
at geb.Page.getAtVerificationResult(Page.groovy:213)
at geb.Page.verifyAt(Page.groovy:184)
at geb.Browser.methodMissing(Browser.groovy:254)
at geb.navigator.DefaultNavigator.click_closure46(DefaultNavigator.groovy:694)
at geb.navigator.DefaultNavigator.click_closure46(DefaultNavigator.groovy)
at geb.waiting.PotentiallyWaitingExecutor.execute(PotentiallyWaitingExecutor.groovy:30)
at geb.navigator.DefaultNavigator.click(DefaultNavigator.groovy:694)
... 4 more

Thanks,
Trey

You received this message because you are subscribed to a topic in the Google Groups "Geb User Mailing List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/geb-user/W22zGGhLzxM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to geb-user+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/CA%2B52dQTtXDZmjinP2rDokeC-7n0VSyO8KX1tit4j4Ng5drxBdQ%40mail.gmail.com.

Trey Turner

unread,
Apr 2, 2020, 11:40:55 AM4/2/20
to geb-...@googlegroups.com
Ah, to clarify, it seems to pass when I add the page-specific atCheckWaiting, but it does not seem to apply the global atCheckWaiting value from GebConfig.groovy. Is this possibly correct?

Marcin Erdmann

unread,
Apr 2, 2020, 1:49:16 PM4/2/20
to geb-...@googlegroups.com
From looking at the code it should be honouring global atCheckWaiting. Are you sure you've configured it correctly? I don't think that we have a specific test for your case but it won't be a big deal to add it. Please double check for me that you have configured global atCheckWaiting correctly before I start adding it, though.

Trey Turner

unread,
Apr 2, 2020, 2:04:20 PM4/2/20
to geb-...@googlegroups.com
Does it not go within the waiting block? :/ I assumed it was working because it seems to be properly handled when I go 'to' a page within a spec. Apologies if I've got this wrong.

waiting {

    // Implicitly wait for at-checks to complete
    atCheckWaiting = true

    //default (ie. wait:true)
    timeout = 8
    retryInterval = 0.5

    presets {
        shortest {
            timeout = 2
            retryInterval = 0.25
        }
        shorter {
            timeout = 4
            retryInterval = 0.25
        }
        longer {
            timeout = 16
            retryInterval = 0.5
        }
        longest {
            timeout = 32
            retryInterval = 0.5
        }
        coffee {
            timeout = 192
            retryInterval = 1
        }
    }
}

Trey Turner

unread,
Apr 2, 2020, 2:15:17 PM4/2/20
to geb-...@googlegroups.com
Hi Alexander,
I just wanted to add I had a misunderstanding of what you meant; I thought you were asking if atCheckWaiting was set in GebConfig, which it was (correctly, I hope!) - I now see that this is exactly the solution to the question I was posing. Now to see if it's really needed based on the rest of the thread. Thank you!

-Trey

--
You received this message because you are subscribed to a topic in the Google Groups "Geb User Mailing List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/geb-user/W22zGGhLzxM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to geb-user+u...@googlegroups.com.

Marcin Erdmann

unread,
Apr 5, 2020, 4:06:42 PM4/5/20
to geb-...@googlegroups.com
Hi Trey,

Unfortunately, you did not configure it correctly. As per the docs, atCheckWaiting configuration goes at the top level of GebConfig: https://gebish.org/manual/current/#at-check-waiting.

FWIW, I've also added a test which confirms that atCheckWaiting global config applies when clicking on content with "to" option specified: https://github.com/geb/geb/commit/48d696bfb28c5d90181805218a43f091fd1b3094. It fails if the `config.atCheckWaiting` line is commented out.

Cheers,
Marcin

Trey Turner

unread,
Apr 5, 2020, 5:21:50 PM4/5/20
to geb-...@googlegroups.com
Thank you Marcin, I've got it correctly configured now. I'm surprised I made it this far without tripping over that misconfiguration. Thanks also for the test.

Regards,
Trey

Reply all
Reply to author
Forward
0 new messages