summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2014-07-24 08:25:15 -0400
committerTim Graham <timograham@gmail.com>2014-07-24 08:25:15 -0400
commit9b1515906eb28819465276bfa55c6b42c858797d (patch)
treebe71d77be3bce86b45b89316d7f1bb990098e88b /tests
parent8568e7cfa4fb87cd0a9ead1b3fbb7a39d19e98b9 (diff)
downloaddjango-9b1515906eb28819465276bfa55c6b42c858797d.tar.gz
Removed usage of deprecated switch_to_*() selenium methods.
Diffstat (limited to 'tests')
-rw-r--r--tests/admin_views/tests.py4
-rw-r--r--tests/admin_widgets/tests.py20
2 files changed, 12 insertions, 12 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index 6e5f2cb085..dfa5a85ae6 100644
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -3724,7 +3724,7 @@ class SeleniumAdminViewsFirefoxTests(AdminSeleniumWebDriverTestCase):
self.selenium.get('%s%s' % (self.live_server_url,
'/test_admin/admin/admin_views/picture/add/'))
self.assertEqual(
- self.selenium.switch_to_active_element(),
+ self.selenium.switch_to.active_element,
self.selenium.find_element_by_id('id_name')
)
@@ -3732,7 +3732,7 @@ class SeleniumAdminViewsFirefoxTests(AdminSeleniumWebDriverTestCase):
self.selenium.get('%s%s' % (self.live_server_url,
'/test_admin/admin/admin_views/reservation/add/'))
self.assertEqual(
- self.selenium.switch_to_active_element(),
+ self.selenium.switch_to.active_element,
self.selenium.find_element_by_id('id_start_date_0')
)
diff --git a/tests/admin_widgets/tests.py b/tests/admin_widgets/tests.py
index a004121414..79d7cbd9c8 100644
--- a/tests/admin_widgets/tests.py
+++ b/tests/admin_widgets/tests.py
@@ -985,26 +985,26 @@ class AdminRawIdWidgetSeleniumFirefoxTests(AdminSeleniumWebDriverTestCase):
# Open the popup window and click on a band
self.selenium.find_element_by_id('lookup_id_main_band').click()
- self.selenium.switch_to_window('id_main_band')
+ self.selenium.switch_to.window('id_main_band')
self.wait_page_loaded()
link = self.selenium.find_element_by_link_text('Bogey Blues')
self.assertTrue('/band/42/' in link.get_attribute('href'))
link.click()
# The field now contains the selected band's id
- self.selenium.switch_to_window(main_window)
+ self.selenium.switch_to.window(main_window)
self.wait_for_value('#id_main_band', '42')
# Reopen the popup window and click on another band
self.selenium.find_element_by_id('lookup_id_main_band').click()
- self.selenium.switch_to_window('id_main_band')
+ self.selenium.switch_to.window('id_main_band')
self.wait_page_loaded()
link = self.selenium.find_element_by_link_text('Green Potatoes')
self.assertTrue('/band/98/' in link.get_attribute('href'))
link.click()
# The field now contains the other selected band's id
- self.selenium.switch_to_window(main_window)
+ self.selenium.switch_to.window(main_window)
self.wait_for_value('#id_main_band', '98')
def test_many_to_many(self):
@@ -1020,26 +1020,26 @@ class AdminRawIdWidgetSeleniumFirefoxTests(AdminSeleniumWebDriverTestCase):
# Open the popup window and click on a band
self.selenium.find_element_by_id('lookup_id_supporting_bands').click()
- self.selenium.switch_to_window('id_supporting_bands')
+ self.selenium.switch_to.window('id_supporting_bands')
self.wait_page_loaded()
link = self.selenium.find_element_by_link_text('Bogey Blues')
self.assertTrue('/band/42/' in link.get_attribute('href'))
link.click()
# The field now contains the selected band's id
- self.selenium.switch_to_window(main_window)
+ self.selenium.switch_to.window(main_window)
self.wait_for_value('#id_supporting_bands', '42')
# Reopen the popup window and click on another band
self.selenium.find_element_by_id('lookup_id_supporting_bands').click()
- self.selenium.switch_to_window('id_supporting_bands')
+ self.selenium.switch_to.window('id_supporting_bands')
self.wait_page_loaded()
link = self.selenium.find_element_by_link_text('Green Potatoes')
self.assertTrue('/band/98/' in link.get_attribute('href'))
link.click()
# The field now contains the two selected bands' ids
- self.selenium.switch_to_window(main_window)
+ self.selenium.switch_to.window(main_window)
self.wait_for_value('#id_supporting_bands', '42,98')
@@ -1067,7 +1067,7 @@ class RelatedFieldWidgetSeleniumFirefoxTests(AdminSeleniumWebDriverTestCase):
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.selenium.switch_to_window('id_user')
+ self.selenium.switch_to.window('id_user')
self.wait_page_loaded()
password_field = self.selenium.find_element_by_id('id_password')
password_field.send_keys('password')
@@ -1078,7 +1078,7 @@ class RelatedFieldWidgetSeleniumFirefoxTests(AdminSeleniumWebDriverTestCase):
save_button_css_selector = '.submit-row > input[type=submit]'
self.selenium.find_element_by_css_selector(save_button_css_selector).click()
- self.selenium.switch_to_window(main_window)
+ self.selenium.switch_to.window(main_window)
# The field now contains the new user
self.wait_for('#id_user option[value="newuser"]')