allure.story在allure报告里面没有体现

python自动化

pytest+allure报告,在测试类设置@allure.story,@allure.feature,在allure报告里面没有体现

img

求大家帮忙看看

img

img

img

只能先试试看:

  1. 你的测试文件里也要: import allure。
  2. 确保已经安装了allure-pytest, 以及在环境变量中正确的配置了allure的bin文件夹。
  3. 执行命令: pytest tests/scripts/test.py --alluredir=./report
  4. pytest.ini的第一行改成: addopts = -sv --html=./report/test_report.html --clean-alluredir
  5. 执行命令: allure serve ./report/

最后最重要的是,先在 总览 里,找到你定义的 allure feature和story, 然后点进去。我看你的测试报告,确实少了些东西。