Webwright
Webwright copied to clipboard
fix: check any provider API key in doctor command
Summary
check_openai_key()renamed tocheck_api_key()and now acceptsOPENAI_API_KEY,ANTHROPIC_API_KEY, orOPENROUTER_API_KEY- Users with Anthropic-only or OpenRouter-only setups no longer see a false FAIL
Why
The doctor command advertises support for three providers but only validated the OpenAI key. A user who configured only ANTHROPIC_API_KEY would see FAIL: No API key found even though their environment is valid.
Changes
src/webwright/run/doctor.py: renamed function and extended check to three env varstests/unit/test_doctor.py: updated existing tests and added Anthropic/OpenRouter cases
Testing
pytest tests/unit/test_doctor.py -v
tests/unit/test_doctor.py::test_check_python PASSED
tests/unit/test_doctor.py::test_check_playwright PASSED
tests/unit/test_doctor.py::test_check_chromium PASSED
tests/unit/test_doctor.py::test_check_screenshot PASSED
tests/unit/test_doctor.py::test_check_api_key_openai PASSED
tests/unit/test_doctor.py::test_check_api_key_anthropic PASSED
tests/unit/test_doctor.py::test_check_api_key_openrouter PASSED
tests/unit/test_doctor.py::test_check_api_key_missing PASSED
tests/unit/test_doctor.py::test_plugin_manifests_exist PASSED
tests/unit/test_doctor.py::test_plugin_manifests_missing PASSED
tests/unit/test_doctor.py::test_screenshot_file_cleanup PASSED
11 passed in 0.15s