Skip to content

Commit

Permalink
chore(ci): pass --no-sandbox option only to chrome browser
Browse files Browse the repository at this point in the history
  • Loading branch information
soonum committed Oct 14, 2024
1 parent 9a06f62 commit 41b3edf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ci/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,17 @@ def __init__(self, browser_path, driver_path, browser_kind, threaded_logs=False)
match self.browser_kind:
case BrowserKind.chrome:
self.options = ChromeOptions()
if os.getuid() == 0:
# If user ID is root then driver needs to run in no-sandbox mode.
print(
"Script is running as root, running browser with --no-sandbox for compatibility"
)
self.options.add_argument("--no-sandbox")
case BrowserKind.firefox:
self.options = FirefoxOptions()

self.options.binary_location = self.browser_path
self.options.add_argument("--headless")
if os.getuid() == 0:
# If user ID is root then driver needs to run in no-sandbox mode.
print(
"Script is running as root, running browser with --no-sandbox for compatibility"
)
self.options.add_argument("--no-sandbox")

self._driver = None

Expand Down

0 comments on commit 41b3edf

Please sign in to comment.