summaryrefslogtreecommitdiff
path: root/tests/admin_views
diff options
context:
space:
mode:
Diffstat (limited to 'tests/admin_views')
-rw-r--r--tests/admin_views/tests.py25
1 files changed, 18 insertions, 7 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index c877797667..98a77221b2 100644
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -6259,6 +6259,7 @@ class SeleniumTests(AdminSeleniumTestCase):
self.assertEqual(select2_display.text, "×\nnew section")
def test_inline_uuid_pk_edit_with_popup(self):
+ from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
@@ -6271,8 +6272,10 @@ class SeleniumTests(AdminSeleniumTestCase):
"admin:admin_views_relatedwithuuidpkmodel_change",
args=(related_with_parent.id,),
)
- self.selenium.get(self.live_server_url + change_url)
- self.selenium.find_element(By.ID, "change_id_parent").click()
+ with self.wait_page_loaded():
+ self.selenium.get(self.live_server_url + change_url)
+ change_parent = self.selenium.find_element(By.ID, "change_id_parent")
+ ActionChains(self.selenium).move_to_element(change_parent).click().perform()
self.wait_for_and_switch_to_popup()
self.selenium.find_element(By.XPATH, '//input[@value="Save"]').click()
self.selenium.switch_to.window(self.selenium.window_handles[0])
@@ -6305,6 +6308,7 @@ class SeleniumTests(AdminSeleniumTestCase):
self.assertEqual(select.first_selected_option.get_attribute("value"), uuid_id)
def test_inline_uuid_pk_delete_with_popup(self):
+ from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
@@ -6317,8 +6321,10 @@ class SeleniumTests(AdminSeleniumTestCase):
"admin:admin_views_relatedwithuuidpkmodel_change",
args=(related_with_parent.id,),
)
- self.selenium.get(self.live_server_url + change_url)
- self.selenium.find_element(By.ID, "delete_id_parent").click()
+ with self.wait_page_loaded():
+ self.selenium.get(self.live_server_url + change_url)
+ delete_parent = self.selenium.find_element(By.ID, "delete_id_parent")
+ ActionChains(self.selenium).move_to_element(delete_parent).click().perform()
self.wait_for_and_switch_to_popup()
self.selenium.find_element(By.XPATH, '//input[@value="Yes, I’m sure"]').click()
self.selenium.switch_to.window(self.selenium.window_handles[0])
@@ -6329,6 +6335,7 @@ class SeleniumTests(AdminSeleniumTestCase):
def test_inline_with_popup_cancel_delete(self):
"""Clicking ""No, take me back" on a delete popup closes the window."""
+ from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
parent = ParentWithUUIDPK.objects.create(title="test")
@@ -6340,8 +6347,10 @@ class SeleniumTests(AdminSeleniumTestCase):
"admin:admin_views_relatedwithuuidpkmodel_change",
args=(related_with_parent.id,),
)
- self.selenium.get(self.live_server_url + change_url)
- self.selenium.find_element(By.ID, "delete_id_parent").click()
+ with self.wait_page_loaded():
+ self.selenium.get(self.live_server_url + change_url)
+ delete_parent = self.selenium.find_element(By.ID, "delete_id_parent")
+ ActionChains(self.selenium).move_to_element(delete_parent).click().perform()
self.wait_for_and_switch_to_popup()
self.selenium.find_element(By.XPATH, '//a[text()="No, take me back"]').click()
self.selenium.switch_to.window(self.selenium.window_handles[0])
@@ -6528,6 +6537,7 @@ class SeleniumTests(AdminSeleniumTestCase):
self.assertIs(field_title.is_displayed(), False)
def test_updating_related_objects_updates_fk_selects_except_autocompletes(self):
+ from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
@@ -6589,7 +6599,8 @@ class SeleniumTests(AdminSeleniumTestCase):
)
# Add new Country from the living_country select.
- self.selenium.find_element(By.ID, f"add_{living_country_select_id}").click()
+ element = self.selenium.find_element(By.ID, f"add_{living_country_select_id}")
+ ActionChains(self.selenium).move_to_element(element).click(element).perform()
self.wait_for_and_switch_to_popup()
self.selenium.find_element(By.ID, "id_name").send_keys("Spain")
continent_select = Select(