[![Downloads](https://pepy.tech/badge/xiaobaiauto2)](https://pepy.tech/project/xiaobaiauto2)
[![Downloads](https://pepy.tech/badge/xiaobaiauto2/month)](https://pepy.tech/project/xiaobaiauto2/month)
[![Downloads](https://pepy.tech/badge/xiaobaiauto2/week)](https://pepy.tech/project/xiaobaiauto2/week)
[![Downloads](https://img.shields.io/badge/xiaobaiauto2-ππ-green)](https://img.shields.io/badge/xiaobaiauto2-success-green)
---
# 简介
xiaobaiauto2是一套自动化框架,功能覆盖UI自动化与API自动化 意在帮助对自动化有更多需求且过多时间写代码的人群,让大家的时间
花在业务的实现上,本库已放弃!!!推荐使用[xiaobaisaf](https://pypi.org/project/xiaobaisaf "xiaobaisaf的使用方法")
----
## 架构
![Image text](xiaobaiauto2.png)
## 开始使用
#### 安装
`pip install xiaobaiauto2 `
`pip install xiaobaiauto2[all] # 安装全部依赖`
#### 项目目录
test
|
|--__init__.py
|
|--WebTest
| |
| |--conftest.py
| |--test_WebUI.py
|
|--APPTest
| |
| |--conftest.py
| |--test_Manzhai_APP_Case1.py
| |--test_Manzhai_APP_Case2.py
|
|--APITest
| |
| |--test_cases.py
| |--yewua.py
#### 关键词
| 序号 | CMD | key |
| :--- | :--- | :--- |
| 1 | 打开网页 | URL |
|2 | 点击 | CLICK |
|3 | 输入 | SENDKEY |
|4 | 刷新 | REFRESH |
|5 | 后退 | BACK |
|6 | 关闭 | CLOSE |
|7 | 退出 | QUIT |
|8 | 标签 | TAG |
|9 | 属性 | ATTR |
|10 | URL | CURL |
|11 | 标题 | ITLE |
|12 | 内嵌页 | FRAME |
|13 | 标签页[序号(1开始)] | WINDOW |
|14 | JS_确定 | ALERT0 |
|15 | JS_取消 | ALERT1 |
|16 | JS_输入框 | ALERT2 |
|17 | JS_文本 | ALERT3 |
|18 | 停止 | WAIT |
|19 | 脚本 | SCRIPT |
|20 | 添加cookie | ADDCOOKIE |
|21 | 滑屏 | SWIPE |
|22 | 截屏 | DSCREENSHOT |
|23 | 元素截图 | ESCREENSHOT |
|24 | 识别验证码 | FINDTEXT |
|25 | 坐标 | LOCATION |
|26 | 网页源码 | PAGESOURCE |
#### 调用模板修改脚本
参考test目录下面的脚本
@pytest.mark.xiaobai_web
def test_Case1(browser):
web_action(browser, cmd=cmd.打开网页, loc='', data='http://www.baidu.com')
web_action(browser, cmd=cmd.输入, loc='//*[@id="kw"]', data='小白科技')
web_action(browser, cmd=cmd.点击, loc='//*[@id="su"]')
web_action(browser, cmd=cmd.wait, data=3)
web_action(browser, cmd=cmd.标题, contains_assert='小白')
关键词的使用,看上面示例亦可(xiaobaiauto2>0.1.5.0)
- 1 导入cmd类
from xiaobaiauto2.xiaobaiauto2 import cmd
- 2 cmd类调用属性
cmd.关键词
若感觉关键词不足以使用,可以直接使用原生方法,示例如下
browser.find_element_by_id('id属性值').click()
代码执行之前,若您需要发送邮件,请将`test_first`方法中的`email`的参数值进行自行修改即可
##### 备注
- 若APP测试需要获取toast信息可以写一个方法添加到自己的项目中,代码样例如下:
```
def find_toast(self, message, timeout, poll_frequency):
new_message = f"//*[@text=\'{message}\']"
element = WebDriverWait(self.driver, timeout, poll_frequency).until(
EC.presence_of_element_located((By.XPATH, new_message)))
return element.text
```
### 使用
#### 1、命令行运行脚本
pytest --html=report.html --self-contained-html
or
pytest --html=report.html --self-contained-html -m xiaobai_web
or
pytest --html=report.html --self-contained-html -o log_cli=true -o log_cli_level=INFO
#### 2、定时任务界面运行脚本(CMD命令)
xiaobaiauto2Timer
![Image text](xiaobaiauto2Timer.PNG)
#### 3.1、xiaobaiauto2Api将raw数据转换成python代码(版本>0.1.3.1可用)
xiaobaiauto2Api -h # 帮助文档提示
xiaobaiauto2Api -f *.txt -s *.py
xiaobaiauto2Api -f *.txt -x 2
xiaobaiauto2Api -f *.saz -x 2
xiaobaiauto2Api -f *.har -x 2
xiaobaiauto2Api -f *.har -x 3
xiaobaiauto2Api -d D:\example
#### 3.2、xiaobaiauto2 >= 0.1.4.5 支持c参数
xiaobaiauto2Api -c 1 -f 1.har,2.har
xiaobaiauto2Api -c 1 -f 1.har,2.har -d E:\example
xiaobaiauto2Api -c 1 -f 1.har,2.har -d E:\example -s 1_2_compare
xiaobaiauto2Api -c 1 -f 1.har.2.har -d E:\example -x 3 # 生成*.jmx(含提取器、参数化)[>=0.1.7.2]
#### 3.3、xiaobaiauto2 >= 0.1.5.5 支持t参数
xiaobaiauto2Api -t api // 生成api测试模板
xiaobaiauto2Api -t web // 生成web测试模板
xiaobaiauto2Api -t app // 生成app测试模板
#### 3.4、xiaobaiauto2 >= 0.1.6.3 支持i与v参数(请看3.6) 不指定版本默认安装最新版哦
xiaobaiauto2Api -i jdk -v 8 // 安装jdk8
xiaobaiauto2Api -i jmeter -v 5.3 // 安装jmeter5.3
xiaobaiauto2Api -i chromedriver -v 88 // 安装chromedriver的88版本
xiaobaiauto2Api -i allure -d "D:\Program Files" // 安装allure(会有些慢哦)
#### 3.5、xiaobaiauto2 >= 0.1.6.5 支持mock模拟接口
from xiaobaiauto2.xiaobaiauto2 import mock, MockServer
@mock(uri='/login', response={"errcode": 200, "msg": "登录成功", "data": {"token": "123456"}})
@mock(uri='/register', response={"errcode": 200, "msg": "注册成功", "data": {}})
@MockServer(uri='/index', response={"errcode": 200, "msg": "首页成功", "data": {}})
def run(): pass
if __name__ == '__main__':
run(port=7777)
- 导入mock方法
```
from xiaobaiauto2.xiaobaiauto2 import mock, MockServer
```
- 定义mock接口,mock与MockServer无区别,uri为接口路径,response为接口返回值,run为被装饰的函数名称可自定义
```
@mock(uri='/login', response={"errcode": 200, "msg": "登录成功", "data": {"token": "123456"}})
@mock(uri='/register', response={"errcode": 200, "msg": "注册成功", "data": {}})
@MockServer(uri='/index', response={"errcode": 200, "msg": "首页成功", "data": {}})
def run(): pass
```
- 启动mock接口服务, run为上面被装饰的方法名,port为监听的端口(默认6666)
```
if __name__ == '__main__':
run(port=7777)
```
- jmeter尝试?
```
api1: http://127.0.0.1:7777/login
api2: http://127.0.0.1:7777/register
api3: http://127.0.0.1:7777/index
```
#### 3.6、xiaobaiauto2 >= 0.1.6.6 支持软件自动安装与环境配置
- 默认环境为用户环境,配置的是用户环境变量,若要配置系统环境变量,请使用管理员运行即可
```
xiaobaiauto2Api -i jdk -v 8 -d D:\
xiaobaiauto2Api -i jmeter -v 5.3 -d D:\
xiaobaiauto2Api -i chromedriver -v 88
xiaobaiauto2Api -i jenkins -d D:\tomcat\webapps
xiaobaiauto2Api -i git
xiaobaiauto2Api -i node -v 15 -d D:\
```
#### 3.7、xiaobaiauto2 >= 0.1.8.3 支持软件自动安装与环境配置
- 管理系统代理服务器(查看、设置、关闭、验证)
```
xiaobaiauto2Proxy -h # 查看帮助文档
xiaobaiauto2Proxy # 查看系统代理是否开启
xiaobaiauto2Proxy -e 0 -p 127.0.0.1:8080 # 开启系统代理
xiaobaiauto2Proxy -e 1 # 关闭系统代理
xiaobaiauto2Proxy -c 1 # 验证系统代理是否可用
```
#### 3.8、xiaobaiauto2 >= 0.2 支持adb命令,**提前打开APP**
- 单设备监控APP的点击,点击的路径自动生成XPath表达式
```
xiaobaiauto2App
```
- 多设备单机监控APP的点击,点击的路径自动生成XPath表达式
```
xiaobaiauto2App -d 127.0.0.1:62001 // 指定设备号进行监控
xiaobaiauto2App -i 1 // 指定序号为1的设备进行监控
```
#### 其他帮助
- [163邮箱怎么开启SMTP发邮件](http://help.163.com/10/0312/13/61J0LI3200752CLQ.html)
- [QQ邮箱怎么开启SMTP发邮件](https://service.mail.qq.com/cgi-bin/help?subtype=1&id=28&no=166)
- [Pytest官网帮助文档](https://learning-pytest.readthedocs.io/zh/latest/doc/intro/getting-started.html)
- [Android调试桥(adb)官网帮助文档](https://developer.android.google.cn/studio/command-line/adb.html)
## 更新日志
| 版本 | 功能 |
|:--------|:--------------------------------------------------|
| 0.0.1 | 添加邮件发送,用例排序,chrome提示框禁止等等 |
| 0.1.0.1 | 添加自动执行任务功能及UI界面 |
| 0.1.1 | fix缺陷,cmd执行xiaobaiauto2Timer |
| 0.1.2 | fix缺陷 |
| 0.1.3 | 新增验证码识别,支持 *.png *.jpg *.jpeg ,新增部分关键词(暂已关闭) |
| 0.1.3.1 | fix缺陷 |
| 0.1.4.0 | 新增xiaobaiauto2Api命令行工具,可以将raw请求数据转换成python代码 |
| 0.1.4.1 | fix缺陷 |
| 0.1.4.2 | 优化与新增Fiddler的saz文件支持 |
| 0.1.4.3 | 优化代码 |
| 0.1.4.4 | 优化与新增charles的har文件支持,支持批量脚本转换 |
| 0.1.4.5 | 优化与新增比较两个har文件并转为Python代码 |
| 0.1.4.6 | fix并支持fiddler导出的har文件转为Python代码 |
| 0.1.5.0 | fix并优化api_action |
| 0.1.5.1 | 优化xiaobaiauto2Api与web_action支持cmd调用关键词 |
| 0.1.5.2 | 新增apiTestCase装饰器 |
| 0.1.5.3 | 修复xiaobaiauto2Api部分bug |
| 0.1.5.4 | fix |
| 0.1.5.5 | add 选项-t template 参考xiaobaiauto2Api -h |
| 0.1.5.6 | fix |
| 0.1.5.7 | fix |
| 0.1.6.0 | add 参数化符{变量}系统自动识别并替换为预设值 |
| 0.1.6.1 | fix |
| 0.1.6.2 | fix |
| 0.1.6.3 | add -i, -v 新增命令行安装软件支持mac系统 |
| 0.1.6.4 | fix |
| 0.1.6.5 | add mock模拟接口 |
| 0.1.6.6 | 优化 -i -v 支持jdk jmeter chromdriver jenkins git node |
| 0.1.7.0 | fix |
| 0.1.7.1 | fix -i 新增支持allure与svn |
| 0.1.7.2 | fix -x 新增支持转为jmeter(*.jmx)脚本 |
| 0.1.7.3 | fix |
| 0.1.7.5 | fix |
| 0.1.7.6 | 优化jmx数据格式 |
| 0.1.7.7 | 优化 |
| 0.1.8.0 | 优化jmx数据格式 |
| 0.1.8.1 | 优化jmx的参数化实现 |
| 0.1.8.2 | 优化jmx的实现 |
| 0.1.8.3 | 新增xiaobaiauto2Proxy系统代理管理模块 |
| 0.1.8.5 | 优化jmx的实现 |
| 0.1.8.6 | 优化jmx的实现 |
| 0.1.8.7 | 优化jmx的实现 |
| 0.1.8.8 | 优化xiaobaiauto2App |
| 0.1.9 | 优化xiaobaiauto2App |
| 0.1.9.1 | 优化mac的环境变量设置 |
| 0.1.9.2 | fix |
| 0.1.9.3 | fix |
| 0.1.9.5 | fix |
| 0.1.9.6 | 新增xiaobaiauto2安装软件tomcat |
| 0.1.9.7 | fix |
| 0.1.9.8 | fix 支持下载fiddler与postman |
| 0.1.9.9 | fix 模板的下载路径报错问题 |
| 0.2 | xiaobaiauto2App |
| 0.2.1 | xiaobaiauto2Api下载软件支持多线程,线程数为本机CPU核数的3倍,暂不支持参数修改 |
| 1.0.0 | 优化依赖库 |
| 1.0.1 | fix |
Raw data
{
"_id": null,
"home_page": "https://gitee.com/xiaobaiOTS/xiaobaiauto2",
"name": "xiaobaiauto2",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "test auto automation xiaobai xiaobaiauto2 test framework",
"author": "xiaobaiTser",
"author_email": "807447312@qq.com",
"download_url": "https://files.pythonhosted.org/packages/2c/89/2def23c4e6565b80a72cee220d36e054dc9bc10d190151edf747399d8a92/xiaobaiauto2-1.0.1.tar.gz",
"platform": null,
"description": "[![Downloads](https://pepy.tech/badge/xiaobaiauto2)](https://pepy.tech/project/xiaobaiauto2)\r\n[![Downloads](https://pepy.tech/badge/xiaobaiauto2/month)](https://pepy.tech/project/xiaobaiauto2/month)\r\n[![Downloads](https://pepy.tech/badge/xiaobaiauto2/week)](https://pepy.tech/project/xiaobaiauto2/week)\r\n[![Downloads](https://img.shields.io/badge/xiaobaiauto2-\u03c0\u03c0-green)](https://img.shields.io/badge/xiaobaiauto2-success-green)\r\n---\r\n# \u7b80\u4ecb\r\nxiaobaiauto2\u662f\u4e00\u5957\u81ea\u52a8\u5316\u6846\u67b6\uff0c\u529f\u80fd\u8986\u76d6UI\u81ea\u52a8\u5316\u4e0eAPI\u81ea\u52a8\u5316 \u610f\u5728\u5e2e\u52a9\u5bf9\u81ea\u52a8\u5316\u6709\u66f4\u591a\u9700\u6c42\u4e14\u8fc7\u591a\u65f6\u95f4\u5199\u4ee3\u7801\u7684\u4eba\u7fa4\uff0c\u8ba9\u5927\u5bb6\u7684\u65f6\u95f4\r\n\u82b1\u5728\u4e1a\u52a1\u7684\u5b9e\u73b0\u4e0a\uff0c\u672c\u5e93\u5df2\u653e\u5f03\uff01\uff01\uff01\u63a8\u8350\u4f7f\u7528[xiaobaisaf](https://pypi.org/project/xiaobaisaf \"xiaobaisaf\u7684\u4f7f\u7528\u65b9\u6cd5\")\r\n----\r\n## \u67b6\u6784\r\n![Image text](xiaobaiauto2.png)\r\n## \u5f00\u59cb\u4f7f\u7528\r\n\r\n#### \u5b89\u88c5\r\n`pip install xiaobaiauto2 `\r\n\r\n`pip install xiaobaiauto2[all] # \u5b89\u88c5\u5168\u90e8\u4f9d\u8d56` \r\n\r\n#### \u9879\u76ee\u76ee\u5f55\r\n test\r\n |\r\n |--__init__.py\r\n |\r\n |--WebTest \r\n | |\r\n | |--conftest.py\r\n | |--test_WebUI.py\r\n |\r\n |--APPTest\r\n | |\r\n | |--conftest.py\r\n | |--test_Manzhai_APP_Case1.py\r\n | |--test_Manzhai_APP_Case2.py\r\n |\r\n |--APITest\r\n | |\r\n | |--test_cases.py\r\n | |--yewua.py\r\n \r\n#### \u5173\u952e\u8bcd\r\n| \u5e8f\u53f7 | CMD | key |\r\n| :--- | :--- | :--- |\r\n| 1 | \u6253\u5f00\u7f51\u9875 | URL |\r\n|2 | \u70b9\u51fb | CLICK |\r\n|3 | \u8f93\u5165 | SENDKEY |\r\n|4 | \u5237\u65b0 | REFRESH |\r\n|5 | \u540e\u9000 | BACK |\r\n|6 | \u5173\u95ed | CLOSE |\r\n|7 | \u9000\u51fa | QUIT |\r\n|8 | \u6807\u7b7e | TAG |\r\n|9 | \u5c5e\u6027 | ATTR |\r\n|10 | URL | CURL |\r\n|11 | \u6807\u9898 | ITLE |\r\n|12 | \u5185\u5d4c\u9875 | FRAME |\r\n|13 | \u6807\u7b7e\u9875[\u5e8f\u53f7(1\u5f00\u59cb)] | WINDOW |\r\n|14 | JS_\u786e\u5b9a | ALERT0 |\r\n|15 | JS_\u53d6\u6d88 | ALERT1 |\r\n|16 | JS_\u8f93\u5165\u6846 | ALERT2 |\r\n|17 | JS_\u6587\u672c | ALERT3 |\r\n|18 | \u505c\u6b62 | WAIT |\r\n|19 | \u811a\u672c | SCRIPT |\r\n|20 | \u6dfb\u52a0cookie | ADDCOOKIE |\r\n|21 | \u6ed1\u5c4f | SWIPE |\r\n|22 | \u622a\u5c4f | DSCREENSHOT |\r\n|23 | \u5143\u7d20\u622a\u56fe | ESCREENSHOT |\r\n|24 | \u8bc6\u522b\u9a8c\u8bc1\u7801 | FINDTEXT |\r\n|25 | \u5750\u6807 | LOCATION |\r\n|26 | \u7f51\u9875\u6e90\u7801 | PAGESOURCE |\r\n\r\n#### \u8c03\u7528\u6a21\u677f\u4fee\u6539\u811a\u672c\r\n\u53c2\u8003test\u76ee\u5f55\u4e0b\u9762\u7684\u811a\u672c\r\n\r\n @pytest.mark.xiaobai_web\r\n def test_Case1(browser):\r\n web_action(browser, cmd=cmd.\u6253\u5f00\u7f51\u9875, loc='', data='http://www.baidu.com')\r\n web_action(browser, cmd=cmd.\u8f93\u5165, loc='//*[@id=\"kw\"]', data='\u5c0f\u767d\u79d1\u6280')\r\n web_action(browser, cmd=cmd.\u70b9\u51fb, loc='//*[@id=\"su\"]')\r\n web_action(browser, cmd=cmd.wait, data=3)\r\n web_action(browser, cmd=cmd.\u6807\u9898, contains_assert='\u5c0f\u767d')\r\n\r\n\u5173\u952e\u8bcd\u7684\u4f7f\u7528\uff0c\u770b\u4e0a\u9762\u793a\u4f8b\u4ea6\u53ef\uff08xiaobaiauto2>0.1.5.0\uff09\r\n\r\n - 1 \u5bfc\u5165cmd\u7c7b\r\n \r\n from xiaobaiauto2.xiaobaiauto2 import cmd\r\n \r\n - 2 cmd\u7c7b\u8c03\u7528\u5c5e\u6027\r\n \r\n cmd.\u5173\u952e\u8bcd\r\n\r\n\u82e5\u611f\u89c9\u5173\u952e\u8bcd\u4e0d\u8db3\u4ee5\u4f7f\u7528\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u539f\u751f\u65b9\u6cd5\uff0c\u793a\u4f8b\u5982\u4e0b\r\n\r\n browser.find_element_by_id('id\u5c5e\u6027\u503c').click()\r\n \r\n\u4ee3\u7801\u6267\u884c\u4e4b\u524d\uff0c\u82e5\u60a8\u9700\u8981\u53d1\u9001\u90ae\u4ef6\uff0c\u8bf7\u5c06`test_first`\u65b9\u6cd5\u4e2d\u7684`email`\u7684\u53c2\u6570\u503c\u8fdb\u884c\u81ea\u884c\u4fee\u6539\u5373\u53ef\r\n\r\n##### \u5907\u6ce8\r\n- \u82e5APP\u6d4b\u8bd5\u9700\u8981\u83b7\u53d6toast\u4fe1\u606f\u53ef\u4ee5\u5199\u4e00\u4e2a\u65b9\u6cd5\u6dfb\u52a0\u5230\u81ea\u5df1\u7684\u9879\u76ee\u4e2d,\u4ee3\u7801\u6837\u4f8b\u5982\u4e0b\uff1a\r\n ```\r\n def find_toast(self, message, timeout, poll_frequency):\r\n new_message = f\"//*[@text=\\'{message}\\']\"\r\n element = WebDriverWait(self.driver, timeout, poll_frequency).until(\r\n EC.presence_of_element_located((By.XPATH, new_message)))\r\n return element.text\r\n ```\r\n \r\n### \u4f7f\u7528\r\n#### 1\u3001\u547d\u4ee4\u884c\u8fd0\u884c\u811a\u672c\r\n pytest --html=report.html --self-contained-html\r\n or\r\n pytest --html=report.html --self-contained-html -m xiaobai_web\r\n or\r\n pytest --html=report.html --self-contained-html -o log_cli=true -o log_cli_level=INFO\r\n\r\n#### 2\u3001\u5b9a\u65f6\u4efb\u52a1\u754c\u9762\u8fd0\u884c\u811a\u672c\uff08CMD\u547d\u4ee4\uff09\r\n xiaobaiauto2Timer\r\n ![Image text](xiaobaiauto2Timer.PNG)\r\n\r\n#### 3.1\u3001xiaobaiauto2Api\u5c06raw\u6570\u636e\u8f6c\u6362\u6210python\u4ee3\u7801(\u7248\u672c>0.1.3.1\u53ef\u7528)\r\n xiaobaiauto2Api -h # \u5e2e\u52a9\u6587\u6863\u63d0\u793a\r\n xiaobaiauto2Api -f *.txt -s *.py\r\n xiaobaiauto2Api -f *.txt -x 2\r\n xiaobaiauto2Api -f *.saz -x 2\r\n xiaobaiauto2Api -f *.har -x 2\r\n xiaobaiauto2Api -f *.har -x 3\r\n xiaobaiauto2Api -d D:\\example\r\n \r\n#### 3.2\u3001xiaobaiauto2 >= 0.1.4.5 \u652f\u6301c\u53c2\u6570\r\n xiaobaiauto2Api -c 1 -f 1.har,2.har\r\n xiaobaiauto2Api -c 1 -f 1.har,2.har -d E:\\example\r\n xiaobaiauto2Api -c 1 -f 1.har,2.har -d E:\\example -s 1_2_compare\r\n xiaobaiauto2Api -c 1 -f 1.har.2.har -d E:\\example -x 3 # \u751f\u6210*.jmx(\u542b\u63d0\u53d6\u5668\u3001\u53c2\u6570\u5316)[>=0.1.7.2]\r\n#### 3.3\u3001xiaobaiauto2 >= 0.1.5.5 \u652f\u6301t\u53c2\u6570\r\n xiaobaiauto2Api -t api // \u751f\u6210api\u6d4b\u8bd5\u6a21\u677f\r\n xiaobaiauto2Api -t web // \u751f\u6210web\u6d4b\u8bd5\u6a21\u677f\r\n xiaobaiauto2Api -t app // \u751f\u6210app\u6d4b\u8bd5\u6a21\u677f\r\n\r\n#### 3.4\u3001xiaobaiauto2 >= 0.1.6.3 \u652f\u6301i\u4e0ev\u53c2\u6570(\u8bf7\u770b3.6) \u4e0d\u6307\u5b9a\u7248\u672c\u9ed8\u8ba4\u5b89\u88c5\u6700\u65b0\u7248\u54e6\r\n xiaobaiauto2Api -i jdk -v 8 // \u5b89\u88c5jdk8\r\n xiaobaiauto2Api -i jmeter -v 5.3 // \u5b89\u88c5jmeter5.3\r\n xiaobaiauto2Api -i chromedriver -v 88 // \u5b89\u88c5chromedriver\u768488\u7248\u672c\r\n xiaobaiauto2Api -i allure -d \"D:\\Program Files\" // \u5b89\u88c5allure(\u4f1a\u6709\u4e9b\u6162\u54e6)\r\n\r\n#### 3.5\u3001xiaobaiauto2 >= 0.1.6.5 \u652f\u6301mock\u6a21\u62df\u63a5\u53e3\r\n from xiaobaiauto2.xiaobaiauto2 import mock, MockServer\r\n\r\n @mock(uri='/login', response={\"errcode\": 200, \"msg\": \"\u767b\u5f55\u6210\u529f\", \"data\": {\"token\": \"123456\"}})\r\n @mock(uri='/register', response={\"errcode\": 200, \"msg\": \"\u6ce8\u518c\u6210\u529f\", \"data\": {}})\r\n @MockServer(uri='/index', response={\"errcode\": 200, \"msg\": \"\u9996\u9875\u6210\u529f\", \"data\": {}})\r\n def run(): pass\r\n \r\n if __name__ == '__main__':\r\n run(port=7777)\r\n- \u5bfc\u5165mock\u65b9\u6cd5\r\n ```\r\n from xiaobaiauto2.xiaobaiauto2 import mock, MockServer\r\n ```\r\n\r\n- \u5b9a\u4e49mock\u63a5\u53e3\uff0cmock\u4e0eMockServer\u65e0\u533a\u522b\uff0curi\u4e3a\u63a5\u53e3\u8def\u5f84\uff0cresponse\u4e3a\u63a5\u53e3\u8fd4\u56de\u503c\uff0crun\u4e3a\u88ab\u88c5\u9970\u7684\u51fd\u6570\u540d\u79f0\u53ef\u81ea\u5b9a\u4e49\r\n ``` \r\n @mock(uri='/login', response={\"errcode\": 200, \"msg\": \"\u767b\u5f55\u6210\u529f\", \"data\": {\"token\": \"123456\"}})\r\n @mock(uri='/register', response={\"errcode\": 200, \"msg\": \"\u6ce8\u518c\u6210\u529f\", \"data\": {}})\r\n @MockServer(uri='/index', response={\"errcode\": 200, \"msg\": \"\u9996\u9875\u6210\u529f\", \"data\": {}})\r\n def run(): pass\r\n ```\r\n- \u542f\u52a8mock\u63a5\u53e3\u670d\u52a1\uff0c run\u4e3a\u4e0a\u9762\u88ab\u88c5\u9970\u7684\u65b9\u6cd5\u540d\uff0cport\u4e3a\u76d1\u542c\u7684\u7aef\u53e3(\u9ed8\u8ba46666)\r\n ```\r\n if __name__ == '__main__':\r\n run(port=7777)\r\n ```\r\n- jmeter\u5c1d\u8bd5\uff1f\r\n ```\r\n api1: http://127.0.0.1:7777/login\r\n api2: http://127.0.0.1:7777/register\r\n api3: http://127.0.0.1:7777/index\r\n ```\r\n#### 3.6\u3001xiaobaiauto2 >= 0.1.6.6 \u652f\u6301\u8f6f\u4ef6\u81ea\u52a8\u5b89\u88c5\u4e0e\u73af\u5883\u914d\u7f6e\r\n- \u9ed8\u8ba4\u73af\u5883\u4e3a\u7528\u6237\u73af\u5883\uff0c\u914d\u7f6e\u7684\u662f\u7528\u6237\u73af\u5883\u53d8\u91cf\uff0c\u82e5\u8981\u914d\u7f6e\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\uff0c\u8bf7\u4f7f\u7528\u7ba1\u7406\u5458\u8fd0\u884c\u5373\u53ef\r\n ```\r\n xiaobaiauto2Api -i jdk -v 8 -d D:\\\r\n xiaobaiauto2Api -i jmeter -v 5.3 -d D:\\\r\n xiaobaiauto2Api -i chromedriver -v 88\r\n xiaobaiauto2Api -i jenkins -d D:\\tomcat\\webapps\r\n xiaobaiauto2Api -i git\r\n xiaobaiauto2Api -i node -v 15 -d D:\\\r\n ```\r\n#### 3.7\u3001xiaobaiauto2 >= 0.1.8.3 \u652f\u6301\u8f6f\u4ef6\u81ea\u52a8\u5b89\u88c5\u4e0e\u73af\u5883\u914d\u7f6e\r\n- \u7ba1\u7406\u7cfb\u7edf\u4ee3\u7406\u670d\u52a1\u5668\uff08\u67e5\u770b\u3001\u8bbe\u7f6e\u3001\u5173\u95ed\u3001\u9a8c\u8bc1\uff09\r\n ```\r\n xiaobaiauto2Proxy -h # \u67e5\u770b\u5e2e\u52a9\u6587\u6863\r\n xiaobaiauto2Proxy # \u67e5\u770b\u7cfb\u7edf\u4ee3\u7406\u662f\u5426\u5f00\u542f\r\n xiaobaiauto2Proxy -e 0 -p 127.0.0.1:8080 # \u5f00\u542f\u7cfb\u7edf\u4ee3\u7406\r\n xiaobaiauto2Proxy -e 1 # \u5173\u95ed\u7cfb\u7edf\u4ee3\u7406\r\n xiaobaiauto2Proxy -c 1 # \u9a8c\u8bc1\u7cfb\u7edf\u4ee3\u7406\u662f\u5426\u53ef\u7528\r\n ```\r\n#### 3.8\u3001xiaobaiauto2 >= 0.2 \u652f\u6301adb\u547d\u4ee4\uff0c**\u63d0\u524d\u6253\u5f00APP**\r\n- \u5355\u8bbe\u5907\u76d1\u63a7APP\u7684\u70b9\u51fb\uff0c\u70b9\u51fb\u7684\u8def\u5f84\u81ea\u52a8\u751f\u6210XPath\u8868\u8fbe\u5f0f\r\n ```\r\n xiaobaiauto2App\r\n ```\r\n- \u591a\u8bbe\u5907\u5355\u673a\u76d1\u63a7APP\u7684\u70b9\u51fb\uff0c\u70b9\u51fb\u7684\u8def\u5f84\u81ea\u52a8\u751f\u6210XPath\u8868\u8fbe\u5f0f\r\n ```\r\n xiaobaiauto2App -d 127.0.0.1:62001 // \u6307\u5b9a\u8bbe\u5907\u53f7\u8fdb\u884c\u76d1\u63a7\r\n xiaobaiauto2App -i 1 // \u6307\u5b9a\u5e8f\u53f7\u4e3a1\u7684\u8bbe\u5907\u8fdb\u884c\u76d1\u63a7\r\n ```\r\n\r\n#### \u5176\u4ed6\u5e2e\u52a9\r\n- [163\u90ae\u7bb1\u600e\u4e48\u5f00\u542fSMTP\u53d1\u90ae\u4ef6](http://help.163.com/10/0312/13/61J0LI3200752CLQ.html)\r\n- [QQ\u90ae\u7bb1\u600e\u4e48\u5f00\u542fSMTP\u53d1\u90ae\u4ef6](https://service.mail.qq.com/cgi-bin/help?subtype=1&id=28&no=166)\r\n- [Pytest\u5b98\u7f51\u5e2e\u52a9\u6587\u6863](https://learning-pytest.readthedocs.io/zh/latest/doc/intro/getting-started.html)\r\n- [Android\u8c03\u8bd5\u6865(adb)\u5b98\u7f51\u5e2e\u52a9\u6587\u6863](https://developer.android.google.cn/studio/command-line/adb.html)\r\n\r\n## \u66f4\u65b0\u65e5\u5fd7\r\n| \u7248\u672c | \u529f\u80fd |\r\n|:--------|:--------------------------------------------------|\r\n| 0.0.1 | \u6dfb\u52a0\u90ae\u4ef6\u53d1\u9001\uff0c\u7528\u4f8b\u6392\u5e8f\uff0cchrome\u63d0\u793a\u6846\u7981\u6b62\u7b49\u7b49 |\r\n| 0.1.0.1 | \u6dfb\u52a0\u81ea\u52a8\u6267\u884c\u4efb\u52a1\u529f\u80fd\u53caUI\u754c\u9762 |\r\n| 0.1.1 | fix\u7f3a\u9677\uff0ccmd\u6267\u884cxiaobaiauto2Timer |\r\n| 0.1.2 | fix\u7f3a\u9677 |\r\n| 0.1.3 | \u65b0\u589e\u9a8c\u8bc1\u7801\u8bc6\u522b,\u652f\u6301 *.png *.jpg *.jpeg \uff0c\u65b0\u589e\u90e8\u5206\u5173\u952e\u8bcd(\u6682\u5df2\u5173\u95ed) |\r\n| 0.1.3.1 | fix\u7f3a\u9677 |\r\n| 0.1.4.0 | \u65b0\u589exiaobaiauto2Api\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u53ef\u4ee5\u5c06raw\u8bf7\u6c42\u6570\u636e\u8f6c\u6362\u6210python\u4ee3\u7801 |\r\n| 0.1.4.1 | fix\u7f3a\u9677 |\r\n| 0.1.4.2 | \u4f18\u5316\u4e0e\u65b0\u589eFiddler\u7684saz\u6587\u4ef6\u652f\u6301 |\r\n| 0.1.4.3 | \u4f18\u5316\u4ee3\u7801 |\r\n| 0.1.4.4 | \u4f18\u5316\u4e0e\u65b0\u589echarles\u7684har\u6587\u4ef6\u652f\u6301,\u652f\u6301\u6279\u91cf\u811a\u672c\u8f6c\u6362 |\r\n| 0.1.4.5 | \u4f18\u5316\u4e0e\u65b0\u589e\u6bd4\u8f83\u4e24\u4e2ahar\u6587\u4ef6\u5e76\u8f6c\u4e3aPython\u4ee3\u7801 |\r\n| 0.1.4.6 | fix\u5e76\u652f\u6301fiddler\u5bfc\u51fa\u7684har\u6587\u4ef6\u8f6c\u4e3aPython\u4ee3\u7801 |\r\n| 0.1.5.0 | fix\u5e76\u4f18\u5316api_action |\r\n| 0.1.5.1 | \u4f18\u5316xiaobaiauto2Api\u4e0eweb_action\u652f\u6301cmd\u8c03\u7528\u5173\u952e\u8bcd |\r\n| 0.1.5.2 | \u65b0\u589eapiTestCase\u88c5\u9970\u5668 |\r\n| 0.1.5.3 | \u4fee\u590dxiaobaiauto2Api\u90e8\u5206bug |\r\n| 0.1.5.4 | fix |\r\n| 0.1.5.5 | add \u9009\u9879-t template \u53c2\u8003xiaobaiauto2Api -h |\r\n| 0.1.5.6 | fix |\r\n| 0.1.5.7 | fix |\r\n| 0.1.6.0 | add \u53c2\u6570\u5316\u7b26{\u53d8\u91cf}\u7cfb\u7edf\u81ea\u52a8\u8bc6\u522b\u5e76\u66ff\u6362\u4e3a\u9884\u8bbe\u503c |\r\n| 0.1.6.1 | fix |\r\n| 0.1.6.2 | fix |\r\n| 0.1.6.3 | add -i, -v \u65b0\u589e\u547d\u4ee4\u884c\u5b89\u88c5\u8f6f\u4ef6\u652f\u6301mac\u7cfb\u7edf |\r\n| 0.1.6.4 | fix |\r\n| 0.1.6.5 | add mock\u6a21\u62df\u63a5\u53e3 |\r\n| 0.1.6.6 | \u4f18\u5316 -i -v \u652f\u6301jdk jmeter chromdriver jenkins git node |\r\n| 0.1.7.0 | fix |\r\n| 0.1.7.1 | fix -i \u65b0\u589e\u652f\u6301allure\u4e0esvn |\r\n| 0.1.7.2 | fix -x \u65b0\u589e\u652f\u6301\u8f6c\u4e3ajmeter(*.jmx)\u811a\u672c |\r\n| 0.1.7.3 | fix |\r\n| 0.1.7.5 | fix |\r\n| 0.1.7.6 | \u4f18\u5316jmx\u6570\u636e\u683c\u5f0f |\r\n| 0.1.7.7 | \u4f18\u5316 |\r\n| 0.1.8.0 | \u4f18\u5316jmx\u6570\u636e\u683c\u5f0f |\r\n| 0.1.8.1 | \u4f18\u5316jmx\u7684\u53c2\u6570\u5316\u5b9e\u73b0 |\r\n| 0.1.8.2 | \u4f18\u5316jmx\u7684\u5b9e\u73b0 |\r\n| 0.1.8.3 | \u65b0\u589exiaobaiauto2Proxy\u7cfb\u7edf\u4ee3\u7406\u7ba1\u7406\u6a21\u5757 |\r\n| 0.1.8.5 | \u4f18\u5316jmx\u7684\u5b9e\u73b0 |\r\n| 0.1.8.6 | \u4f18\u5316jmx\u7684\u5b9e\u73b0 |\r\n| 0.1.8.7 | \u4f18\u5316jmx\u7684\u5b9e\u73b0 |\r\n| 0.1.8.8 | \u4f18\u5316xiaobaiauto2App |\r\n| 0.1.9 | \u4f18\u5316xiaobaiauto2App |\r\n| 0.1.9.1 | \u4f18\u5316mac\u7684\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e |\r\n| 0.1.9.2 | fix |\r\n| 0.1.9.3 | fix |\r\n| 0.1.9.5 | fix |\r\n| 0.1.9.6 | \u65b0\u589exiaobaiauto2\u5b89\u88c5\u8f6f\u4ef6tomcat |\r\n| 0.1.9.7 | fix |\r\n| 0.1.9.8 | fix \u652f\u6301\u4e0b\u8f7dfiddler\u4e0epostman |\r\n| 0.1.9.9 | fix \u6a21\u677f\u7684\u4e0b\u8f7d\u8def\u5f84\u62a5\u9519\u95ee\u9898 |\r\n| 0.2 | xiaobaiauto2App |\r\n| 0.2.1 | xiaobaiauto2Api\u4e0b\u8f7d\u8f6f\u4ef6\u652f\u6301\u591a\u7ebf\u7a0b\uff0c\u7ebf\u7a0b\u6570\u4e3a\u672c\u673aCPU\u6838\u6570\u76843\u500d\uff0c\u6682\u4e0d\u652f\u6301\u53c2\u6570\u4fee\u6539 |\r\n| 1.0.0 | \u4f18\u5316\u4f9d\u8d56\u5e93 |\r\n| 1.0.1 | fix |\r\n",
"bugtrack_url": null,
"license": null,
"summary": "xiaobaiauto2\u662f\u5bf9\u81ea\u52a8\u5316\u6846\u67b6\u7684\u7b2c\u4e09\u6b21\u66f4\u65b0\uff0c\u529f\u80fd\u8986\u76d6UI\u81ea\u52a8\u5316\u4e0eAPI\u81ea\u52a8\u5316\u610f\u5728\u5e2e\u52a9\u5bf9\u81ea\u52a8\u5316\u6709\u66f4\u591a\u9700\u6c42\u4e14\u8fc7\u591a\u65f6\u95f4\u5199\u4ee3\u7801\u7684\u4eba\u7fa4\uff0c\u8ba9\u5927\u5bb6\u7684\u65f6\u95f4\u82b1\u5728\u4e1a\u52a1\u7684\u5b9e\u73b0\u4e0a",
"version": "1.0.1",
"project_urls": {
"Homepage": "https://gitee.com/xiaobaiOTS/xiaobaiauto2"
},
"split_keywords": [
"test",
"auto",
"automation",
"xiaobai",
"xiaobaiauto2",
"test",
"framework"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5c99673d48559c315292645e5bf788649be911789aae82123b871acb8a3f4990",
"md5": "65413497f751cd0a8b7dfa0e80a6c875",
"sha256": "8de1b4bba10537ccc5034cb3a412310692b1bf7ddc1340e5c348da38bbf70551"
},
"downloads": -1,
"filename": "xiaobaiauto2-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "65413497f751cd0a8b7dfa0e80a6c875",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 2645302,
"upload_time": "2025-01-01T01:45:45",
"upload_time_iso_8601": "2025-01-01T01:45:45.331755Z",
"url": "https://files.pythonhosted.org/packages/5c/99/673d48559c315292645e5bf788649be911789aae82123b871acb8a3f4990/xiaobaiauto2-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2c892def23c4e6565b80a72cee220d36e054dc9bc10d190151edf747399d8a92",
"md5": "13a9b6013ddd0cf3201759a2f3b16ee4",
"sha256": "c4f02bb63e85e0e62ad9b50054b52a709815d84b3dba07dabdb8ce71b2657f49"
},
"downloads": -1,
"filename": "xiaobaiauto2-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "13a9b6013ddd0cf3201759a2f3b16ee4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 2621179,
"upload_time": "2025-01-01T01:45:48",
"upload_time_iso_8601": "2025-01-01T01:45:48.812346Z",
"url": "https://files.pythonhosted.org/packages/2c/89/2def23c4e6565b80a72cee220d36e054dc9bc10d190151edf747399d8a92/xiaobaiauto2-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-01 01:45:48",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "xiaobaiauto2"
}