If you're using Python 3.13, you may encounter compilation errors for certain packages.
# Upgrade pip and setuptools first
pip install --upgrade pip setuptools wheel
# Then run the test script
test\run_tests.bat# Create virtual environment
python -m venv venv
# Activate (Windows)
venv\Scripts\activate
# Activate (Linux/Mac)
source venv/bin/activate
# Run tests
test\run_tests.batError:
fatal error C1083: 无法打开包括文件: "math.h"
Solution: This is a Python 3.13 specific issue with greenlet. The updated requirements.txt uses compatible versions that should resolve this.
If it persists, try:
pip install --upgrade greenletError:
Failed to install Playwright browsers
Solution:
# Try installing browsers separately
playwright install chromium
# Or use system browsers
set PLAYWRIGHT_BROWSERS_PATH=0Error:
Address already in use
Solution:
# Windows
netstat -ano | findstr :5000
taskkill /F /PID <PID>
# Linux/Mac
lsof -ti:5000 | xargs kill -9Error:
timeout: TimeoutError
Solution:
- Check internet connection
- Verify API URL is accessible:
curl https://llmapi.paratera.com - Check firewall settings
- Try increasing timeout in frontend_ui_test.py
Error:
'curl' is not recognized
Solution:
- Install curl on Windows: https://curl.se/windows/
- Or use PowerShell's
Invoke-WebRequest
If automated tests don't work, you can test manually:
cd backend
python app.pycd frontend
python -m http.server 8000# Test backend
curl http://localhost:5000
# Test login
curl -X POST http://localhost:5000/login -H "Content-Type: application/json" -d "{\"username\":\"test\",\"password\":\"test\"}"Open http://localhost:8000 in your browser and test:
- Login with non-existent user
- Register a new user
- Login with correct credentials
- Login with wrong password
If you continue to have issues:
-
Check logs:
test/backend.log- Backend server logstest/frontend.log- Frontend server logs
-
Run with verbose output:
- Remove
-qflags from run_tests.bat/run_tests.sh
- Remove
-
Check Python version:
python --version
Recommended: Python 3.10, 3.11, or 3.12
-
Verify dependencies:
pip list
You can configure the test suite with environment variables:
# Windows CMD
set AI_API_KEY=your_key
set AI_API_URL=your_url
set AI_MODEL=your_model
# Windows PowerShell
$env:AI_API_KEY="your_key"
$env:AI_API_URL="your_url"
$env:AI_MODEL="your_model"
# Linux/Mac
export AI_API_KEY=your_key
export AI_API_URL=your_url
export AI_MODEL=your_modelIf Playwright Chromium doesn't work, you can use other browsers:
- Install browser:
playwright install firefox - Modify
frontend_ui_test.py:browser = await p.firefox.launch(headless=False)