生成后Allure报告为空

Ser*_*aev 4 allure newman

我正在使用魅力2.8.1。我已使用 NPM 将其安装到我的 docker 容器中。之后,我运行allure generate test-results命令从 junit xml 生成魅力报告,该报告是使用 newman 工具生成的。

在报告目录中,会出现一个空目录data/attachments和一个data/test-cases包含 junit xml 中所有测试用例的目录。

测试用例 xml 示例:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="test-collection-2" tests="1" time="0.463">
  <testsuite name="Test succeed request" id="b3ce6542-d493-4206-b67b-e74e4ca58fde" tests="2" failures="0" errors="0" time="0.463">
    <testcase name="Status code is 200" time="0.463"/>
    <testcase name="Content-Type is present" time="0.463"/>
  </testsuite>
</testsuites>
Run Code Online (Sandbox Code Playgroud)

我打开生成的输入 html 后,什么也没有出现。 在此输入图像描述

你能帮我解决这个问题吗?

Joh*_*tty 5

Allure 需要 Web 服务器来打开报告。生成后我们不能简单地打开index.html文件。要在本地计算机中打开生成的报告,有两种方法

  1. Allure 的默认open命令。
allure open path/to/report
Run Code Online (Sandbox Code Playgroud)

这将在您的默认网络浏览器中打开报告。

  1. 在报告文件夹中运行一个简单的 HTTP 服务器,然后在浏览器中打开它。
python -m SimpleHTTPServer 8626
Run Code Online (Sandbox Code Playgroud)

0.0.0.0:8626现在在浏览器中打开。

如果您上传生成的网络服务器目录,这将没有任何问题。