{"id":31789441,"url":"https://github.com/echoxiawan/aitestcase","last_synced_at":"2025-10-10T14:51:48.557Z","repository":{"id":283946416,"uuid":"953370104","full_name":"Echoxiawan/AITestCase","owner":"Echoxiawan","description":"A生成测试用例:基于页面和需求文档内容结合自动生成测试用例，解决单个需求文档生成测试用例质量较差的问题。Test Case Generation: Automatically generate test cases based on the current page and requirement document content, solving the problem of poor quality test cases generated from a single requirement document.","archived":false,"fork":false,"pushed_at":"2025-04-07T07:42:09.000Z","size":532,"stargazers_count":11,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T08:28:32.886Z","etag":null,"topics":["ai","deepseek","gpt","testcase"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Echoxiawan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-23T07:43:24.000Z","updated_at":"2025-04-07T07:42:13.000Z","dependencies_parsed_at":"2025-03-23T08:38:34.420Z","dependency_job_id":null,"html_url":"https://github.com/Echoxiawan/AITestCase","commit_stats":null,"previous_names":["echoxiawan/aitestcase"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Echoxiawan/AITestCase","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Echoxiawan%2FAITestCase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Echoxiawan%2FAITestCase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Echoxiawan%2FAITestCase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Echoxiawan%2FAITestCase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Echoxiawan","download_url":"https://codeload.github.com/Echoxiawan/AITestCase/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Echoxiawan%2FAITestCase/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004183,"owners_count":26083689,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","deepseek","gpt","testcase"],"created_at":"2025-10-10T14:51:35.087Z","updated_at":"2025-10-10T14:51:48.551Z","avatar_url":"https://github.com/Echoxiawan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AITestCase\n[English ](doc/README_EN.md) | [中文](doc/README_CN.md)\nA tool for generating test cases based on the current webpage and requirement documents.\n\n## Features\n\n- 📋 **Test Case Generation**: Automatically generate test cases based on the current page and requirement document content, solving the problem of poor quality test cases generated from a single requirement document.\n- 🔐 **Multiple Login Methods**: Supports login with username/password and cookies.\n- 📊 **Excel Export**: Supports exporting test cases to Excel format.\n- 📝 **Requirement Association**: Automatically associates test cases with requirement documents.\n- 🛠️ **Customizable**: Flexible configuration options to suit different project needs.\n- 📄 **Multiple Document Formats**: Supports requirement documents in various formats including plain text, Markdown, and Word (DOCX).\n- 🌐 **Web Interface**: Provides a beautiful and user-friendly web interface for easier use.\n\n## Installation Steps\n\n1. Ensure Python 3.9 or higher is installed.\n2. Clone or download this repository.\n3. Install dependencies:\n   ```\n   pip install -r requirements.txt\n   ```\n4. Install Playwright:\n   ```\n   playwright install\n   ```\n\n## Usage\n\n### Web Interface\n\nYou can use the web interface for a more user-friendly experience:\n\n```bash\n# Start the web interface\npython main.py --web\n```\n\n\nThen open your browser and navigate to `http://localhost:5000` to access the interface.\n\n\u003e **Note**: You can change the default port by setting the `APP_PORT` environment variable in your `.env` file.\n\n![AITestCase Web Interface](doc/页面.png)\n\nThe image above shows the AITestCase web interface where you can configure test parameters such as URL, login method, and requirement documents in a simple and intuitive way.\n\n![AITestCase Result Page](doc/页面2.png)\n\nThe image above shows the result page after AITestCase generates test cases, where you can view test results and download the Excel file.\n\n### Basic Usage\n\n### Command Line Usage\n\n```bash\n# Basic usage\npython main.py --url \u003cwebsite URL\u003e\n\n# Login with username and password\npython main.py --url \u003cwebsite URL\u003e --username \u003cusername\u003e --password \u003cpassword\u003e\n\n# Login with cookies\npython main.py --url \u003cwebsite URL\u003e --cookies \"\u003ccookie string\u003e\"\n\n# Use requirements documents (supports .txt, .md, .docx)\npython main.py --url \u003cwebsite URL\u003e --requirements \"requirement1.docx,requirement2.md,requirement3.txt\"\n```\n\n### Cookie Login Support\n\nThis tool supports multiple cookie formats:\n\n1. **Key-Value Format** (common in browser developer tools):\n   ```\n   cookie1=value1; cookie2=value2; JSESSIONID=123456789; auth_token=abcdefg\n   ```\n\n### Example\n\n```bash\n# Login with key-value format cookies\npython main.py --url https://example.com --cookies \"session=abc123; token=xyz789\"\n```\n\n### Command Line Parameters\n\n```\npython main.py --url https://example.com --username user --password pass\n```\n\n### Use AI to Identify Login Elements\n\n```\npython main.py --url https://example.com --login-url https://example.com/login --username user --password pass --use-ai-login\n```\n\nThis will use AI to automatically identify form elements on the login page, more accurately locating the login form than traditional methods.\n\nView all available parameters:\n\n```\npython main.py --help\n```\n\n## Configuration Options\n\nConfiguration files are located in the `config/` directory, where you can modify the following settings:\n\n- `settings.py`: General settings\n- `user_agents.py`: User agent strings\n\n## Correct Use of Cookie Login\n\nCookie strings can be in one of the following formats:\n\n1. **Standard Key-Value**:\n```\ncookieName=cookieValue; otherCookie=otherValue\n```\n\n## Open Source License\n\n   GPL License\n\n## Troubleshooting\n\n### Cookie Issue Troubleshooting\n\nIf you encounter cookie-related issues, try the following steps to troubleshoot:\n\n1. **Check Cookie Format**: Ensure the cookie format is correct, preferably using the browser developer tools to export cookies\n   ```bash\n   # Copy cookies in Chrome browser\n   1. Open Developer Tools (F12)\n   2. Switch to the Application/Network tab\n   3. Find the cookies or the cookie header in the request\n   4. Copy the complete cookie string\n   ```\n\n2. **View Detailed Logs**: Modify `config/settings.py` to set the log level to DEBUG\n   ```python\n   # Set in config/settings.py\n   LOG_LEVEL = \"DEBUG\"  # Options: DEBUG, INFO, WARNING, ERROR\n   ```\n\n3. **Try Other Login Methods**: If cookie login continues to fail, try username/password login\n   ```bash\n   python main.py --url https://example.com --username user --password pass\n   ```\n\n### View Browser Interface\n\nIf you need to see the browser operation process, use the `--show` parameter:\n\n```bash\npython main.py --url https://example.com --cookies \"sessionid=abc123\" --show true\n```\n\nThis is particularly useful for debugging cookie and login issues, allowing you to observe the actual behavior and redirection of the browser.\n\n## Documentation Links\n\n- [Usage Guide](doc/USAGE_EN.md)\n\n## WeChat Contact\n\n\u003cimg src=\"doc/contact.jpg\" alt=\"Contact QR Code\" style=\"width: 30%; height: auto;\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fechoxiawan%2Faitestcase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fechoxiawan%2Faitestcase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fechoxiawan%2Faitestcase/lists"}