allure-behave:未能识别“allure-behave”作为 cmdlet、函数、脚本文件或可操作程序的名称
我创建了一个新的虚拟环境(virt_env),然后用命令 pip install allure-behave
安装了 allure-behave。
当我运行自动化测试时,我看到有一个 allure-results 文件夹,里面有 JSON 文件:
但是当我尝试通过运行命令 allure generate
来生成报告时,我看到一个错误信息:
allure-behave : 这个术语 'allure-behave' 没有被识别为 cmdlet、函数、脚本文件或可操作程序的名称。请检查名称的拼写,或者如果包含了路径,请确认路径是否正确,然后再试一次。
我该怎么解决这个问题呢?
我按照 Allure 网站 的说明进行了操作。
当我尝试运行 allure-behave --version
时也出现了同样的错误:
我不确定这是否重要,但我是在 PowerShell 中运行命令的。
1 个回答
1
你需要安装 Allure 命令行工具,才能从 Allure 的结果中生成报告。可以查看这个链接了解安装步骤:https://allurereport.org/docs/gettingstarted-installation/