测试报告美化与定制(allure、pytest+allure+selenium实现ui自动化测试)

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
https://docs.qameta.io/allure

brew install allure

在pycharm下载 allure-pytest

import pytest
def test_success():
    """this test succeeds"""
    assert True

def test_failure():
    """this test fails"""
    assert False

def test_skip():
    """this test is skipped"""
    pytest.skip('for a reason!')

def test_broken():
    raise Exception('oops')

在pycharm的终端执行,生成report:

pytest basic_report.py --alluredir=./datas/report

打开report:

allure serve ./datas/report 

在这里插入图片描述
生成一个html的报告:

pytest basic_report.py --alluredir=./datas/report

生成报告后,转换为html的格式

allure generate ./datas/report -o ./report/ --clean

打开:

allure open -h 127.0.0.1 -p 9901 ./report

在这里插入图片描述
allure_feature_story.py

import pytest
import allure

@allure.feature("登录模块")
class TestLogin():
    @allure.story("登录成功")
    def test_login_succes
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值