Skip to content

Commit 2ee05ab

Browse files
committed
Fix issue with headed mode on Linux
1 parent 2beac7d commit 2ee05ab

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12721,7 +12721,7 @@ def __activate_virtual_display_as_needed(self):
1272112721
"""Should be needed only on Linux.
1272212722
The "--xvfb" arg is still useful, as it prevents headless mode,
1272312723
which is the default mode on Linux unless using another arg."""
12724-
if "linux" in sys.platform:
12724+
if "linux" in sys.platform and (not self.headed or self.xvfb):
1272512725
width = settings.HEADLESS_START_WIDTH
1272612726
height = settings.HEADLESS_START_HEIGHT
1272712727
try:

seleniumbase/plugins/selenium_plugin.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,10 @@ def beforeTest(self, test):
11751175
sb_config._virtual_display = None
11761176
sb_config.headless_active = False
11771177
self.headless_active = False
1178-
if "linux" in sys.platform:
1178+
if (
1179+
"linux" in sys.platform
1180+
and (not self.options.headed or self.options.xvfb)
1181+
):
11791182
width = settings.HEADLESS_START_WIDTH
11801183
height = settings.HEADLESS_START_HEIGHT
11811184
try:

0 commit comments

Comments
 (0)