aik099/qa-tools — pull request #25 by aik099 (2014-05-08 20:20:04+00:00)
Title: Implement "WaitingElementLocator"

Right now elements are located using the `DefaultElementLocator` class. This location strategy only finds an element, when it's present at the moment of the search query execution.

This creates a problem in cases, when element isn't immediately available on a page and will only appear after AJAX request finishes. Because of this we need to poll for an element (the `explicit wait` in Selenium terms) for some time and only return it when it appears.

This is what the `AjaxElementLocator` (see https://github.com/yandex-qatools/htmlelements/blob/c0327548a562b7c69c2137c19b69bf983fb93bd5/htmlelements-java/src/main/java/ru/yandex/qatools/htmlelements/pagefactory/AjaxElementLocator.java) does. It waits for 5 seconds max and each 250 milliseconds tried to look for an element. Once it has the element it returns it.

I think that the default timeout should be `0 seconds` (to work as `DefaultElementLocator` by default) and the `@timeout(5)` annotation on the element can be used to set per-element timeout value in the Page/ElementContainer class elements.

Related issue: Behat/Mink#482