-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Hi I have this strange behavior when I call loginPage.loginButton.click()
class LoginPage extends BasePage {
static content = {
loginButton(to: [HomePage, MtanPage], toWait: true) { $(name: 'login') }
}
}
class MtanPage extends BasePage {
static at = { submitButton.displayed }
static content = {
submitButton { $('input', value: 'Bestätigen') }
}
}
class HomePage extends MailerBasePage {
static at = { $('p.intro-welcome').text() ==~ /.*Guten Tag.*/ }
}It first checks the unexpected pages, with a FIND element call each,
then it retries the FIND for p.intro-welcome 196 times and then it
checks the second page FIND input[value=Bestätigen] and succeeds.
GebConfig.groovy
waiting {
timeout = 30 + timeoutAddition
}
// Since SauceLabs is slower we need to enable atCheck waiting globally
atCheckWaiting = true
My guess is that, atCheckWaiting is performed for each Page in the to List individually.
IMHO at geb.Browser:1074
AtVerificationResult atVerificationResult = it.atVerificationResult should be
AtVerificationResult atVerificationResult = it.getAtVerificationResult(false)
And the global wait should be performed for the whole list, by
geb.navigator.DefaultNavigator#click(java.util.List, geb.waiting.Wait) instead. This issue gets worse with more entries in the list.
Furthermore, the unexpected pages should only be checked after the expected pages did not match, to be in line with the changes of apache/groovy-geb#127.