Add Chrome for Testing support for reliable WebDriver automation

- Add setup script (scripts/setup-chrome-for-testing.sh) that downloads
  matching Chrome and ChromeDriver versions from Google's CDN
- Add chrome_binary config option to specify custom Chrome binary path
- Update ChromeDriver to support custom binary via with_port_headless_and_binary()
- Update README with Chrome for Testing setup instructions
- Update config.example.toml with chrome_binary documentation

Chrome for Testing is Google's dedicated browser for automated testing
that guarantees version compatibility with ChromeDriver, avoiding the
common 'version mismatch' errors when Chrome auto-updates.
This commit is contained in:
Dhanji R. Prasanna
2025-12-15 17:02:30 +11:00
parent d142cdfffe
commit 81cba42c8d
6 changed files with 165 additions and 3 deletions

View File

@@ -110,6 +110,12 @@ chrome_port = 9515
# Safari opens a visible browser window
# Chrome headless runs in the background without a visible window
browser = "chrome-headless"
# Optional: Path to Chrome binary (e.g., Chrome for Testing)
# If not set, ChromeDriver will use the default Chrome installation
# Use this to avoid version mismatch issues between Chrome and ChromeDriver
# Run: ./scripts/setup-chrome-for-testing.sh to install matching versions
# chrome_binary = "/Users/yourname/.chrome-for-testing/chrome-mac-arm64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing"
# chrome_binary = "/Users/yourname/.chrome-for-testing/chrome-mac-x64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing"
[macax]
enabled = false