![avatar](https://github.com/yanchunhuo/resources/blob/master/APIAutomationTest/report.png)
# [自动化测试]()
# [概况]()
* 本项目支持接口自动化测试、app ui自动化测试、web ui自动化测试、性能测试
* 本项目由以下工具组成
* pytest:python的一个单元测试框架,https://docs.pytest.org/en/latest/
* pytest-xdist:pytest的一个插件,可多进程同时执行测试用例,https://github.com/pytest-dev/pytest-xdist
* allure-pytest:用于生成测试报告,http://allure.qatools.ru/
* PyHamcrest:一个匹配器对象的框架,用于断言,https://github.com/hamcrest/PyHamcrest
* requests:http请求框架,http://docs.python-requests.org/en/master/
* Appium:移动端的自动化测试框架,https://github.com/appium/appium/tree/v1.15.1
* selenium:web ui自动化测试框架,https://www.seleniumhq.org/
* cx_Oracle:oracle操作库,https://cx-oracle.readthedocs.io/en/latest/index.html
* JPype1:用于执行java代码,https://github.com/jpype-project/jpype
* paramiko:ssh客户端,https://docs.paramiko.org/en/stable/
* Pillow:用于图片处理,https://pillow.readthedocs.io/en/latest/
* PyMySQL:用于操作MySQL数据库,https://github.com/PyMySQL/PyMySQL
* redis:redis客户端,https://pypi.org/project/redis/
* tess4j:java的图片识别工具,https://github.com/nguyenq/tess4j/
* allpairspy: 用于将参数列表进行正交分析,实现正交分析法用例覆盖,https://pypi.org/project/allpairspy/
* python-binary-memcached:用于操作memcached,https://github.com/jaysonsantos/python-binary-memcached
* kazoo:用于操作zookeeper,https://github.com/python-zk/kazoo
* websockets:用于websocket请求,https://github.com/aaugustin/websockets
* Js2Py:用于执行js代码,https://github.com/PiotrDabkowski/Js2Py
* sqlacodegen:用于根据数据库表结构生成python对象,https://github.com/agronholm/sqlacodegen
* SQLAlchemy:SQL工具包及对象关系映射(ORM)工具,https://github.com/sqlalchemy/sqlalchemy
* 当前仅支持Python>=3.6
* 项目如需执行java代码(即使用jpype1),则项目目录所在的路径不可包含中文
# [使用]()
## 一、环境准备
### 1、脚本运行环境准备
#### 1.1、安装系统依赖
* Linux-Ubuntu:
* apt-get install libpq-dev python3-dev 【用于psycopg2-binary所需依赖】
* apt-get install g++ libgraphicsmagick++1-dev libboost-python-dev 【用于pgmagick所需依赖】
* apt-get install python-pgmagick 【pgmagick所需依赖】
* Linux-CentOS:
* yum install python3-devel postgresql-devel 【用于psycopg2-binary所需依赖】
* yum install GraphicsMagick-c++-devel boost boost-devel【用于pgmagick所需依赖】
* Windows:
* 安装Microsoft Visual C++ 2019 Redistributable,下载地址:https://visualstudio.microsoft.com/zh-hans/downloads/ 【jpype1、图像识别字库所需依赖】
#### 1.2、安装python依赖模块
* pip3 install -r requirements.txt
* 安装pgmagick
* Linux:
* pip3 install pgmagick==0.7.6
* Windows:
* 下载安装对应版本:https://www.lfd.uci.edu/~gohlke/pythonlibs/#pgmagick
* 安装xmind-sdk-python
* 下载地址:https://github.com/xmindltd/xmind-sdk-python
#### 1.3、安装allure
* 源安装
* sudo apt-add-repository ppa:qameta/allure
* sudo apt-get update
* sudo apt-get install allure
* 其他安装方式:https://github.com/allure-framework/allure2
* 手动安装
* 下载2.7.0版本:https://github.com/allure-framework/allure2/releases
* 解压allure-2.7.0.zip
* 加入系统环境变量:export PATH=/home/john/allure-2.7.0/bin:$PATH
#### 1.4、安装openjdk8或jdk8
* sudo add-apt-repository ppa:openjdk-r/ppa
* sudo apt-get update
* sudo apt-get install openjdk-8-jdk
#### 1.5、安装maven
* 完成maven的安装配置
#### 1.6、安装Oracle Instant Client
* Linux
* 安装libaio包
* Linux-CentOS:yum install libaio
* Linux-Ubuntu:apt-get install libaio1
* 配置Oracle Instant Client
* 下载地址:http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
* 下载安装包instantclient-basic-linux.x64-18.3.0.0.0dbru.zip
* 解压zip包,并配置/etc/profile
* unzip instantclient-basic-linux.x64-18.3.0.0.0dbru.zip
* export LD_LIBRARY_PATH=/home/john/oracle_instant_client/instantclient_18_3:$LD_LIBRARY_PATH
* 中文编码设置
```python
import os
os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.UTF8'
```
* Windows
* 下载地址:http://www.oracle.com/technetwork/topics/winx64soft-089540.html
* 下载安装包instantclient-basic-windows.x64-11.2.0.4.0.zip
* 解压zip包,并配置环境变量
* 系统环境变量加入D:\instantclient-basic-windows.x64-11.2.0.4.0\instantclient_11_2
* 配置中文编码,环境变量创建NLS_LANG=SIMPLIFIED CHINESE_CHINA.UTF8
* 注意:如果使用64位,python和instantclient都需要使用64位
#### 1.7、图像识别字库准备
* 下载对应字库:https://github.com/tesseract-ocr/tessdata
* 将下载的字库放到common/java/lib/tess4j/tessdata/
* Linux
* 安装依赖
* Linux-Ubuntu:sudo apt install pkg-config aclocal libtool automake libleptonica-dev
* Linux-CentOS:yum install autoconf automake libtool libjpeg-devel libpng-devel libtiff-devel zlib-devel
* 安装leptonica,下载leptonica-1.78.0.tar.gz,下载地址:https://github.com/DanBloomberg/leptonica/releases
* 安装步骤同tesseract-ocr的安装
* 修改/etc/profile添加如下内容,然后source
```
export LD_LIBRARY_PATH=$LD_LIBRARY_PAYT:/usr/local/lib
export LIBLEPT_HEADERSDIR=/usr/local/include
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
```
* 安装tesseract-ocr,下载tesseract-4.1.1.tar.gz,下载地址:https://github.com/tesseract-ocr/tesseract/releases
* ./autogen.sh
* ./configure
* sudo make
* sudo make install
* sudo ldconfig
* Windows
* 安装Microsoft Visual C++ 2019 Redistributable,下载地址:https://visualstudio.microsoft.com/zh-hans/downloads/
### 2、selenium server运行环境准备
#### 2.1、安装jdk1.8,并配置环境变量
* export JAVA_HOME=/usr/lib/jvm/jdk8
* export JRE_HOME=${JAVA_HOME}/jre
* export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
* export PATH=${JAVA_HOME}/bin:$PATH
#### 2.2、安装配置selenium
* 配置selenium server
* 下载selenium-server-standalone-3.141.0.jar
* 下载地址:http://selenium-release.storage.googleapis.com/index.html
* 以管理员身份启动服务:java -jar selenium-server-standalone-3.141.0.jar -log selenium.log
* 下载浏览器驱动
* 谷歌浏览器:https://chromedriver.storage.googleapis.com/index.html
* 驱动支持的最低浏览器版本:https://raw.githubusercontent.com/appium/appium-chromedriver/master/config/mapping.json
* 火狐浏览器:https://github.com/mozilla/geckodriver/
* 驱动支持的浏览器版本:https://firefox-source-docs.mozilla.org/testing/geckodriver/geckodriver/Support.html
* IE浏览器(建议使用32位,64位操作极慢):http://selenium-release.storage.googleapis.com/index.html
* 将驱动所在目录加入到selenium server服务器系统环境变量:export PATH=/home/john/selenium/:$PATH
* IE浏览器设置
* 在Windows Vista、Windows7系统上的IE浏览器在IE7及以上版本中,需要设置四个区域的保护模式为一样,设置开启或者关闭都可以。
* 工具-->Internet选项-->安全
* IE10及以上版本增强保护模式需要关闭。
* 工具-->Internet选项-->高级
* 浏览器缩放级别必须设置为100%,以便本地鼠标事件可以设置为正确的坐标。
*
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
这里为你收集整理了关于毕业设计、课程设计可参考借鉴的资料一份,质量非常高,如果你投入时间去研究几天相信肯定对你有很大的帮助。到时候你会回来感谢我的。 本资源是经过本地编译测试、可打开、可运行的项目、文件或源码,可以用于毕业设计、课程设计的应用、参考和学习需求,请放心下载。 祝愿你在这个毕业设计项目中取得巨大进步,顺利毕业! 但还需强调一下,这些项目源码仅供学习和研究之用。在使用这些资源时,请务必遵守学术诚信原则和相关法律法规,不得将其用于任何商业目的或侵犯他人权益的行为。对于任何因使用本资源而导致的问题,包括但不限于数据丢失、系统崩溃或安全漏洞,风险自担哦!
资源推荐
资源详情
资源评论
收起资源包目录
毕业设计-自动化测试框架支持接口自动化WEB UI自动化APP UI自动化性能测试支持多系统相互调用支持接口与U.zip (308个子文件)
api_config 26B
MojiWeather-V7.0702.02.apk 17.08MB
app_ui_devices_info_template.conf 4KB
app_ui_android_devices_info_demoProject.conf 3KB
web_ui_config.conf 700B
report.conf 297B
pytest.conf 238B
app_ui_monkey.conf 187B
httpserver.conf 169B
app_ui_config.conf 135B
web_ui_demoProject.conf 128B
mitmproxy.conf 126B
api_demoProject_test.conf 122B
app_ui_android_demoProject_template.conf 85B
app_ui_android_demoProject_xiaomi.conf 85B
demoProject.db 12KB
digits 37B
.gitignore 195B
hocr 22B
dubboclient.jar 18KB
captchaRecognition.jar 1KB
CaptchaRecognition.java 1KB
test.log 1B
README.md 18KB
README.md 614B
appOperator.py 64KB
mns_client.py 38KB
browserOperator.py 26KB
mns_xml_handler.py 25KB
queue.py 22KB
mns_tool.py 18KB
mns_request.py 16KB
topic.py 14KB
generate_web_ui_test_report.py 12KB
sm2.py 11KB
account.py 10KB
strTool.py 9KB
run_app_ui_test.py 8KB
hamcrest.py 8KB
subscription.py 8KB
fileTool.py 7KB
mns_http.py 7KB
app_ui_devices_info.py 7KB
sm4.py 7KB
base_db.py 6KB
aliyun_mns_client.py 6KB
xmindTool.py 5KB
run_web_ui_test.py 5KB
generate_app_ui_test_report.py 5KB
sshClient.py 5KB
doRequest.py 4KB
generate_api_test_report.py 4KB
read_app_ui_devices_info.py 4KB
sm3.py 4KB
mitmproxy_init.py 4KB
app_ui_android_demoProject_client.py 4KB
mns_exception.py 4KB
dubboClient.py 4KB
gmssl_tool.py 3KB
memcached_client.py 3KB
http_server_init.py 3KB
disconf_client.py 3KB
run_api_test.py 3KB
gitlab_client_V3.py 3KB
dateTimeTool.py 3KB
driverTool.py 3KB
zookeeper_client.py 3KB
robot.py 3KB
monkey_client.py 3KB
run_app_ui_monkey_test.py 2KB
mns_common.py 2KB
aes_tool.py 2KB
gitlab_client.py 2KB
api_demoProject_read_config.py 2KB
robot.py 2KB
rsa_tool.py 2KB
sqlacodegen_mysql_tool.py 2KB
pkg_info.py 1KB
oracleClient.py 1KB
mysqlclient.py 1KB
imageCompare.py 1KB
read_web_ui_config.py 1KB
read_app_ui_monkey_config.py 1KB
test_start_page.py 1KB
test_index_page.py 1KB
read_mitmproxy_config.py 1KB
indexPage.py 1KB
assertTool.py 1KB
sqlacodegen_sqlite_tool.py 1KB
javaTools.py 1KB
searchPage.py 1KB
read_report_config.py 1KB
read_httpserver_config.py 1KB
custom_multiprocessing.py 1KB
startPage.py 1KB
__init__.py 1KB
base_encrypt_tool.py 1KB
java_maven_init.py 1002B
custom_matchers.py 997B
web_ui_demoProject_read_config.py 980B
共 308 条
- 1
- 2
- 3
- 4
资源评论
高校毕业设计
- 粉丝: 184
- 资源: 385
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功