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