mirror of
https://github.com/django/django.git
synced 2025-09-26 20:19:16 +00:00
Refs #29892 -- Made Selenium tests wait for popups to be ready.
This commit is contained in:
parent
845042b3d9
commit
65285d1e7d
3 changed files with 19 additions and 29 deletions
|
@ -1295,8 +1295,7 @@ class AdminRawIdWidgetSeleniumTests(AdminWidgetSeleniumTestCase):
|
|||
|
||||
# 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_for_and_switch_to_popup()
|
||||
link = self.selenium.find_element_by_link_text('Bogey Blues')
|
||||
self.assertIn('/band/42/', link.get_attribute('href'))
|
||||
link.click()
|
||||
|
@ -1307,8 +1306,7 @@ class AdminRawIdWidgetSeleniumTests(AdminWidgetSeleniumTestCase):
|
|||
|
||||
# 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_for_and_switch_to_popup()
|
||||
link = self.selenium.find_element_by_link_text('Green Potatoes')
|
||||
self.assertIn('/band/98/', link.get_attribute('href'))
|
||||
link.click()
|
||||
|
@ -1333,8 +1331,7 @@ class AdminRawIdWidgetSeleniumTests(AdminWidgetSeleniumTestCase):
|
|||
|
||||
# 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_for_and_switch_to_popup()
|
||||
link = self.selenium.find_element_by_link_text('Bogey Blues')
|
||||
self.assertIn('/band/42/', link.get_attribute('href'))
|
||||
link.click()
|
||||
|
@ -1345,8 +1342,7 @@ class AdminRawIdWidgetSeleniumTests(AdminWidgetSeleniumTestCase):
|
|||
|
||||
# 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_for_and_switch_to_popup()
|
||||
link = self.selenium.find_element_by_link_text('Green Potatoes')
|
||||
self.assertIn('/band/98/', link.get_attribute('href'))
|
||||
link.click()
|
||||
|
@ -1365,8 +1361,7 @@ class RelatedFieldWidgetSeleniumTests(AdminWidgetSeleniumTestCase):
|
|||
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_and_switch_to_popup()
|
||||
password_field = self.selenium.find_element_by_id('id_password')
|
||||
password_field.send_keys('password')
|
||||
|
||||
|
@ -1382,8 +1377,7 @@ class RelatedFieldWidgetSeleniumTests(AdminWidgetSeleniumTestCase):
|
|||
|
||||
# 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_for_and_switch_to_popup()
|
||||
|
||||
username_field = self.selenium.find_element_by_id('id_username')
|
||||
username_value = 'changednewuser'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue