mirror of
https://github.com/django/django.git
synced 2025-10-26 15:16:09 +00:00
Refs #494 -- Fixed a flaky admin_inlines tests.
This commit is contained in:
@@ -99,6 +99,28 @@ class AdminSeleniumWebDriverTestCase(StaticLiveServerTestCase):
|
||||
timeout
|
||||
)
|
||||
|
||||
def wait_until_visible(self, css_selector, timeout=10):
|
||||
"""
|
||||
Block until the element described by the CSS selector is visible.
|
||||
"""
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.webdriver.support import expected_conditions as ec
|
||||
self.wait_until(
|
||||
ec.visibility_of_element_located((By.CSS_SELECTOR, css_selector)),
|
||||
timeout
|
||||
)
|
||||
|
||||
def wait_until_invisible(self, css_selector, timeout=10):
|
||||
"""
|
||||
Block until the element described by the CSS selector is invisible.
|
||||
"""
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.webdriver.support import expected_conditions as ec
|
||||
self.wait_until(
|
||||
ec.invisibility_of_element_located((By.CSS_SELECTOR, css_selector)),
|
||||
timeout
|
||||
)
|
||||
|
||||
def wait_page_loaded(self):
|
||||
"""
|
||||
Block until page has started to load.
|
||||
|
||||
Reference in New Issue
Block a user