美文网首页
Pytest学习12 -测试结果生成HTML报告插件之pytes

Pytest学习12 -测试结果生成HTML报告插件之pytes

作者: C1R2 | 来源:发表于2020-11-20 22:24 被阅读0次

    环境:python3.6+

    安装插件命令:
    pip3 install pytest-html -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

    快速入门
    pytest --html=report.html
    在当前目录下创建一个report.html的测试报告

    合并CSS
    上面命令生成的报告,css是独立的,分享报告的时候样式会丢失,为了更好的分享发邮件展示报告,可以把css样式合并到html里
    pytest --html=report.html --self-contained-html

    注意事项
    在将文件或链接添加到独立报告时,插件会发出warnings;
    在html测试报告中可能无法按预期显示文件或链接


    参考链接
    https://www.cnblogs.com/poloyy/p/12688606.html

    相关文章

      网友评论

          本文标题:Pytest学习12 -测试结果生成HTML报告插件之pytes

          本文链接:https://www.haomeiwen.com/subject/aarfiktx.html