Hi!
In our company we have a reasonably large suite of acceptance tests (several hundred tests) written in Geb. Currently, we're using Geb 0.10.0, Selenium 2.46.0 and Firefox (both local and remote).
The problem appears when we try to upgrade our dependencies. Namely, I try to upgrade Geb to the newest 0.13.1 without touching other dependencies.
It looks like WebDriver starts to act way more eager than before, throwing away some previously existing waits. This causes our tests to fail in many random places unless we put a lot of waitFor into it. For example, when working with dialogs:
// Works fine with Geb 0.10.0, but not in the any newer version
browser.withNewWindow({ someButton.click() }) {
$('input#title').value(title)
...
}
After upgrading to the newer versions this code may fail because WebDriver may start to act on the dialog before page actually loads. When I put simple assert !$('body').empty into the beggining of the window closure, it fails randomly (but never fails in Geb 0.10.0). So, in order to fix our tests we have to add a lot of waits, like that one:
browser.withNewWindow({ someButton.click() }) {
waitFor { $('input#title').displayed } // or, for example, waitFor{ !$('body').empty }
$('input#title').value(title)
...
}
But we have a lot of dialogs in our system under test, so amount of code to change is really large. That's pity.
Situation is a little more strange because I cannot reproduce this problem in virto. When I just save HTML page of our application and run it under Python SimpleHTTPServer, synchronisation issue on the dialog disappears. But in our application (Spring web app running under Tomcat) such failures appear very frequently.
Seems like we have to stay on 0.10.0 for now, but it's unclear for me whether the situation with waits will change in future. It's also unclear whether it's a bug of Geb or not.
May I ask you for help?