【问题标题】:Postman - Newman htmlextra report generation IssuePostman - Newman htmlextra 报告生成问题
【发布时间】:2019-09-16 13:14:06
【问题描述】:

我正在 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 中生成报告。

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

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

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

【问题讨论】:

    标签: postman-collection-runner newman


    【解决方案1】:

    在您的第一个命令中,您没有指定要使用 -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 参数。您也没有在此命令中传递报告文件位置,因此它将在 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

    【讨论】:

    • 希望如此——我给记者写信了 :)