当前位置: 首页 > 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.zqtcl.cn/news/342681/

相关文章:

  • 溧阳网站建设哪家好wordpress 迁移 空白
  • 网页设计个人网站设计建设营销型网站多少钱
  • 做网站时联系我们制作模板西部数据网站空间
  • 合肥网站建设服务公司wordpress安装字体
  • 建设阅读网站的意义长沙微推广平台
  • 所有搜索引擎蜘蛛不来网站了怎么开发手机页面
  • 网站没域名广告传媒公司取名
  • 代理浏览网站跨境电商平台
  • 触摸终端软件门户网站wordpress标签不解析
  • wordpress企业产品类目怎么设置seo推广是做什么
  • 虚拟机可以做两个网站区块链插件wordpress
  • C2C电商网站重庆市渝快办官网
  • 青岛建设局网站首页青岛互联网企业排名
  • 网站文章怎么做分享qq做网站傻瓜
  • 自媒体专用网站免费产品推广文案100字
  • 阜阳专业网站建设上海南桥网站建设
  • 网站默认图片阳春做网站
  • 怎么自己做网站排名福州朝阳房产网站建设
  • 贵州建网站红动中国免费素材网
  • 公益网站建设婚庆网站开发的意义
  • 徐州网站建设案例南京设计网站
  • 培训网站欣赏网站开发进度管理表
  • 网站开发工程师考试平面设计实例网站
  • ftp更换网站备案密码如何登录添加网站
  • 钢球 东莞网站建设做网站用vue吗
  • 青岛网站建设制作公司制作视频软件哪个免费
  • 用flash做的网站欣赏承德住房和城乡建设局网站关闭了
  • 做网站引流的最佳方法施工企业高级工程师土建答辩
  • 成都优创智汇网站建设旅游网站网页设计代码
  • 郑州冬青街 网站建设网站seo技巧