more headless patches to address pipeline clog; 'two-browsers' may not have been doing anything before
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Disco DeDisco
2026-03-29 20:41:26 -04:00
parent ff0883002b
commit 5d21e79be5
2 changed files with 11 additions and 12 deletions

View File

@@ -38,17 +38,10 @@ def wait(fn):
class FunctionalTest(StaticLiveServerTestCase):
# Helper methods
def _make_browser(self, width=1366, height=900):
"""Create a Firefox instance sized to width×height.
In headless CI, pass --width/--height as binary args so the CSS
media query (orientation: landscape/portrait) is correct from the
first paint — set_window_size() alone is unreliable in headless mode.
"""
"""Create a Firefox instance sized to width×height."""
options = webdriver.FirefoxOptions()
headless = os.environ.get("HEADLESS")
if headless:
if os.environ.get("HEADLESS"):
options.add_argument("--headless")
options.add_argument(f"--width={width}")
options.add_argument(f"--height={height}")
browser = webdriver.Firefox(options=options)
browser.set_window_size(width, height)
return browser