A modern test case management system built with Flask and Vue 3, supporting Excel file batch upload, project management, test case viewing, and AI-powered intelligent generation functionalities.
- Project Management: Create, edit, and delete projects with descriptions and maintainer information
- Excel Batch Upload: Support for .xlsx format file uploads with intelligent Excel content parsing
- Duplicate Detection: Automatic detection of duplicates within files and in the database
- Smart Import: Selective import support with ability to assign new IDs to duplicate cases
- Test Case Viewing: View associated test cases by project with detailed case information display
- AI Test Case Generation: Intelligent test case generation based on documents, supporting multiple test types
- Responsive Interface: Modern UI design with sidebar navigation support
- Separation of Frontend and Backend: Flask RESTful API with Vue 3 SPA
- Database Support: MySQL database with support for complex queries and associations
- File Processing: Excel file parsing and validation capabilities
- AI Integration: Integration with AutoGen framework and OpenAI models for intelligent test case generation
- Document Processing: Support for Word, PDF, Markdown and other document formats
- Error Handling: Comprehensive exception handling with user-friendly error messages
- Component Communication: Event-based inter-component communication mechanism
- Python 3.8+
- Flask: Web framework
- Flask-CORS: Cross-origin support
- Flask-MySQLdb: MySQL database connection
- openpyxl: Excel file processing
- Werkzeug: File upload handling
- AutoGen: AI agent framework
- OpenAI: AI model integration
- Browser-use: Web automation
- Playwright: Browser automation
- Document processing: python-docx, PyPDF2, markdown
- Vue 3: Progressive JavaScript framework
- Vue Router: Routing management
- Element Plus: UI component library
- Axios: HTTP client
- Vite: Build tool
- MySQL 5.7+: Relational database
- Python 3.8 or higher
- Node.js 20.19+ or 22.12+
- MySQL 5.7 or higher
- Git
The project uses the following key Python packages:
- Web Framework: Flask, Flask-CORS, Flask-MySQLdb
- AI & Automation: autogen, openai, browser_use, playwright
- Document Processing: python-docx, PyPDF2, markdown, pandas, openpyxl
- Development Tools: pytest, black, isort, flake8
- Utilities: python-dotenv, pydantic, asyncio, tenacity
The frontend uses the following key packages:
- Framework: Vue 3, Vue Router
- UI Library: Element Plus
- Build Tool: Vite
- HTTP Client: Axios
JoinTestCase/
├── backend/ # Backend code
│ ├── app.py # Flask application main file
│ ├── models/ # Data models
│ │ ├── __init__.py
│ │ └── db.py # Database connection
│ ├── routes/ # Routing modules
│ │ ├── __init__.py
│ │ ├── project.py # Project management routes
│ │ ├── test_case.py # Test case routes
│ │ ├── upload.py # File upload routes
│ │ └── ai_generate.py # AI test case generation routes
│ ├── ai_test_cases/ # AI testing system
│ │ ├── src/ # AI system source code
│ │ │ ├── agents/ # AI agents
│ │ │ ├── services/ # AI services
│ │ │ ├── templates/ # Test case templates
│ │ │ └── utils/ # AI utilities
│ │ ├── docs/ # Document storage
│ │ └── requirements.txt # AI system dependencies
│ └── uploads/ # Uploaded file storage directory
├── frontend/ # Frontend code
│ ├── src/
│ │ ├── api/ # API interfaces
│ │ │ └── case.js # Test case related APIs
│ │ ├── assets/ # Static resources
│ │ ├── components/ # Vue components
│ │ ├── views/ # Page components
│ │ │ ├── ManageCase.vue # Project management page
│ │ │ ├── UploadCase.vue # Test case upload page
│ │ │ └── AiGenerateCase.vue # AI test case generation page
│ │ ├── App.vue # Root component
│ │ ├── main.js # Application entry point
│ │ └── router.js # Routing configuration
│ ├── index.html # HTML template
│ ├── package.json # Dependency configuration
│ └── vite.config.js # Vite configuration
├── requirements.txt # Python dependencies (root level)
├── config.py # Database configuration
├── db_init.sql # Database initialization script
├── read_excel.py # Excel reading tool
└── 登录测试用例.xlsx # Sample Excel file
CREATE TABLE projects (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
description TEXT,
maintainers VARCHAR(255) DEFAULT ''
);CREATE TABLE test_cases (
id INT AUTO_INCREMENT PRIMARY KEY,
case_id VARCHAR(64) NOT NULL,
title VARCHAR(255),
description TEXT,
preconditions TEXT,
steps TEXT,
expected_results TEXT,
priority VARCHAR(50),
category VARCHAR(100),
status VARCHAR(50),
created_at DATETIME,
updated_at DATETIME,
created_by VARCHAR(100),
last_updated_by VARCHAR(100),
project_id INT,
FOREIGN KEY (project_id) REFERENCES projects(id)
);
-- Add unique constraint within project to ensure case_id uniqueness within the same project
ALTER TABLE test_cases ADD UNIQUE INDEX unique_case_id_per_project (project_id, case_id);CREATE TABLE project_cases (
id INT AUTO_INCREMENT PRIMARY KEY,
project_id INT,
test_case_id INT,
FOREIGN KEY (project_id) REFERENCES projects(id),
FOREIGN KEY (test_case_id) REFERENCES test_cases(id)
);CREATE TABLE `ai_test_generation_history` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`case_types` json DEFAULT NULL,
`priority_distribution` json DEFAULT NULL,
`total_cases` int(11) DEFAULT '0',
`functional_test_count` int(11) DEFAULT '0',
`api_test_count` int(11) DEFAULT '0',
`ui_auto_test_count` int(11) DEFAULT '0',
`estimated_file_size` bigint(20) DEFAULT NULL,
`generated_at` datetime DEFAULT NULL,
`filename` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `idx_generated_at` (`generated_at`),
KEY `idx_filename` (`filename`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;- Python 3.8+
- Node.js 20.19.0+
- MySQL 5.7+
git clone <repository-url>
cd JoinTestCase# Install all Python dependencies from requirements.txt
pip install -r requirements.txt
# Or install core dependencies manually
pip install flask flask-cors flask-mysqldb openpyxl werkzeug python-dotenv autogen openai asyncio pydantic fastapi uvicorn browser_use playwright python-docx PyPDF2 markdown pandas python-multipart aiofiles typing tenacity numpy matplotlib pytest pytest-asyncio pytest-cov black isort flake8- Create MySQL database
CREATE DATABASE testcase_manager CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;- Modify database configuration in
config.py
class Config:
MYSQL_HOST = 'localhost'
MYSQL_PORT = 3306
MYSQL_USER = 'your_username'
MYSQL_PASSWORD = 'your_password'
MYSQL_DB = 'testcase_manager'
MYSQL_CURSORCLASS = 'DictCursor'- Initialize database
mysql -u your_username -p testcase_manager < db_init.sqlcd backend
python app.pyBackend service will start at http://localhost:5000
cd frontend
npm install- Navigate to AI system directory
cd backend/ai_test_cases- Create environment configuration file
# Create .env file
touch .env- Configure AI interface parameters
# Edit .env file and add the following configuration
QWEN_BASE_URL='https://your-ai-api-endpoint.com/v1'
QWEN_API_KEY='your-api-key-here'
QWEN_MODEL='qwen-turbo' # or other supported model names
# If using OpenAI, you can configure
OPENAI_API_KEY='your-openai-api-key'
OPENAI_BASE_URL='https://api.openai.com/v1'- Install AI system dependencies
pip install -r requirements.txtnpm run devFrontend application will start at http://localhost:5173
- Create Project: Click the "Create Project" button and fill in project name, description, and maintainers
- Edit Project: Click the "Edit" button in the project list to modify project information
- Delete Project: Click the "Delete" button and confirm to delete the project (also deletes associated test cases)
- Select Project: Choose the project to import test cases into on the upload page
- Upload File: Click the "Select File" button and choose an Excel file in .xlsx format
- Preview Data: The system will automatically parse the Excel content and display a preview
- Handle Duplicates:
- The system automatically detects duplicate case IDs
- Duplicate cases will be highlighted with a red background
- New IDs can be assigned to duplicate cases
- Select Import: Check the cases to import and click "Import Selected Cases"
- View Project Cases: Click the "View Cases" button on the project management page
- View Case Details: Click the "View" button in the case list to see complete case information
- Upload Documents: Upload requirement documents in the AI generation page (supports Word, PDF, Markdown and other formats)
- Configure Parameters:
- Select test type (Functional Testing, API Testing, UI Automation Testing)
- Set concurrency (1-5)
- Specify output filename
- Start Generation: Click the "Start Generation" button, the system will automatically analyze documents and generate test cases
- Monitor Progress: The system displays generation progress and status
- View Results: After completion, view and download generated test case files in the download center
GET /project- Get all projectsPOST /project- Create a new projectPUT /project/{id}- Update a projectDELETE /project/{id}- Delete a projectGET /project/{id}/testcases- Get test cases associated with a project
POST /upload_case- Upload Excel file and parsePOST /import_case- Import selected test cases
POST /ai_generate/upload- Upload requirement documentsPOST /ai_generate/generate- Generate test casesGET /ai_generate/files- Get list of generated filesGET /ai_generate/download/{filename}- Download generated test case filesGET /ai_generate/summary- Get generation result summaryGET /ai_generate/latest_summary- Get latest generation summary
- Modern UI: Modern interface design based on Element Plus
- Responsive Layout: Adapts to different screen sizes
- Sidebar Navigation: Clear navigation structure
- Card Layout: Well-organized information hierarchy
- Smart Tables: Adaptive column widths with sorting and filtering support
- Modal Operations: Modal dialog-based create, update, and delete operations
- Real-time Feedback: Immediate feedback on operations
- Error Messages: User-friendly error information display
- Progress Display: Real-time progress display for AI generation process
- Format Support: Supports only .xlsx format
- Column Mapping: Automatically identifies Excel headers and maps to database fields
- Data Cleaning: Automatically handles null values and special characters
- Duplicate Detection: Intelligent detection of duplicates within files and in the database
- Document Parsing: Intelligent parsing support for multiple document formats
- Test Case Types: Support for three types: Functional Testing, API Testing, UI Automation Testing
- Intelligent Analysis: AI model-based requirement analysis and test case design
- Batch Generation: Support for batch generation of large numbers of test cases
- Quality Assurance: Generated test cases include complete test steps and expected results
- File Format Validation: Ensures uploaded files are valid format
- Data Integrity: Validates the presence of required fields
- ID Uniqueness: Ensures test case ID uniqueness
- File Upload Errors: Handles file format errors and upload failures
- Database Errors: Handles database connection and operation exceptions
- Network Errors: Handles API request timeouts and network exceptions
- AI Generation Errors: Handles AI model call failures and generation exceptions
Problem: Errors occur during AI test case generation process Solutions:
- Check if AI interface configuration is correct
- Confirm if API key is valid
- Check network connection stability
- View backend logs for detailed error information
Problem: Unable to connect to MySQL database Solutions:
- Check if database service is running
- Confirm database connection parameters are correct
- Check firewall settings
- Verify database user permissions
Problem: Proxy errors such as ECONNRESET occur Solutions:
- Restart frontend and backend services
- Check if ports are occupied
- Confirm Vite proxy configuration is correct
- Check network connection stability
Problem: Errors occur during file upload process Solutions:
- Check if file format is supported
- Confirm file size is within limits
- Check upload directory permissions
- Verify file content integrity
- Backend Logs: View error information output in console
- Frontend Logs: View error information in browser console
- Database Logs: View MySQL error logs
- Backend Deployment: Deploy Flask application using Gunicorn or uWSGI
- Frontend Build: Run
npm run buildto build production version - Static File Serving: Use Nginx to serve frontend static files
- Database Optimization: Configure MySQL performance parameters and indexes
# Database configuration
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=your_username
MYSQL_PASSWORD=your_password
MYSQL_DB=testcase_manager
# Flask configuration
FLASK_ENV=production
FLASK_SECRET_KEY=your_secret_key
# AI interface configuration
QWEN_BASE_URL=https://your-ai-api-endpoint.com/v1
QWEN_API_KEY=your-api-key
QWEN_MODEL=qwen-turbo- Database Optimization: Add appropriate indexes, optimize query statements
- Caching Strategy: Use Redis to cache frequently accessed data
- Load Balancing: Use Nginx for load balancing
- Monitoring and Alerting: Configure system monitoring and alerting mechanisms
- Fork the project
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Manual test case addition functionality
- Execution logs
- Test case execution functionality
- Test report generation
- User permission management
- ✅ Optimized AI test case generation user experience
- ✅ Fixed issue where file selection clears generation summary
- ✅ Fixed test case type display issues
- ✅ Optimized download center popup title styling
- ✅ Improved error handling and user prompts
- ✅ AI generation capabilities (fully developed) integrated into test case platform
- ✅ Real-time display of generated test case summary data
- ✅ Support for multiple test types (Functional Testing, API Testing, UI Automation Testing)
- ✅ Intelligent document parsing and test case generation
- ✅ Generation history records and statistics
- Basic project management functionality
- Excel file upload and parsing
- Test case batch import
- Duplicate data detection and handling
- Responsive web interface
This project is licensed under the MIT License - see the LICENSE file for details
For issues or suggestions, please contact through the following channels:
- Project Issues: GitHub Issues
- Email: maz9366@163.com
Note: Ensure to modify default database passwords and other sensitive configuration information in production environments.

