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):
|
def create_options(self):
|
||||||
options = self.import_options(self.browser)()
|
options = self.import_options(self.browser)()
|
||||||
if self.headless:
|
if self.headless:
|
||||||
try:
|
match self.browser:
|
||||||
options.headless = True
|
case "chrome":
|
||||||
except AttributeError:
|
options.add_argument("--headless=new")
|
||||||
pass # Only Chrome and Firefox support the headless mode.
|
case "firefox":
|
||||||
|
options.add_argument("-headless")
|
||||||
return options
|
return options
|
||||||
|
|
||||||
def create_webdriver(self):
|
def create_webdriver(self):
|
||||||
|
|
Loading…
Reference in New Issue