summaryrefslogtreecommitdiff
path: root/django/contrib/admin/tests.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-01-11 11:28:03 -0500
committerTim Graham <timograham@gmail.com>2016-01-11 14:16:17 -0500
commit294d0d88158fa83eb095d663d054038ce9dfc3d4 (patch)
tree76828053c98771353e6c3e300eca39cec1d3aa9f /django/contrib/admin/tests.py
parentbc7d201bdbaeac14a49f51a9ef292d6312b4c45e (diff)
Fixed #26048 -- Made admin selenium tests use implicitly_wait()
Diffstat (limited to 'django/contrib/admin/tests.py')
-rw-r--r--django/contrib/admin/tests.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/django/contrib/admin/tests.py b/django/contrib/admin/tests.py
index b1846c83d2..bcdc747571 100644
--- a/django/contrib/admin/tests.py
+++ b/django/contrib/admin/tests.py
@@ -37,6 +37,7 @@ class AdminSeleniumWebDriverTestCase(StaticLiveServerTestCase):
except Exception as e:
raise SkipTest('Selenium webdriver "%s" not installed or not '
'operational: %s' % (cls.webdriver_class, str(e)))
+ cls.selenium.implicitly_wait(10)
# This has to be last to ensure that resources are cleaned up properly!
super(AdminSeleniumWebDriverTestCase, cls).setUpClass()
@@ -63,13 +64,6 @@ class AdminSeleniumWebDriverTestCase(StaticLiveServerTestCase):
"""
self.wait_until(lambda d: len(d.window_handles) == num_windows, timeout)
- def wait_loaded_tag(self, tag_name, timeout=10):
- """
- Helper function that blocks until the element with the given tag name
- is found on the page.
- """
- self.wait_for(tag_name, timeout)
-
def wait_for(self, css_selector, timeout=10):
"""
Helper function that blocks until a CSS selector is found on the page.
@@ -112,7 +106,7 @@ class AdminSeleniumWebDriverTestCase(StaticLiveServerTestCase):
from selenium.common.exceptions import TimeoutException
try:
# Wait for the next page to be loaded
- self.wait_loaded_tag('body')
+ self.wait_for('body')
except TimeoutException:
# IE7 occasionally returns an error "Internet Explorer cannot
# display the webpage" and doesn't load the next page. We just