Skip to content

nightrain01/FreeApiTestDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FreeApiTestDemo

项目说明

本项目使用 Pytest + Requests + Allure + YAML 实现了数据驱动的接口自动化测试

挑选了网上一些免费的接口以及Ruoyi-Vue演示版的部分接口进行测试

使用

依赖安装

由于Ruoyi的登录过程需要填写验证码,这里使用CalculateCaptcha_Recognition项目对验证码进行识别,因此需要安装pytorch相关依赖

python依赖安装:

pip install torch==1.10.1+cpu torchvision==0.11.2+cpu torchaudio==0.10.1 -f https://download.pytorch.org/whl/cpu/torch_stable.html
pip install -r requirements.txt

allure安装:
可以参考官方文档进行安装
也可以直接从Releases下载,手动配置path

执行测试

使用pytest命令执行测试:

pytest

查看报告

pytest执行完毕后,会在项目根目录./reports路径下生成报告
使用allure命令,生成并查看html报告:

allure serve ./reports

About

学习测试用

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages