mirror of https://github.com/django/django.git
Fixed #34649 -- Fixed headless deprecation warning on Selenium 4.8+.
Thanks David Smith for the report and initial patch.
This commit is contained in:
parent
06881341d4
commit
68d0f95262
|
@ -79,10 +79,11 @@ class SeleniumTestCaseBase(type(LiveServerTestCase)):
|
|||
def create_options(self):
|
||||
options = self.import_options(self.browser)()
|
||||
if self.headless:
|
||||
try:
|
||||
options.headless = True
|
||||
except AttributeError:
|
||||
pass # Only Chrome and Firefox support the headless mode.
|
||||
match self.browser:
|
||||
case "chrome":
|
||||
options.add_argument("--headless=new")
|
||||
case "firefox":
|
||||
options.add_argument("-headless")
|
||||
return options
|
||||
|
||||
def create_webdriver(self):
|
||||
|
|
Loading…
Reference in New Issue