当前位置: 首页 > news >正文

无锡免费做网站中国最新经济新闻

无锡免费做网站,中国最新经济新闻,免费一键搭建发卡网,安卓应用商店app下载安装目录 1. 搭建allure环境 2. 生成报告 3. logo定制 4. 企业级报告内容或层级定制 5. allure局域网查看 1. 搭建allure环境 1.1 JDK#xff0c;使用PyCharm 找到pycharm安装目录找到java.exe记下jbr目录的完整路径#xff0c;eg: C:\Program Files\JetBrains\PyCharm Com…目录 1. 搭建allure环境 2. 生成报告 3. logo定制 4. 企业级报告内容或层级定制 5. allure局域网查看 1. 搭建allure环境 1.1 JDK使用PyCharm 找到pycharm安装目录找到java.exe记下jbr目录的完整路径eg: C:\Program Files\JetBrains\PyCharm Community Edition 2022.3\jbr\bin将地址添加进入环境变量重启 1.2 allure程序 下载地址https://github.com/allure-framework/allure2/releases解压到指定路径。eg: D:\study\allure-2.25.0\allure-2.25.0\bin执行allurePath 追加allure安装路径验证是否安装成功在dos窗口和Pycharm需要重启加载环境变量中都需要验证allure --version 2. 生成报告 2.1 生成临时的json格式的报告 addopts -vs --alluredir./temps --clean-alluredir ; --clean-alluredir生成临时报告并清除 2.2 生成HTML的allure报告 if __name__ __main__:pytest.main([./test_study/test_fixture.py])os.system(allure generate ./temps -o ./reports --clean) # -o 指定输出测试报告路径# --clean 清空历史数据# ./temps 表示用来生成html的JSON临时文件目录# ./reports 表示html文件生成目录 3. logo定制 3.1 在D:\study\allure-2.25.0\allure-2.25.0\config目录下的allure.yml中配置自定义的logo插件【- custom-logo-plugin】 3.2 重新运行并生成allue报告 3.3 增加一个自己的logo文件并修改D:\study\allure-2.25.0\allure-2.25.0\plugins\custom-logo-plugin\static路径下的styles.css文件里面的样式最好将需要修改的logo也放在custom-logo-plugin目录下 .side-nav__brand {background: url(1.png) no-repeat left center !important; //将你需要的logo图片地址放在这里margin-left: 22px; //调整方位height: 90px; //调整大小background-size: contain !important; } //去掉图片后边 allure 文本 .side-nav__brand-text{display: none; } //配置logo 后面的字体样式与字体大小 .side-nav__brand:after {content: 测试测试;margin-left: 18px;height: 20px;font-family: Arial;font-size: 13px; } 注logo图片和文字可以同时存在也可以只要一个 4. 企业级报告内容或层级定制 左边 1. 项目名称史诗allure.epic(测试报告) 2. 模块名称特性allure.feature(测试模块) 3. 接口名称分组allure.story(测试接口) allure.epic(测试报告) allure.feature(测试模块) class TestA:allure.story(测试1)def test_1(self):print(11111)allure.story(测试2)def test_2(slef):print(22222) 将多个用例写到一个组 allure.story(测试1) allure.title(用例1) def test_1(self):print(11111)allure.story(测试1) def test_2(slef):allure.dynamic.title(用例2)print(22222) 4. 用例标题allure.title(用例1) or allure.dynamic.title(用例2) 两种方法都可以实现 allure.title(用例1) //方法1 def test_1(self):print(11111)allure.story(测试2) def test_2(slef):allure.dynamic.title(用例2) //方法2print(22222) 右边 1. 测试用例严重级别allure.severity(allure.severity_level.BLOCKER) //BLOCKER(致命)CRITICAL严重,NORMAL(一般)MINOR提示TRIVIAL轻微一般默认为NORMAL allure.severity(allure.severity_level.TRIVIAL) allure.story(测试3) def test_3(slef):print(33333) 2. 测试用例的描述allure.description(测试用例的描述) allure.description(测试用例的描述方法1) allure.title(测试4) def test_4(slef):print(44444)allure.title(测试5) def test_5(slef):allure.dynamic.description(测试用例的描述方法2)print(55555) 3. 接口访问链接allure.link(接口链接) 4. BUG链接allure.issue(bug链接) 5. 测试用例链接allure.testcase(用例链接) allure.story(测试6) allure.link(https://www.baidu.com/0,name接口链接) allure.issue(https://www.baidu.com/,namebug链接) allure.testcase(https://www.baidu.com/,name用例链接) def test_6(slef):print(66666) 6. 测试用例的操作步骤allure.step(第str(i)步): allure.story(测试1) def test_7(self):for i in range(0,10):with allure.step(第str(i)步):pass 7. 测试附件allure.attach(bodycontent,name错误截图,attachment_typeallure.attachment_type.PNG) //一般用于错误截图常用于web自动化测试 allure.story(测试1) def test_8(self):# 附件上传需要使用二进制可以是图片可以是文本可以是其它文件with open(rD:\study\allure-2.25.0\allure-2.25.0\plugins\custom-logo-plugin\static\1.png,moderb) as f:content f.read()allure.attach(bodycontent,name错误截图,attachment_typeallure.attachment_type.PNG) 8. 文本内容的定制一般应用于接口自动化 allure.story(测试1) def test_9(self):# 请求allure.attach(https://www.baidu.com/0,name接口地址,attachment_typeallure.attachment_type.TEXT)allure.attach(接口参数一般从yaml中获取,name接口参数,attachment_typeallure.attachment_type.TEXT)allure.attach(请求方式get/post,name请求方式,attachment_typeallure.attachment_type.TEXT)allure.attach(请求头一般从yaml中获取,name请求头,attachment_typeallure.attachment_type.TEXT)# 响应allure.attach(响应文本一般从yaml中获取, name响应文本, attachment_typeallure.attachment_type.TEXT)allure.attach(执行结果成功/失败, name执行结果, attachment_typeallure.attachment_type.TEXT) 9. 数据驱动 allure.story(测试1) pytest.mark.parametrize(x, [这是第1个测试值, 这是第2个测试值]) def test_a(self,x):print(ftest_a中的X值为{x}) 由于使用数据驱动用例标题会展示参数数据化驱动中的所有参数若不想要显示则需要修改allure配置 # 修改前 test_result.parameters.extend([Parameter(namename, valuerepresent(value)) for name, value in params.items()if name not in current_param_names])# 修改后 将列表内容去除即可 test_result.parameters.extend([]) 5. allure局域网查看 局域网内网allure open ./reports if __name__ __main__:pytest.main([./test_study/test_allure.py])os.system(allure generate ./temps -o ./reports --clean)os.system(allure open ./reports)
http://www.pierceye.com/news/342681/

相关文章:

  • 知乎的网站建设和网站运营网站建设需求说明
  • 天津做陶瓷的公司网站番禺核酸检测定点医院名单
  • 教育网站赏析delphi网站开发教程
  • 电商网站设计说明书php网站服务器架设
  • 精品课程网站开发项目电子商务的分类
  • 网站建设成品动漫网站建设答辩ppt
  • 邯郸网站设计价格做网站哪便宜
  • 建设网站的一般步骤网站设计下载
  • 广东同江医院网站建设建站网站图片不显示
  • 免费在线响应式网站自助建站网站网页怎么设计
  • 池州网站建设抚顺网站建设公司
  • 网站如可引导客户义乌小程序开发制作公司
  • 环境设计排版素材网站周口市住房和城乡建设局网站
  • 建设部资质查询网站wordpress采集英文
  • 深圳北站设计方案高质量网站外链平台
  • 苏州做网站优化的公司国外 网站页面
  • 网站建设流程发布网站和网页制作鲜花网站建设论文百度文库
  • 建个人网站赚钱吗手机网站页面大小
  • php简单购物网站源码海口网红美食餐厅
  • 傻瓜式建站软件长沙做软件的公司
  • 旅行社营业网点可以做网站吗别人网站建设多少钱
  • 南宁设计网站建设教程网站建设
  • 柯城区住房和城乡建设局网站wordpress仿fe素材
  • 黄岛建设局网站用什么建设网站
  • 桂林dj网站郑州上海做网站的公司
  • 进入江苏省住房和城乡建设厅网站网络舆情监测 toom
  • 延安市建设工程交易中心网站seo网络营销推广优化
  • 网站一条龙服务教育类网站前置审批
  • 安徽省建设厅网站首页wordpress和typecho
  • 网站开发考试题torrentkitty磁力猫引擎