Example #1
0
 def wait_until_page_ready(pageobject, timeout=WTF_TIMEOUT_MANAGER.NORMAL):
     "Waits until document.readyState == Complete"
     try:
         do_until(lambda: pageobject.webdriver.execute_script("return document.readyState").lower() \
                          == 'complete', timeout)
     except wait_utils.OperationTimeoutError:
         raise PageUtilOperationTimeoutError("Timeout occurred while waiting for page to be ready.")
Example #2
0
 def wait_until_page_ready(page_object, timeout=WTF_TIMEOUT_MANAGER.NORMAL):
     """Waits until document.readyState == Complete (e.g. ready to execute javascript commands)
     
     Args:
         page_object (PageObject) : PageObject class
     
     Kwargs:
         timeout (number) : timeout period
     """
     try:
         do_until(lambda: page_object.webdriver.execute_script("return document.readyState").lower() \
                  == 'complete', timeout)
     except wait_utils.OperationTimeoutError:
         raise PageUtilOperationTimeoutError("Timeout occurred while waiting for page to be ready.")
Example #3
0
 def wait_until_page_ready(page_object, timeout=WTF_TIMEOUT_MANAGER.NORMAL):
     """Waits until document.readyState == Complete (e.g. ready to execute javascript commands)
     
     Args:
         page_object (PageObject) : PageObject class
     
     Kwargs:
         timeout (number) : timeout period
     """
     try:
         do_until(lambda: page_object.webdriver.execute_script("return document.readyState").lower() \
                  =='complete', timeout)
     except wait_utils.OperationTimeoutError:
         raise PageUtilOperationTimeoutError(
             "Timeout occurred while waiting for page to be ready.")
Example #4
0
 def test_do_until_retries_until_action_successful(self):
     self.__x = 0
     do_until(lambda: self.__wait_condition())
     self.assertEqual(2, self.__x)
Example #5
0
 def test_do_until_retries_until_action_successful(self):
     self.__x = 0
     do_until(lambda: self.__wait_condition())
     self.assertEqual(2, self.__x)