Allure+jenkins配置

Allure+jenkins配置
http://plugincompat.herokuapp.com/
https://docs.pytest.org/en/latest/reference.html#ini-options-ref
1、Allure 的使用
1、下载Allure:

# 下载 Allure,进行解压
https://github.com/allure-framework/allure2/releases

2、添加环境变量
将解压之后的路径放到环境变量当中
3、安装依赖包
https://pypi.org/project/allure-pytest/

pip install allure-pytest

4、执行测试,生成报告

pytest --alluredir=allure_report/

5、查看allure报告
启动allure

# 命令终端:输入命令,启动allure
allure serve 文件路径

2、无头浏览器执行模式
1、可能需要配置

# 设置无头浏览器
from selenium.webdriver import ChromeOptions
chrome_options = ChromeOptions()
# 设置为无头模式(必须写)
chrome_options.add_argument('--headless')
# 禁用GPU(可选)
chrome_options.add_argument('--disable-gpu')
# 非沙箱环境(可选)
chrome_options.add_argument('--no-sandbox')
# 创建drievr对象
driver = Chrome(options=chrome_options)

3、jenkins集成Allure
1、安装 Jenkins 的 Allure 插件;



4、jenkins分布式配置
Master-Slave:主从模式







posted @ 2022-12-10 18:16  进击的bug~  阅读(483)  评论(0编辑  收藏  举报