# trans-api-test **Repository Path**: tansx1/trans-api-test ## Basic Information - **Project Name**: trans-api-test - **Description**: 接口自动化框架 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-04-20 - **Last Updated**: 2024-04-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 业务系统自动化测试框架。 #### UI : Python3+Selenium3+Allure+Jenkins #### API: Python3+Requests+Allure+Jenkins ##### Requirement: python v3.7 pip install -r requirements.txt #### Usage: 1.在`run.py`中指定要运行的测试脚本 ``` # 用pytest 运行 suites文件下的test_logins.py脚本,并在logs文件下生成日志文件 subprocess.call(['py.test', '--alluredir=logs', 'suites/test_logins.py']) ``` 2.在项目目录下执行 ```python python run.py --env sit # --env 选项指定运行环境,sit ``` 然后在浏览器中打开`logs/report/index.html`查看结果。 Windows系统下,在终端下依次执行如下命令,即可查看结果。 ```python py.test -m "not ngr" --alluredir=logs suites\test_logins.py --country=tzs allure generate logs -o logs\report --clean allure open logs\report ``` * -m按用例mark跑,公共用例不标记,国家特有的标记国家(坦桑:tzs,尼日利亚:ngr)。则"not ngr":跑坦桑, "not tzs":跑尼日利亚 * --country 自定义国家参数,会写入配置文件内,用于区分不同国家的固定手机序列