A cross-platform command-line tool that executes natural language test cases using Claude MCP Protocol and Playwright.
- Natural language test case execution from
.test.mdfiles - Cross-platform support (Windows, macOS, Linux)
- Environment-based configuration
- Playwright-based browser automation
- Rich console output
- Clean dependency management with UV
- Automated test runner with nice reporting
- Python 3.9 or higher
- Git
- Internet connection (for installing dependencies)
# Clone the repository
git clone <your-repo-url>
cd <repo-directory>
# Make the setup script executable
chmod +x setup.sh
# Run the setup script
./setup.sh# Clone the repository
git clone <your-repo-url>
cd <repo-directory>
# Run the setup script (you may need to set execution policy)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
.\setup.ps1The setup scripts will:
- Install UV if not already installed
- Create a virtual environment
- Install all dependencies
- Install Playwright browsers
- Create a template .env file
If you prefer to set up manually or the setup scripts don't work for you:
# Install UV
curl -LsSf https://github.com/astral-sh/uv/releases/latest/download/uv-installer.sh | sh
# Create and activate virtual environment
uv venv
source .venv/bin/activate # On Unix
.\.venv\Scripts\Activate.ps1 # On Windows
# Install dependencies
uv pip install -e .
# Install Playwright browsers
playwright install chromium
# Create .env file
echo "ANTHROPIC_API_KEY=your_key_here" > .envnltest new my_testThis creates a new test file at tests/my_test.test.md with a template structure.
You can run tests in several ways:
For the best experience with nice formatting and reporting:
On Unix-like systems:
./run_tests.shOn Windows:
.\run_tests.ps1The test runner will:
- Find all
.test.mdfiles in thetestsdirectory - Run each test with proper environment setup
- Show progress with colored output
- Provide a summary of passed/failed tests
- List any failed tests for easy reference
For more control over test execution:
# Run a single test file
nltest run tests/my_test.test.md nltest/server.py
# Run all tests in a directory
nltest run tests nltest/server.pyCreate test files with .test.md extension using the following format:
# Test Case: Login Flow
## Setup
- Navigate to login page
- Clear any existing sessions
## Steps
1. Enter username "testuser@example.com"
2. Enter password "password123"
3. Click login button
## Assertions
- Should see welcome message
- URL should contain "/dashboard"Required environment variables in .env:
ANTHROPIC_API_KEY: Your Claude API key
To set up a development environment:
# Clone the repository
git clone <your-repo-url>
cd <repo-directory>
# Create development environment
uv venv
source .venv/bin/activate # On Unix
.\.venv\Scripts\Activate.ps1 # On Windows
# Install in editable mode
uv pip install -e .-
UV Installation Fails
- Ensure you have appropriate permissions
- Try installing manually from the UV GitHub releases
-
Virtual Environment Issues
- Delete the
.venvdirectory and try creating it again - Ensure Python 3.9+ is in your PATH
- Delete the
-
Playwright Installation
- If browser installation fails, try running
playwright installmanually - Check system requirements for Playwright
- If browser installation fails, try running
-
API Key Issues
- Ensure your Anthropic API key is correctly set in
.env - Check that the
.envfile is in the correct location
- Ensure your Anthropic API key is correctly set in
-
Test Runner Issues
- Make sure the virtual environment is activated
- Check that the server script exists at
nltest/server.py - Verify all test files have the
.test.mdextension - Look for error messages in the colored output
If you encounter issues:
- Check the error message carefully
- Verify your Python version (
python --version) - Check UV is installed correctly (
uv --version) - Ensure all environment variables are set
- Try running the setup script again
[Your License Here]