summaryrefslogtreecommitdiff
path: root/docs/internals/contributing/writing-code
diff options
context:
space:
mode:
authorSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-04-16 09:28:34 +0200
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-05-02 13:18:58 +0200
commit39828fa7786a805f7a542abb929f352d3c5b722c (patch)
treec9518ad22bb7f7cb004f5adad66fd3ada712aef5 /docs/internals/contributing/writing-code
parent914bf6917157923783ad2ea4c8a60115738a203c (diff)
Added a high contrast mode to screenshot cases.
Thank you to Sarah Abderemane and Nick Pope for the reviews.
Diffstat (limited to 'docs/internals/contributing/writing-code')
-rw-r--r--docs/internals/contributing/writing-code/unit-tests.txt11
1 files changed, 6 insertions, 5 deletions
diff --git a/docs/internals/contributing/writing-code/unit-tests.txt b/docs/internals/contributing/writing-code/unit-tests.txt
index 1e86a5802d..ca4029dbfa 100644
--- a/docs/internals/contributing/writing-code/unit-tests.txt
+++ b/docs/internals/contributing/writing-code/unit-tests.txt
@@ -278,16 +278,16 @@ For testing changes to the admin UI, the selenium tests can be run with the
To define when screenshots should be taken during a selenium test, the test
class must use the ``@django.test.selenium.screenshot_cases`` decorator with a
list of supported screenshot types (``"desktop_size"``, ``"mobile_size"``,
-``"small_screen_size"``, ``"rtl"``, and ``"dark"``). It can then call
-``self.take_screenshot("unique-screenshot-name")`` at the desired point to
-generate the screenshots. For example::
+``"small_screen_size"``, ``"rtl"``, ``"dark"``, and ``"high_contrast"``). It
+can then call ``self.take_screenshot("unique-screenshot-name")`` at the desired
+point to generate the screenshots. For example::
from django.test.selenium import SeleniumTestCase, screenshot_cases
from django.urls import reverse
class SeleniumTests(SeleniumTestCase):
- @screenshot_cases(["desktop_size", "mobile_size", "rtl", "dark"])
+ @screenshot_cases(["desktop_size", "mobile_size", "rtl", "dark", "high_contrast"])
def test_login_button_centered(self):
self.selenium.get(self.live_server_url + reverse("admin:login"))
self.take_screenshot("login")
@@ -295,7 +295,8 @@ generate the screenshots. For example::
This generates multiple screenshots of the login page - one for a desktop
screen, one for a mobile screen, one for right-to-left languages on desktop,
-and one for the dark mode on desktop.
+one for the dark mode on desktop, and one for high contrast mode on desktop
+when using chrome.
.. versionchanged:: 5.1