Pytest----生成allure执行报告

简介: Pytest----生成allure执行报告

【原文链接】

1 编写如下测试脚本

def test_1():
    print("in test_1")
    assert 1==1

def test_2():
    print("in test_2")
    assert 1==2

def test_3():
    print("in test_3")
    assert 1==1

def test_4():
    print("in test_4")
    assert 1==2

def test_5():
    print("in test_5")
    assert 1==1

def test_6():
    print("in test_4")
    assert 1==2

2 执行如下命令,制定目录生成allure日志

pytest -s --alluredir=./temp

3 执行如下命令指定生成报告的目录,根据执行结果生成allure报告

allure generate ./temp -o ./report

4 此时report目录下有index.html,即allure报告

在这里插入图片描述

4 用浏览器打开index.html,如下:

在这里插入图片描述

5 点开test_example,如下:

在这里插入图片描述

6 点击此处即可切换至中文

在这里插入图片描述

7 切换中文后,如下所示:

在这里插入图片描述

目录
相关文章
|
9月前
|
测试技术
26-pytest-allure描述用例详解
26-pytest-allure描述用例详解
|
9月前
|
测试技术
23-pytest-清空allure历史报告
23-pytest-清空allure历史报告
|
9月前
|
测试技术
22-pytest-allure.step()测试步骤描述
22-pytest-allure.step()测试步骤描述
|
测试技术
pytest学习和使用14-Pytest用例执行结果有哪几种状态?
pytest学习和使用14-Pytest用例执行结果有哪几种状态?
76 0
|
测试技术
Pytest----allure报告定制样式
Pytest----allure报告定制样式
403 0
Pytest----allure报告定制样式
|
IDE 测试技术 Linux
Pytest----如何执行pytest自动化测试脚本
Pytest----如何执行pytest自动化测试脚本
442 0
|
测试技术
Pytest----如何正确使用pytest的日志功能
Pytest----如何正确使用pytest的日志功能
450 0
Pytest----allure报告定制logo
Pytest----allure报告定制logo
156 0
Pytest----allure报告定制logo
|
测试技术
Pytest----fixture高级应用
Pytest----fixture高级应用
135 0

热门文章

最新文章