()
| 43 | |
| 44 | # Ensure Playwright browsers are installed |
| 45 | def install_playwright_browsers(): |
| 46 | console.print("[dim]Installing Playwright browsers...[/dim]") |
| 47 | try: |
| 48 | # Simulate the `playwright install` command |
| 49 | os.system(f"{sys.executable} -m playwright install chromium") |
| 50 | console.print("[dim]Playwright browsers ready.[/dim]") |
| 51 | except KeyboardInterrupt as ki: |
| 52 | handle_keyboard_interrupt(ki) |
| 53 | raise |
| 54 | except Exception as e: |
| 55 | console.print( |
| 56 | f"[bold red]Failed to install Playwright browsers:[/bold red] {e}" |
| 57 | ) |
| 58 | sys.exit(1) |
| 59 | |
| 60 | |
| 61 | def _find_free_port(start: int = 9123) -> int: |
no test coverage detected