summaryrefslogtreecommitdiff
path: root/tests/admin_widgets/tests.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-08-19 20:43:27 -0400
committerTim Graham <timograham@gmail.com>2015-08-28 13:54:03 -0400
commit7ac0cd445e056cac9bfc1fed11026ab6c74b8818 (patch)
tree59094a75d49e1319d29daa38211b1e14717fb416 /tests/admin_widgets/tests.py
parent01b2b0b6543afdaf30623b7a779b7fe4514a9c7b (diff)
downloaddjango-7ac0cd445e056cac9bfc1fed11026ab6c74b8818.tar.gz
Fixed #25323 -- Fixed selenium test failures with chromedriver 2.18.
Diffstat (limited to 'tests/admin_widgets/tests.py')
-rw-r--r--tests/admin_widgets/tests.py19
1 files changed, 7 insertions, 12 deletions
diff --git a/tests/admin_widgets/tests.py b/tests/admin_widgets/tests.py
index f34ecc659e..efdc7eab93 100644
--- a/tests/admin_widgets/tests.py
+++ b/tests/admin_widgets/tests.py
@@ -766,13 +766,8 @@ class DateTimePickerSeleniumFirefoxTests(SeleniumDataMixin, AdminSeleniumWebDriv
# Click on the calendar icon
self.selenium.find_element_by_id('calendarlink0').click()
-
- # Get the calendar caption
- calendar0 = self.selenium.find_element_by_id('calendarin0')
- caption = calendar0.find_element_by_tag_name('caption')
-
# Make sure that the right month and year are displayed
- self.assertEqual(caption.text, expected_caption)
+ self.wait_for_text('#calendarin0 caption', expected_caption)
class DateTimePickerSeleniumChromeTests(DateTimePickerSeleniumFirefoxTests):
@@ -1130,8 +1125,8 @@ class AdminRawIdWidgetSeleniumFirefoxTests(SeleniumDataMixin, AdminSeleniumWebDr
# Open the popup window and click on a band
self.selenium.find_element_by_id('lookup_id_main_band').click()
+ self.wait_for_popup()
self.selenium.switch_to.window('id_main_band')
- self.wait_page_loaded()
link = self.selenium.find_element_by_link_text('Bogey Blues')
self.assertIn('/band/42/', link.get_attribute('href'))
link.click()
@@ -1142,8 +1137,8 @@ class AdminRawIdWidgetSeleniumFirefoxTests(SeleniumDataMixin, AdminSeleniumWebDr
# Reopen the popup window and click on another band
self.selenium.find_element_by_id('lookup_id_main_band').click()
+ self.wait_for_popup()
self.selenium.switch_to.window('id_main_band')
- self.wait_page_loaded()
link = self.selenium.find_element_by_link_text('Green Potatoes')
self.assertIn('/band/98/', link.get_attribute('href'))
link.click()
@@ -1165,8 +1160,8 @@ class AdminRawIdWidgetSeleniumFirefoxTests(SeleniumDataMixin, AdminSeleniumWebDr
# Open the popup window and click on a band
self.selenium.find_element_by_id('lookup_id_supporting_bands').click()
+ self.wait_for_popup()
self.selenium.switch_to.window('id_supporting_bands')
- self.wait_page_loaded()
link = self.selenium.find_element_by_link_text('Bogey Blues')
self.assertIn('/band/42/', link.get_attribute('href'))
link.click()
@@ -1177,8 +1172,8 @@ class AdminRawIdWidgetSeleniumFirefoxTests(SeleniumDataMixin, AdminSeleniumWebDr
# Reopen the popup window and click on another band
self.selenium.find_element_by_id('lookup_id_supporting_bands').click()
+ self.wait_for_popup()
self.selenium.switch_to.window('id_supporting_bands')
- self.wait_page_loaded()
link = self.selenium.find_element_by_link_text('Green Potatoes')
self.assertIn('/band/98/', link.get_attribute('href'))
link.click()
@@ -1211,8 +1206,8 @@ class RelatedFieldWidgetSeleniumFirefoxTests(SeleniumDataMixin, AdminSeleniumWeb
main_window = self.selenium.current_window_handle
# Click the Add User button to add new
self.selenium.find_element_by_id('add_id_user').click()
+ self.wait_for_popup()
self.selenium.switch_to.window('id_user')
- self.wait_for('#id_password')
password_field = self.selenium.find_element_by_id('id_password')
password_field.send_keys('password')
@@ -1228,8 +1223,8 @@ class RelatedFieldWidgetSeleniumFirefoxTests(SeleniumDataMixin, AdminSeleniumWeb
# Click the Change User button to change it
self.selenium.find_element_by_id('change_id_user').click()
+ self.wait_for_popup()
self.selenium.switch_to.window('id_user')
- self.wait_page_loaded()
username_field = self.selenium.find_element_by_id('id_username')
username_value = 'changednewuser'