generate_testsLABSCO SUMMARY
Generate, run, then read the report — all three, not just the first.
Test generators are common and the output usually sits unrun; having execution and report analysis as their own tools closes the loop, so the model can see what its tests actually did. The report analysis accepting XML, JSON and HTML means it also works on results from a run you did yourself.
What it is
A Python server that uses Gemini to write tests for your code and then execute them. It analyses the codebase first to understand structure and dependencies, generates pytest functions with fixtures covering positive, negative and edge cases, drives browsers through Playwright for end-to-end runs, and reads the resulting report back.
What you get
generate_tests(code_path, test_type)writes tests —test_typetakes unit, integration, e2e, api or allrun_tests(test_type, target_path)executes them, defaulting totests/analyze_test_report(report_path)reads an XML, JSON or HTML report and returns insights and recommendations rather than a raw pass count- Unit generation handles both sync and async code; integration tests cover module interactions with mocking; E2E uses Playwright and captures screenshots
- Built for large codebases: modular chunked analysis, incremental generation, and parallel runs through pytest-xdist
Requirements
Python 3.11 or newer, a Google API key for Gemini passed as GOOGLE_API_KEY, Git, and an MCP-capable editor. Clone the repository, create a virtualenv, pip install -e ., then playwright install to fetch the browsers — E2E tests will not run without that step. Register it with claude mcp add test-automator <YOUR_PATH_TO_TEST_AUTOMATOR>/.venv/bin/test-automator -e "GOOGLE_API_KEY=<YOUR_GOOGLE_API_KEY>", or add the equivalent stdio entry to your config. On WSL, E2E runs need DISPLAY set.
Setup effort
Build from source — git clone https://github.com/iamsnh01/test-automator.git
USE CASES
Getting coverage onto code that has none
Point it at the path and generate the test types you want.
Checking a change didn't break anything
Run the generated suite and read the outcome.
Understanding a failing report
Hand it the results file and get specific recommendations back.
Testing a user journey rather than a function
Generate E2E tests that drive a real browser through the flow.
3 tools
Listed in project docs. Your client may show a different list.
run_testsanalyze_test_reportBEFORE YOU INSTALL
What to know first
Tools you get
3 tools named in the project's documentation.
Requires
- Python 3.11+
- GOOGLE_API_KEY in your environment
INSTALLATION
Connect your client
This one is built from source rather than installed with a single command.
Server setup
git clone https://github.com/iamsnh01/test-automator.git
cd test-automator
python3.11 -m venv .venv
source .venv/bin/activate
pip install -e .
playwright installMCP Clients
Claude Code
claude mcp add test-automator "<YOUR_PATH_TO_TEST_AUTOMATOR>/.venv/bin/test-automator" -e "GOOGLE_API_KEY=<YOUR_GOOGLE_API_KEY>"Claude Code — manual config
{
"projects": {
"<YOUR_PROJECT_PATH>": {
"mcpServers": {
"test-automator": {
"type": "stdio",
"command": "<YOUR_PATH_TO_TEST_AUTOMATOR>/.venv/bin/test-automator",
"env": {
"GOOGLE_API_KEY": "<YOUR_GOOGLE_API_KEY>"
}
}
}
}
}
}