Commit 40884a50 by Jay Zoldak

Increase the default timeout for waiting in lettuce tests

parent 6ddc3761
...@@ -24,6 +24,7 @@ from selenium.webdriver.common.by import By ...@@ -24,6 +24,7 @@ from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.ui import WebDriverWait
from nose.tools import assert_true # pylint: disable=E0611 from nose.tools import assert_true # pylint: disable=E0611
GLOBAL_WAIT_FOR_TIMEOUT = 60
REQUIREJS_WAIT = { REQUIREJS_WAIT = {
# Settings - Schedule & Details # Settings - Schedule & Details
...@@ -342,7 +343,7 @@ def wait_for(func, timeout=5, timeout_msg=None): ...@@ -342,7 +343,7 @@ def wait_for(func, timeout=5, timeout_msg=None):
@world.absorb @world.absorb
def wait_for_present(css_selector, timeout=30): def wait_for_present(css_selector, timeout=GLOBAL_WAIT_FOR_TIMEOUT):
""" """
Wait for the element to be present in the DOM. Wait for the element to be present in the DOM.
""" """
...@@ -354,7 +355,7 @@ def wait_for_present(css_selector, timeout=30): ...@@ -354,7 +355,7 @@ def wait_for_present(css_selector, timeout=30):
@world.absorb @world.absorb
def wait_for_visible(css_selector, index=0, timeout=30): def wait_for_visible(css_selector, index=0, timeout=GLOBAL_WAIT_FOR_TIMEOUT):
""" """
Wait for the element to be visible in the DOM. Wait for the element to be visible in the DOM.
""" """
...@@ -366,7 +367,7 @@ def wait_for_visible(css_selector, index=0, timeout=30): ...@@ -366,7 +367,7 @@ def wait_for_visible(css_selector, index=0, timeout=30):
@world.absorb @world.absorb
def wait_for_invisible(css_selector, timeout=30): def wait_for_invisible(css_selector, timeout=GLOBAL_WAIT_FOR_TIMEOUT):
""" """
Wait for the element to be either invisible or not present on the DOM. Wait for the element to be either invisible or not present on the DOM.
""" """
...@@ -378,7 +379,7 @@ def wait_for_invisible(css_selector, timeout=30): ...@@ -378,7 +379,7 @@ def wait_for_invisible(css_selector, timeout=30):
@world.absorb @world.absorb
def wait_for_clickable(css_selector, timeout=30): def wait_for_clickable(css_selector, timeout=GLOBAL_WAIT_FOR_TIMEOUT):
""" """
Wait for the element to be present and clickable. Wait for the element to be present and clickable.
""" """
...@@ -390,7 +391,7 @@ def wait_for_clickable(css_selector, timeout=30): ...@@ -390,7 +391,7 @@ def wait_for_clickable(css_selector, timeout=30):
@world.absorb @world.absorb
def css_find(css, wait_time=30): def css_find(css, wait_time=GLOBAL_WAIT_FOR_TIMEOUT):
""" """
Wait for the element(s) as defined by css locator Wait for the element(s) as defined by css locator
to be present. to be present.
...@@ -402,7 +403,7 @@ def css_find(css, wait_time=30): ...@@ -402,7 +403,7 @@ def css_find(css, wait_time=30):
@world.absorb @world.absorb
def css_click(css_selector, index=0, wait_time=30, dismiss_alert=False): def css_click(css_selector, index=0, wait_time=GLOBAL_WAIT_FOR_TIMEOUT, dismiss_alert=False):
""" """
Perform a click on a CSS selector, first waiting for the element Perform a click on a CSS selector, first waiting for the element
to be present and clickable. to be present and clickable.
...@@ -431,7 +432,7 @@ def css_click(css_selector, index=0, wait_time=30, dismiss_alert=False): ...@@ -431,7 +432,7 @@ def css_click(css_selector, index=0, wait_time=30, dismiss_alert=False):
@world.absorb @world.absorb
def css_check(css_selector, wait_time=30): def css_check(css_selector, wait_time=GLOBAL_WAIT_FOR_TIMEOUT):
""" """
Checks a check box based on a CSS selector, first waiting for the element Checks a check box based on a CSS selector, first waiting for the element
to be present and clickable. This is just a wrapper for calling "click" to be present and clickable. This is just a wrapper for calling "click"
...@@ -446,7 +447,7 @@ def css_check(css_selector, wait_time=30): ...@@ -446,7 +447,7 @@ def css_check(css_selector, wait_time=30):
@world.absorb @world.absorb
def select_option(name, value, wait_time=30): def select_option(name, value, wait_time=GLOBAL_WAIT_FOR_TIMEOUT):
''' '''
A method to select an option A method to select an option
Then for synchronization purposes, wait for the option to be selected. Then for synchronization purposes, wait for the option to be selected.
...@@ -494,7 +495,7 @@ def click_link_by_text(text, index=0): ...@@ -494,7 +495,7 @@ def click_link_by_text(text, index=0):
@world.absorb @world.absorb
def css_text(css_selector, index=0, timeout=30): def css_text(css_selector, index=0, timeout=GLOBAL_WAIT_FOR_TIMEOUT):
# Wait for the css selector to appear # Wait for the css selector to appear
if is_css_present(css_selector): if is_css_present(css_selector):
return retry_on_exception(lambda: css_find(css_selector, wait_time=timeout)[index].text) return retry_on_exception(lambda: css_find(css_selector, wait_time=timeout)[index].text)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment