'Waits until the given `condition` is true or `timeout` expires.
The `condition` can be arbitrary JavaScript expression but must contain a
return statement (with the value to be returned) at the end.
See `Execute JavaScript` for information about accessing the
actual contents of the window through JavaScript.
`error` can be used to override the default error message.
See `introduction` for more information about `timeout` and its
default value.
See also `Wait Until Page Contains`, `Wait Until Page Contains
Element`, `Wait Until Element Is Visible` and BuiltIn keyword
`Wait Until Keyword Succeeds`.'

@keyword
def wait_for_condition(self, condition, timeout=None, error=None):

    if (not error):
        error = ("Condition    '%s'    did    not    become    true    in    <TIMEOUT>" % condition)
    self._wait_until(timeout, error, (lambda : (self.browser.execute_script(condition) is True)))
