yui/yui3 — pull request #1263 by lsmith (2013-10-03 01:00:36+00:00)
Title: Add waitFor() method to TestCase

Inspired by work done by @julesanchez in #1037 (hat tip!).

Adds a `waitFor(conditionFn, validationFn, [msTimeout], [msIncrement])` to TestCase instances akin to the `wait()` method, but checks against a `conditionFn` frequently to see if the function making assertions (`validationFn`) can be run. This function avoids the need to set long timeouts, guessing that "X should be done by now" as well as copying the same iterative conditional boilerplate into each test.

Includes test coverage and API docs, but no user guide entry for the method.

While I was in TestCase, I cleaned up a little bit, too. Beyond the scope of this PR, but hopefully not so much so that I'll need to back that bit out.