pages/wait/wait.py
def until_traits_are_present(self, element_with_traits):
        """
        Waits until all traits are present.
        If any of the traits is still not present after timeout, raises a TimeoutException.
        """
        end_time = time.time() + self._timeout
        count = 1
        missing_traits_descriptions = None
        while True:
            missing_traits_descriptions = []
            try:
                missing_traits_descriptions = element_with_traits.evaluate_traits()
                if len(missing_traits_descriptions) == 0:
                    return True
                else:
                    logger.debug("#{0} - wait until all traits are present: <{1}>".format(str(count), '> <'.join(
                        missing_traits_descriptions)))
            except self._ignored_exceptions as ex:  # pragma: no cover
                logger.debug("Captured {0}: {1}".format(str(ex.__class__).replace("<type '", "").replace("'>", ""),
                                                        str(ex)))  # pragma: no cover
                pass  # pragma: no cover
            time.sleep(self._poll)
            count += 1
            if time.time() > end_time:
                break
        raise TimeoutException(
            msg="conditions " + '<' + '> <'.join(missing_traits_descriptions) + '>' + " not true after " + str(
                self._timeout) + " seconds.")
def until_traits_are_present(self, element_with_traits):
        end_time = time.time() + self._timeout
        count = 1
        missing_traits_descriptions = None
        while True:
            missing_traits_descriptions = []
            try:
                missing_traits_descriptions = element_with_traits.evaluate_traits()
                if len(missing_traits_descriptions) == 0:
                    return True
                else:
                    logger.debug("#{0} - wait until all traits are present: <{1}>".format(str(count), '> <'.join(
                        missing_traits_descriptions)))
            except self._ignored_exceptions as ex:  # pragma: no cover
                logger.debug("Captured {0}: {1}".format(str(ex.__class__).replace("<type '", "").replace("'>", ""),
                                                        str(ex)))  # pragma: no cover
                pass  # pragma: no cover
            time.sleep(self._poll)
            count += 1
            if time.time() > end_time:
                break
        raise TimeoutException(
            msg="conditions " + '<' + '> <'.join(missing_traits_descriptions) + '>' + " not true after " + str(
                self._timeout) + " seconds.")
def until_traits_are_present ( self , element_with_traits ) : end_time = time . time ( ) + self . _timeout count = 1 missing_traits_descriptions = None while True : missing_traits_descriptions = [ ] try : missing_traits_descriptions = element_with_traits . evaluate_traits ( ) if len ( missing_traits_descriptions ) == 0 : return True else : logger . debug ( "#{0} - wait until all traits are present: <{1}>" . format ( str ( count ) , '> <' . join ( missing_traits_descriptions ) ) ) except self . _ignored_exceptions as ex : # pragma: no cover logger . debug ( "Captured {0}: {1}" . format ( str ( ex . __class__ ) . replace ( "<type '" , "" ) . replace ( "'>" , "" ) , str ( ex ) ) ) # pragma: no cover pass # pragma: no cover time . sleep ( self . _poll ) count += 1 if time . time ( ) > end_time : break raise TimeoutException ( msg = "conditions " + '<' + '> <' . join ( missing_traits_descriptions ) + '>' + " not true after " + str ( self . _timeout ) + " seconds." )
Waits until all traits are present.
        If any of the traits is still not present after timeout, raises a TimeoutException.
Waits until all traits are present . If any of the traits is still not present after timeout raises a TimeoutException .