11import datetime
22import os
33import re
4+ import sys
45import unittest
56import zoneinfo
67from unittest import mock
@@ -5983,6 +5984,12 @@ def setUp(self):
59835984 title = "A Long Title" , published = True , slug = "a-long-title"
59845985 )
59855986
5987+ @property
5988+ def modifier_key (self ):
5989+ from selenium .webdriver .common .keys import Keys
5990+
5991+ return Keys .COMMAND if sys .platform == "darwin" else Keys .CONTROL
5992+
59865993 @screenshot_cases (["desktop_size" , "mobile_size" , "rtl" , "dark" , "high_contrast" ])
59875994 def test_login_button_centered (self ):
59885995 from selenium .webdriver .common .by import By
@@ -6406,8 +6413,8 @@ def test_selectbox_selected_rows(self):
64066413 elem = self .selenium .find_element (
64076414 By .CSS_SELECTOR , f"#id_user_permissions_from option[value='{ perm .id } ']"
64086415 )
6409- ActionChains (self .selenium ).key_down (Keys . CONTROL ).click (elem ).key_up (
6410- Keys . CONTROL
6416+ ActionChains (self .selenium ).key_down (self . modifier_key ).click (elem ).key_up (
6417+ self . modifier_key
64116418 ).perform ()
64126419
64136420 # Move focus to other element.
@@ -6425,8 +6432,8 @@ def test_selectbox_selected_rows(self):
64256432 elem = self .selenium .find_element (
64266433 By .CSS_SELECTOR , f"#id_user_permissions_to option[value='{ perm .id } ']"
64276434 )
6428- ActionChains (self .selenium ).key_down (Keys . CONTROL ).click (elem ).key_up (
6429- Keys . CONTROL
6435+ ActionChains (self .selenium ).key_down (self . modifier_key ).click (elem ).key_up (
6436+ self . modifier_key
64306437 ).perform ()
64316438
64326439 # Move focus to other element.
0 commit comments