コード例 #1
0
ファイル: page.py プロジェクト: pombredanne/py.saunter
 def is_element_available(self, locator):
     """
     Synchronization method for making sure the element we're looking for is not only on the page,
     but also visible -- since Se will happily deal with things that aren't visible.
     
     Use this instead of is_element_present most of the time.
     """
     if SaunterWebDriver.is_element_present(locator):
         if SaunterWebDriver.is_visible(locator):
             return True
         else:
             return False
     else:
         return False
コード例 #2
0
ファイル: page.py プロジェクト: pombredanne/py.saunter
    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 SaunterWebDriver.is_visible(locator):
                time.sleep(1)
            else:
                break
        else:
            raise ElementVisiblityTimeout("%s visibility timed out" % locator)
        return True
コード例 #3
0
ファイル: page.py プロジェクト: pombredanne/py.saunter
 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 SaunterWebDriver.is_visible(locator):
                 break
         except:
             pass
         time.sleep(1)
     else:
         raise ElementVisiblityTimeout("%s visibility timed out" % locator)
     return True