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"
This commit is contained in:
Julien Duponchelle
2026-02-02 09:39:20 +01:00
parent 1c5eaaa52b
commit 99f5aaaca2
+3 -2
View File
@@ -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)