mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Apply suggestions from code review
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
This commit is contained in:
parent
6fbdfe14f6
commit
c4c66aa73d
@ -6207,19 +6207,22 @@ class SeleniumTests(AdminSeleniumTestCase):
|
|||||||
self.take_screenshot("focus-multi-widget")
|
self.take_screenshot("focus-multi-widget")
|
||||||
|
|
||||||
@screenshot_cases(["desktop_size", "mobile_size", "rtl", "dark", "high_contrast"])
|
@screenshot_cases(["desktop_size", "mobile_size", "rtl", "dark", "high_contrast"])
|
||||||
def test_error_message_position(self):
|
def test_error_message(self):
|
||||||
"""Error messages are shown above the field and below the label"""
|
|
||||||
from selenium.webdriver.common.by import By
|
from selenium.webdriver.common.by import By
|
||||||
|
|
||||||
url = reverse("admin:admin_views_article_add")
|
|
||||||
full_url = self.live_server_url + url
|
|
||||||
self.admin_login(
|
self.admin_login(
|
||||||
username="super", password="secret", login_url=reverse("admin:index")
|
username="super", password="secret", login_url=reverse("admin:index")
|
||||||
)
|
)
|
||||||
self.selenium.get(full_url)
|
with self.wait_page_loaded():
|
||||||
# Submit an empty form to trigger validation errors
|
self.selenium.get(
|
||||||
self.selenium.find_element(By.CSS_SELECTOR, 'input[type="submit"]').click()
|
self.live_server_url + reverse("admin:admin_views_picture_add")
|
||||||
self.wait_page_ready()
|
)
|
||||||
|
|
||||||
|
# Submit an empty form to trigger validation errors.
|
||||||
|
with self.wait_page_loaded():
|
||||||
|
self.selenium.find_element(By.CSS_SELECTOR, 'input[type="submit"]').click()
|
||||||
|
error = self.selenium.find_elements(By.CSS_SELECTOR, ".errornote")
|
||||||
|
self.assertEqual(len(error), 1)
|
||||||
self.take_screenshot("error-message-position")
|
self.take_screenshot("error-message-position")
|
||||||
|
|
||||||
def test_cancel_delete_confirmation(self):
|
def test_cancel_delete_confirmation(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user