Ejemplo n.º 1
0
 def wait_for_element_available(self, locator):
     for i in range(timeout_seconds):
         if self.is_element_available(locator):
             return True
         else:
             time.sleep(1)
     else:
         raise ElementVisiblityTimeout("%s value timed out" %locator)
Ejemplo n.º 2
0
 def wait_for_element_visibility_change(self, locator, intial_visibility):
     for i in range(timeout_seconds):
         if self.se.is_visible(locator) == intial_visibility:
             time.sleep(1)                
         else:                
             break
     else:
         raise ElementVisiblityTimeout("%s value timed out" %locator)
     return True
Ejemplo n.º 3
0
 def wait_for_value_changed(self, locator, text):
     for i in range(timeout_seconds):
         try:
             if len(self.se.get_text(locator).strip()) != 0 and self.se.get_text(locator) != text:
                 break
         except:
             pass
         time.sleep(1)
     else:
         raise ElementVisiblityTimeout("%s visibility timed out" % locator)
     return True
Ejemplo n.º 4
0
    def wait_for_element_not_present(self, locator):
        """
        Synchronization helper to wait until some element is removed from the page

        :raises: ElementVisiblityTimeout
        """
        for i in range(timeout_seconds):
            if self.driver.is_element_present(locator):
                time.sleep(1)
            else:
                break
        else:
            raise ElementVisiblityTimeout("%s presence timed out" % locator)
        return True
Ejemplo n.º 5
0
    def wait_for_hidden(self, locator):
        """
        Synchronization to deal with elements that are present, but are visibility until some action
        triggers their hidden-ness.

        :raises: ElementVisiblityTimeout=
        """
        for i in range(timeout_seconds):
            if self.driver.is_visible(locator):
                time.sleep(1)
            else:
                break
        else:
            raise ElementVisiblityTimeout("%s visibility timed out" % locator)
        return True
Ejemplo n.º 6
0
    def wait_for_available(self, locator):
        """
        Synchronization to deal with elements that are present, and are visible

        :raises: ElementVisiblityTimeout
        """
        for i in range(timeout_seconds):
            try:
                if self.is_element_available(locator):
                    break
            except:
                pass
            time.sleep(1)
        else:
            raise ElementVisiblityTimeout("%s availability timed out" % locator)
        return True
Ejemplo n.º 7
0
    def wait_for_visible(self, locator):
        """
        Synchronization to deal with elements that are present, but are disabled until some action
        triggers their visibility.

        :raises: ElementVisiblityTimeout
        """
        for i in range(timeout_seconds):
            try:
                if self.driver.is_visible(locator):
                    break
            except:
                pass
            time.sleep(1)
        else:
            raise ElementVisiblityTimeout("%s visibility timed out" % locator)
        return True