mozilla/FlightDeck-selenium — pull request #27 by zacc (2011-12-07 12:52:50+00:00)
Title: Repeat search until package is indexed

Two search tests test_search_by_addon_name_returns_addon and test_search_by_library_name_returns_library were failing sporadically with the constant sleep time of 10 seconds.

This is due to the time between package creation and indexing by the search job being dependent upon a queue. Sometimes it can be <10 seconds but other time it can be up to 60 seconds or more. Devs and I considered this was still reasonable UX performance but adding a 60 second sleep into the test was not acceptable as it would lock out the grid node.

Stephen and I did not want to lose or xfail this test coverage as we consider it valuable. This solution is to repeat the search until the timeout value is reached.

I have used dynamic time loop to account for the implicit waits in Webdriver and make sure the timeout limit is adhered to properly.

The method needs to re-load the search page during the while loop to avoid results caching.

I have also addressed:
- https://www.pivotaltracker.com/story/show/19392391 - search_for_term method
- set is_displayed to a property as it should have been.