python-web自动化-Jenkins集成+allure报告

**1、allure下载地址:https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/
**2、**配置环境变量:
打开终端,输入:vim ./.bash_profile
在这里插入图片描述
输入 :wq! 四个字符保存。
再输入:source ~/.bash_profile 环境变量生效。
在这里插入图片描述
**3、**安装第三方库:pip install allure-pytest
pytest执行命令时:

import pytest

pytest.main(["-s","-v",
             "-m","smoke",
             "--html=report.html",
             "--alluredir=allure_dir"])   #  收集所在目录下的所有用例并执行。

运行之后会报错:
ERROR: usage: mian.py [options] [file_or_dir] [file_or_dir] […] mian.py: error: unrecognized argum
此时需要下载第三方库:pytest-html即可。
命令行输入:allure serve allure-report 会有个报错,
在这里插入图片描述
解决如下:把命令行写成:allure serve allure_dir
根路径:在这里插入图片描述

**4、**到这allure环境搭建还未完成了,后面还会有Jenkins集成,后续会补充。
A )Jenkins安装allure插件
根目录
在这里插入图片描述

B) 配置allure服务:项目-插件-全局工具配置-Allure Commandline
根目录

C)项目-配置-构建后操作-allure_report(allure报告的路径)
在这里插入图片描述
报告的目录:只是一个文件夹的名称

简神测试派地址:http://testingpai.com/article/1595507228184
很详细。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值