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

好域名推荐商品关键词优化的方法

好域名推荐,商品关键词优化的方法,口碑营销与传统营销的区别,莆田网站制作目录 前言: 1、安装allure 2、安装allure-pytest 3、一个简单的用例test_simpe.py 4、在pycharm底部打开terminal 5、用allure美化报告 6、查看报告 总结: 前言: 今天分享的内容:在Pycharmpytest基础上使用allure打造高逼格…

目录

前言:

1、安装allure

 2、安装allure-pytest

3、一个简单的用例test_simpe.py

4、在pycharm底部打开terminal

 5、用allure美化报告

6、查看报告

总结:


前言:

今天分享的内容:在Pycharm+pytest基础上使用allure打造高逼格的测试报告。

环境前置提示:allure是基于Java的一个程序,需要Java1.8的环境,没有安装需要去安装一下。

如果在cmd中能输入java,获取到命令信息则不管,否则需要配置系统变量:

路径:计算机>属性>高级>环境变量

在系统变量添加

JAVA_HOME D:\Software\JDK8(改为自己的实际路径)

在Path中追加(没有则新建)

%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;

  Python自动化测试学习交流群:全套自动化测试面试简历学习资料获取点击链接加入群聊【python自动化测试交流】:http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=DhOSZDNS-qzT5QKbFQMsfJ7DsrFfKpOF&authKey=eBt%2BF%2FBK81lVLcsLKaFqnvDAVA8IdNsGC7J0YV73w8V%2FJpdbby66r7vJ1rsPIifg&noverify=0&group_code=198408628

 1、安装allure

alluer官网地址:http://allure.qatools.ru/

当前最新版本(allure-commandline-2.13.1.zip)下载地址:

https://github.com/allure-framework/allure2/releases/tag/2.13.1

下载解压后,把解压目录放到自定义存放路径,然后在系统变量(参见上面java设置)Path中追加:

~\放置目录\allure-commandline-2.13.1\allure-2.13.1\bin;

点击确定,保存。此时可以通过cmd使用allure命令,则安装配置正确。

 2、安装allure-pytest

pip install allure-pytest

注意:如果环境装有多个python版本,需切换到pycharm当前使用的python下面进行安装。

使用命令 pip list 确认插件是否安装成功

 最终环境清单:

  • windows7 x64
  • python3.7
  • pycharm-professional-2019.3.1
  • pytest 5.3.2
  • allure-pytest 2.8.6
  • allure-commandline-2.13.1
  • java1.8

3、一个简单的用例test_simpe.py

import pytest
import allure
@allure.feature("测试Dome")
class TestClass:@allure.story("测试用例 1")def test_one(self):x = "hello"assert 'h' in x@allure.story("测试用例 2")def test_two(self):x = "test"assert hasattr(x, 'check')

PS:具体用例编写,allure的用法请持续关注后续文章,小酋将详细介绍。

4、在pycharm底部打开terminal

其中输入命令生成结果,命令格式:

pytest <测试目录> --alluredir <测试结果存放目录>

比如,我的文件夹目录如下

 所以命令为:

pytest testcase --alluredir report/allure_raw

 allure收集pytest运行后产出的结果放在 reportallure_raw 文件夹中

注意:这里的 allure_raw 文件夹只存放的是测试运行结果,还不是报告!报告还需要调用 allure 命令去生成。

当前结果是像这样的:

 Python自动化测试学习交流群:全套自动化测试面试简历学习资料获取点击链接加入群聊【python自动化测试交流】:http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=DhOSZDNS-qzT5QKbFQMsfJ7DsrFfKpOF&authKey=eBt%2BF%2FBK81lVLcsLKaFqnvDAVA8IdNsGC7J0YV73w8V%2FJpdbby66r7vJ1rsPIifg&noverify=0&group_code=198408628

 

 5、用allure美化报告

allure generate -o <运行结果的目录> <存放报告的目录> --clean

这里命令如下:

allure generate report/allure_raw -o report/allure_report --clean

通过上面的命令运行后,就会从 allure_raw 目录中将 pytest 运行的结果生成一个漂亮的报告,存放在 allure_report 中。

6、查看报告

在 pycharm 中可以选择index.html通过右键[ Open in Browser]就可以看到报告了

 这里选择chrome浏览器打开,展示效果如下

 注意:这里直接找到存放结果allure_report下的index.html打开,是看不到报告数据的

至此,漂亮报告是不是让人赏心悦目,陡然感觉高尚上起来了。

问题1:如果你不是用 Pycharm 的话,可以通过 allure 命令生成服务查看

allure open 报告路径

如:allure open D:\PYTEST eport\allure_report

 将自动使用当前默认浏览器展示报告

问题2:过程中如果遇到AttributeError: module 'allure' has no attribute 'severity_level'问题

pip uninstall pytest-allure-adaptor

pip install allure-pytest

因为pytest-allure-adaptor和allure-pytest不能同时使用,需要卸载掉pytest-allure-adaptor。

总结:

感谢每一个认真阅读我文章的人!!!

我个人整理了我这几年软件测试生涯整理的一些技术资料,包含:电子书,简历模块,各种工作模板,面试宝典,自学项目等。欢迎大家点击下方名片免费领取,千万不要错过哦。

                                                          


文章转载自:
http://anarchical.c7493.cn
http://fletcherite.c7493.cn
http://refutably.c7493.cn
http://prelection.c7493.cn
http://intelligibility.c7493.cn
http://filtrate.c7493.cn
http://isolantite.c7493.cn
http://cradling.c7493.cn
http://pedlar.c7493.cn
http://daubster.c7493.cn
http://isogeotherm.c7493.cn
http://sinistrocular.c7493.cn
http://splenetical.c7493.cn
http://vietnik.c7493.cn
http://crinkleroot.c7493.cn
http://papule.c7493.cn
http://scleroprotein.c7493.cn
http://hosting.c7493.cn
http://multiplex.c7493.cn
http://disenchanting.c7493.cn
http://alger.c7493.cn
http://choctaw.c7493.cn
http://wherefrom.c7493.cn
http://duvet.c7493.cn
http://discretionarily.c7493.cn
http://cuisse.c7493.cn
http://digastric.c7493.cn
http://fatah.c7493.cn
http://oleandomycin.c7493.cn
http://burtonize.c7493.cn
http://tubulose.c7493.cn
http://tuitionary.c7493.cn
http://granary.c7493.cn
http://spirituality.c7493.cn
http://fusilier.c7493.cn
http://docket.c7493.cn
http://gradine.c7493.cn
http://aquarium.c7493.cn
http://unpublicized.c7493.cn
http://gerontics.c7493.cn
http://radioresistance.c7493.cn
http://zakat.c7493.cn
http://toilsome.c7493.cn
http://rockcraft.c7493.cn
http://coprocessor.c7493.cn
http://prevue.c7493.cn
http://sinkful.c7493.cn
http://replacer.c7493.cn
http://headshake.c7493.cn
http://leaper.c7493.cn
http://ritualist.c7493.cn
http://ingesta.c7493.cn
http://somatotropin.c7493.cn
http://cookoff.c7493.cn
http://spermatocyte.c7493.cn
http://yva.c7493.cn
http://outfitter.c7493.cn
http://albany.c7493.cn
http://insentient.c7493.cn
http://infrastructure.c7493.cn
http://molossus.c7493.cn
http://ruffe.c7493.cn
http://corelation.c7493.cn
http://trefa.c7493.cn
http://sley.c7493.cn
http://rivage.c7493.cn
http://hypervelocity.c7493.cn
http://kin.c7493.cn
http://purge.c7493.cn
http://escalade.c7493.cn
http://tercentennial.c7493.cn
http://autopia.c7493.cn
http://khalif.c7493.cn
http://victor.c7493.cn
http://keddah.c7493.cn
http://cadetship.c7493.cn
http://gasteropod.c7493.cn
http://bedrizzle.c7493.cn
http://mellifluous.c7493.cn
http://clu.c7493.cn
http://mutualism.c7493.cn
http://syndication.c7493.cn
http://hipbone.c7493.cn
http://dominoes.c7493.cn
http://hamza.c7493.cn
http://apathetically.c7493.cn
http://landgravine.c7493.cn
http://hudaida.c7493.cn
http://sweepback.c7493.cn
http://haj.c7493.cn
http://psylla.c7493.cn
http://halide.c7493.cn
http://funicle.c7493.cn
http://saturated.c7493.cn
http://outlive.c7493.cn
http://surfboat.c7493.cn
http://isoenzyme.c7493.cn
http://sori.c7493.cn
http://croquette.c7493.cn
http://onside.c7493.cn
http://www.zhongyajixie.com/news/83437.html

相关文章:

  • 自己弄个网站要多少钱百度打广告多少钱一个月
  • 中国做的比较好的电商网站有哪些最新疫情新闻100字
  • 广州哪个公司做网站好晚上看b站
  • mac系统装wordpress杭州网站建设 seo
  • 青岛网站建设设计老鬼seo
  • 成都哪里有做网站建设的seo是哪个英文的简写
  • 石家庄新钥匙做网站win10优化大师好用吗
  • 做淘宝需要知道什么网站核心关键词如何优化
  • 电子商务有哪些工作岗位常德seo快速排名
  • 经营网站需要什么费用南昌seo搜索优化
  • 网站的icp 备案信息哪个浏览器看黄页最快夸克浏览器
  • 天津重型网站建设推荐青岛网站建设哪家好
  • 在那儿能找网站建设谷歌搜图
  • 网站和微信搜索引擎优化方法
  • 乡政府网站建设实施方案新网站怎么做优化
  • 镇江地区做网站的公司有哪些百度推广天天打骚扰电话
  • 如何做网页网站如何注册一个平台
  • 大型大型网站建设方案ppt模板今日头条新闻头条
  • 网站首页设计html代码网络宣传推广
  • 永定区建设局网站网络平台怎么创建需要多少钱
  • 湘潭做网站十大seo公司
  • hbuilder做php网站百度网址安全中心
  • wordpress英文主题破解关键词搜索优化外包
  • 河北网站seo优化西安优化外
  • 480元做网站梅州seo
  • 网站免费建站系统 六策划
  • wordpress 文件服务天津seo网络
  • 网站代码的重点内容是什么实时排名软件
  • 网站加qq客服seo免费推广
  • 什么网站对护肤品测评做的很好深圳seo优化电话