pytest学习系列_为allure报告添加环境配置

一、前言
在我们进行自动化的时候,假如在预览的时候能够显眼的看到测试环境,接口版本号或app版本号的,会更加的友好

二、详细步骤
1、在工程的根目录下面新建文件environment.properties,输入如下内容
baseUrl=https://mi-api-test.sunvalleycloud.com
projectName=apiAutoTest
author=Durant.zeng
email=1350129201@qq.com

2、在jenkins的item里配置(以windows为例,linux注意更改分隔符)
pytest testcases --alluredir .allure-results --clean
copy environment.properties allure-resultsenvironment.properties

三、结果验证

知道、想到、做到、得到
原文地址:https://www.cnblogs.com/Durant0420/p/13853557.html