Postman - Newman htmlextra 报告生成问题

Postman - Newman htmlextra report generation Issue

我在 Newman 运行 收集 json 文件并使用 htmlextra 生成报告。

  1. 当我使用此命令时,我没有生成报告 newman run "Telus Upgrade Service Testing.postman_collection.json" -e "Upgrade Services Variables.postman_environment.json" --reporter-htmlextra-export -k

  2. 当我使用这段代码时,报告在工作目录 newman run "Telus Upgrade Service Testing.postman_collection.json" -e "Upgrade Services Variables.postman_environment.json" --reporter-htmlextra-export -r htmlextra -k.

  3. 中生成

问题是当我在 cmd 中使用 fist 命令时,我能够看到所有服务 运行 但没有生成报告。

当我在 cmd 中使用第二个命令时,我没有看到任何服务 运行 但在后端,服务是 运行 并且生成了报告。

请为我提供解决方案,我想在 cmd 中查看服务 运行 并生成报告。

在您的第一个命令中,您没有指定要使用 -r htmlextra 的报告者,因此它将 运行 默认为 cli 报告者,而且您使用的是 --reporter-htmlextra-export 但没有传入导出报告文件的位置,因此实际上不需要添加该参数。

newman run "Telus Upgrade Service Testing.postman_collection.json" -e "Upgrade Services Variables.postman_environment.json" --reporter-htmlextra-export -k

在第二个命令中,要查看 cli 输出以及 htmlextra 报告,您需要告诉 Newman 显示它。

在命令中使用 -r cli,htmlextra arg。您也没有在此命令中传递报告文件位置,因此它将在 Newman 目录中创建它。如果您不想更改导出位置,--reporter-htmlextra-export 标志是多余的。

newman run "Telus Upgrade Service Testing.postman_collection.json" -e "Upgrade Services Variables.postman_environment.json" --reporter-htmlextra-export -r htmlextra -k

所有选项 htmlextra 选项以及如何使用报告器都可以在这里找到:

https://github.com/DannyDainton/newman-reporter-htmlextra#options