該條僅供參考,只是其中一種情況
之前使用的各種版本:
python:3.7.3
allure:2.13.10
pytest:6.2.4
allure-pytest:2.9.42
pytest.main(["-s", 'test_three.py', '--alluredir', '../allure-result/html/'])
>allure generate allure-result/html/ -o report-html/ --clean
正常生成測試報告,打開index.html頁面為空白
重新下載allure版本:
python:3.7.3
allure:2.9.0
pytest:6.2.4
allure-pytest:2.9.42
打開后頁面有數據(從結果看是版本兼容的問題)
可能需要重啟pycharm,我是直接重啟了電腦,然后成功
該篇文章評論里有一條說到這個,可參考,統一allure和allure-pytest的版本號
https://ask.csdn.net/questions/7440063?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522162433274316780255220726%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=162433274316780255220726&biz_id=4&utm_medium=distribute.pc_search_result.none-task-ask_topic-2~all~first_rank_v2~rank_v29-3-7440063.first_rank_v2_pc_rank_v29&utm_term=python+allure%E7%94%9F%E6%88%90index.html%E9%A1%B5%E9%9D%A2%E7%A9%BA%E7%99%BD&spm=1018.2226.3001.4187
應該是版本問題,我感覺應該是官網下載的allure版本高於解釋器里面allure-pytest的版本,版本不符合導致的JS報錯。你們可以試試統一下版本號
