From 99f5aaaca29792d435ef70c5071bd5d5d8a62fe4 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Mon, 2 Feb 2026 09:39:20 +0100 Subject: [PATCH] feat: Add --executable-path flag to the test command This allow to pass to Camoufox library the executable-path from the cli test command allowing to use a camoufox from a different folder during development. Example: python -m camoufox test --executable-path="/tmp/camoufox/camoufox-bin" --- pythonlib/camoufox/__main__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pythonlib/camoufox/__main__.py b/pythonlib/camoufox/__main__.py index 8514c62..c014e6b 100644 --- a/pythonlib/camoufox/__main__.py +++ b/pythonlib/camoufox/__main__.py @@ -107,14 +107,15 @@ def remove() -> None: @cli.command(name='test') +@click.option('--executable-path', help='Path to the Camoufox executable', default=None) @click.argument('url', default=None, required=False) -def test(url: Optional[str] = None) -> None: +def test(url: Optional[str] = None, executable_path: Optional[str] = None) -> None: """ Open the Playwright inspector """ from .sync_api import Camoufox - with Camoufox(headless=False, env=environ, config={'showcursor': False}) as browser: + with Camoufox(headless=False, env=environ, config={'showcursor': False}, executable_path=executable_path) as browser: page = browser.new_page() if url: page.goto(url)