【问题标题】:How to serve Allure Report without automatically starting the browser如何在不自动启动浏览器的情况下提供 Allure Report
【发布时间】:2017-08-22 05:20:12
【问题描述】:

当我启动allure时,服务器总是尝试启动浏览器:

$ /home/allure/allure-2.3.4/bin/allure serve target/allure-results -p 5012
    Generating report to temp directory...
    Report successfully generated to /tmp/779851636804605067/allure-report
    Starting web server...
    2017-08-21 17:51:00.271:INFO::main: Logging initialized @3082ms
    Xlib:  extension "RANDR" missing on display ":99".
    Exception in thread "main" java.lang.UnsupportedOperationException: The BROWSE action is not supported on the current platform!
            at java.awt.Desktop.checkActionSupport(Desktop.java:225)
            at java.awt.Desktop.browse(Desktop.java:381)
            at io.qameta.allure.Commands.openBrowser(Commands.java:207)
            at io.qameta.allure.Commands.open(Commands.java:135)
            at io.qameta.allure.Commands.serve(Commands.java:119)
            at io.qameta.allure.CommandLine.run(CommandLine.java:136)
            at java.util.Optional.orElseGet(Optional.java:267)
            at io.qameta.allure.CommandLine.main(CommandLine.java:72)
    2017-08-21 17:51:06.387:WARN:oejsh.ResourceHandler:qtp1928301845-20: org.eclipse.jetty.io.EofException
    2017-08-21 17:51:06.388:WARN:oejsh.ResourceHandler:qtp1928301845-15: org.eclipse.jetty.io.EofException

问题不在于错误,而是在启动时,我不需要在此主机上启动它。 如何在不启动浏览器的情况下启动 allure 服务器?

【问题讨论】:

  • allure serve 只能用作在本地机器上查看结果的工具。如果您需要托管报告,正确的方法是在某个文件夹中生成报告并配置 nginx 以提供来自该文件夹的文件
  • 谢谢@Dmitry,你能再帮我一个吗,需要服务哪个目录?如果我使用 /home/project-name/allure-report 。我没有看到 Steps 并且 Story 上没有分组。也就是说,注释不会被捕获。我看到了 /target/allure-reults 的魅力。或许在 Nginx 中,除了/home/project/allure-report 之外,还有其他需要提的
  • 您生成报告的目录(在您的情况下为/home/project/allure-report

标签: allure


【解决方案1】:

您可以使用 docker 容器 Allure Docker Service,自动识别结果并更新报告而无需执行任何操作: https://github.com/fescobar/allure-docker-service

【讨论】:

    猜你喜欢
    • 2020-01-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-03
    • 1970-01-01
    相关资源
    最近更新 更多