首页 文章

可以使用Config.xml文件自定义klove记者(Extent Report)吗?

提问于
浏览
2

我们可以使用Config.xml来定制klov报告器吗?我正在尝试使用下面的代码,但我认为它没有工作 . 如果我在这里做错任何事,请看看并告诉我 .

var klovReporter = new KlovReporter();

        klovReporter.LoadConfig(configFilePath);

        // specify mongoDb connection
        klovReporter.InitMongoDbConnection("192.168.28.88", 27017);

        // specify project ! you must specify a project, other a "Default project will be used"
        klovReporter.ProjectName = "CsharpReports";

        // you must specify a reportName otherwise a default timestamp will be used
        klovReporter.ReportName = "Build " + DateTime.Now.ToString();

        // URL of the KLOV server
        klovReporter.KlovUrl = "192.168.28.88:8090";

        _extent = new ExtentReports();
        _extent.AttachReporter(klovReporter);

我使用下面的xml文件进行自定义配置 .

<?xml version="1.0" encoding="UTF-8" ?>
<extentreports>
  <configuration>
    <!-- report theme -->
    <!-- standard, dark -->
    <theme>dark</theme>

    <!-- document encoding -->
    <!-- defaults to UTF-8 -->
    <encoding>UTF-8</encoding>

    <!-- protocol for script and stylesheets -->
    <!-- defaults to https -->
    <protocol>https</protocol>

    <!-- title of the document -->
    <documentTitle>Automation Test Report</documentTitle>

    <!-- report name - displayed at top-nav -->
    <reportName>Automation Test Report</reportName>

    <!-- location of charts in the test view -->
    <!-- top, bottom -->
    <testViewChartLocation>bottom</testViewChartLocation>

    <!-- custom javascript -->
    <scripts>
      <![CDATA[

       ]]>
    </scripts>
  </configuration>
</extentreports>

我也有兴趣知道klov记者(社区版)中可用的观点类型 . 我可以看到我的报告中遗漏了一些观点,这些观点都在demo klov记者中 . 请仔细阅读以下报告以便更好地理解 .

Available views in my klov report:

image

Views available in klov reporter demo.

image

2 回答

  • 1

    不能 . 要对Klov进行任何更改,您必须直接修改源 . 您共享的版本是0.1.0,现在可用 . 社区版API无法使用某些元素,这就是标签链接不可见的原因 .

  • 0

    改变消息来源你的意思是什么?

相关问题