pytest+allure打开报告显示loading和404的解决方案

【问题表现】
双击html打开allure报告显示loading和404
在这里插入图片描述
【解决方案一】
运行下列代码即可得到allure渲染后的报告

import os
import pytest

if __name__ == '__main__':

    # 执行pytest用例,并生成allure报告

    pytest.main(['-s', '-v', '--lf', '-m', 'test', r"--alluredir=./report/reportDetail/"])

    os.system("allure generate ./report/reportDetail/ -o ./report/report/ --clean")
    os.system("allure open ./report/report/ ")  # 运行完直接打开报告

【解决方案二】
1、执行完测试用例后
2、index.html文件右击,选择Open In–》Browser–》Chrome
在这里插入图片描述
【解决方案三】
1、执行完测试用例后
2、在terminal输入allure open ./report/report/,执行命令。

猜你喜欢

转载自blog.csdn.net/weixin_46475607/article/details/128217674