天天看点

python+pytest+jenkins 接口测试

  • 1.python优点
    • 1、java语句比较严谨,python比较灵活;
    • 2、python有众多可用的模块库,类似 java的开源jar包
    • 3、python学习成本低
    • 共同点:
      • 1、都是解释性语言,编译型or解释型
  • 2.pytest优势
    • 1、简单易上手,适合单元测试
    • 2、pytest的fixture支持函数活类参数化,参考文档
    • 3、pytest具有很多第三方插件,并且可以自定义扩展,比较好用的如pytest-selenium(集成selenium)、pytest-html(完美html测试报告生成)、pytest-rerunfailures(失败case重复执行)等;
  • 3.jenkins核心配置
    • 1、安装与配置(自行🔍)
    • 2、shell脚本配置
    • shell代码:
source /data/program/venv3/bin/activate
cd /data/program/venv3/project/auto
rm -rf asset-http-automation/
git clone [email protected]:finance-qa/ass