无法在Mac中使用Pytest生成Allure结果文件

问题描述 投票:0回答:1

所以我有一台带有 m2 芯片的 mac pro 框架是 selenium 和 Python

早期在 Windows 中,我能够通过导航到测试文件夹并在 cmd 中运行以下命令来生成报告

“pytest -n 3 -v -s --alluredir =”E:\selenium-python-framework-master llure-结果“test_homepage.py”

它使用 3 个浏览器并行运行测试,并且还能够在 --alluredir"E:\selenium-python-framework-master llure-results" 的帮助下在文件夹中生成结果 但现在在 mac 中,如果我在终端中运行相同的命令,它会显示“--alluredir=”无法识别的参数

我还在mac终端中执行了“brew install allure”,但当我通过在终端中传递“pytest”来运行测试时,它仍然运行测试,但不生成任何测试结果文件

我还在mac终端中执行了“brew install allure”,但当我通过在终端中传递“pytest”来运行测试时,它仍然运行测试,但不生成任何测试结果文件

python macos selenium-webdriver pytest allure
1个回答
0
投票

为了能够在测试执行期间生成 allure 结果,您需要为 python 安装 allure-pytest 模块。所以你需要运行:

pip install allure-pytest

然后运行

pytest -n 3 -v -s --alluredir="E:\selenium-python-framework-master\allure-results
就会生成结果。

© www.soinside.com 2019 - 2024. All rights reserved.