【问题标题】:Allure report using Newman使用纽曼的倾城报告
【发布时间】:2018-03-11 14:36:13
【问题描述】:

我使用“newman”在 Jenkins 服务器上运行 API 测试。这对我来说很容易,我在“Postman”中编写测试脚本并在“newman”中运行我的收藏,但我无法为我的经理提供好的报告。我找到了“魅力报告”,我喜欢它。如果我使用“纽曼”,是否有机会创建魅力报告。 allure 支持 newman 吗?

【问题讨论】:

    标签: rest report postman allure newman


    【解决方案1】:

    看起来不行,这不可能。

    为什么现在(在编写测试之后)您正在寻找报告工具?当 qa 团队分析测试工具可用于自动化时,它的活动发生在启动自动化过程中。

    我查看了https://github.com/postmanlabs/newman 并认为您可以尝试将命令行输出解析为文本文件吗?并使用此输出为经理生成简单报告。

    【讨论】:

    • 为什么不可能?运行 newman 后生成 junit xml 报告。我可以使用 allure 基于该 junit xml 文件创建报告吗?
    • 测试后使用 allure-results 创建报告诱惑工具。是在你的项目中构建 allure 以生成 allure-results 目录的方法吗? Maven、gradle 等?
    【解决方案2】:

    是的,你可以。请按照以下步骤操作:

    we can generate nice and clean report using Allure-js framework.
    1. Installation
    $ npm install -g newman-reporter-allure
        
    2. Run the newman cli command to generate Allure results, specify allure in Newman's -r or --reporters option.
    $ newman run <Collection> -e <Environment> -r allure
    
    3. Allure results will be generated under folder "allure-results" in the root location. Use allure-commandline to serve the report locally.
    $ allure serve
    
    4. To generate the static report web-application folder using allure-commandline
        $ allure generate --clean
    Report will be generated under folder "allure-report" in the root location
    

    .

    【讨论】:

      【解决方案3】:

      尝试使用我的repository,这是一个棘手的解决方案,它涵盖了所有内容:

      并添加更多内容:

      1. 添加 2 个文件:collection *.json 和 env *.json
      2. 使用 chmod 命令为 start.sh 文件添加 +x 权限,例如 chmod +x start.sh
      3. 并运行脚本 ./start.sh your_collection.json your_env.json

      最后,您将获得 2 份报告:

      • HTML 报告
      • 诱惑报告

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-10-12
        • 1970-01-01
        • 1970-01-01
        • 2019-08-04
        • 2020-08-04
        • 2022-08-04
        • 2022-11-14
        • 2020-06-10
        相关资源
        最近更新 更多