'Waits until given element contains `text`.
Fails if `timeout` expires before the text appears on given element. See
`introduction` for more information about `timeout` and its
default value.
`error` can be used to override the default error message.
See also `Wait Until Page Contains`, `Wait Until Page Contains Element`, `Wait For Condition`,
`Wait Until Element Is Visible` and BuiltIn keyword `Wait Until
Keyword Succeeds`.'

@keyword
def wait_until_element_contains(self, locator, text, timeout=None, error=None):

    element = self.find_element(locator)
    def check_text():
        actual = element.text
        if (text in actual):
            return
        else:
            return (error or ("Text    '%s'    did    not    appear    in    %s    to    element    '%s'.    Its    text    was    '%s'." % (text, self._format_timeout(timeout), locator, actual)))
    self._wait_until_no_error(timeout, check_text)
