zoukankan      html  css  js  c++  java
  • 4--TestNG测试报告

    第一:自带测试报告(略)

    第二:Reportng测试报告(略)

    第三:ExtentReport--extentreports.com

    (1) pom.xml:不是总的pom,是文件夹下的pom

    <dependency>

      <groupid>com.relevantcodes</groupid>

      <artifactid>extentreports</artifactid>

      <version>2.41.1</version>

    </dependency>

    <dependency>

      <groupid>com.vimalselvam</groupid>

      <artifactid>testng-extentsreport</artifactid>

      <version>1.3.1</version>

    </dependency>

    <dependency>

      <groupid>com.aventstack</groupid>

      <artifactid>extentreports</artifactid>

      <version>3.0.6</version>

    </dependency>

    编码:

    Assert.assertEquals(i:1,i1:1);

    Assert.assertEquals(i:1,i1:2);

    Assert.assertEquals(s:"aaa",a1:"aaa");

    Reporter.log(s:"这是我们自己写的日志");

    throw new RuntimeException("这是我自己的运行时异常");

    testng.xml:

    <suite name="我自己的接口测试套件">

      <test name="这些事测试模块">

        <classes>

          <class name ="com.tester.extend.demo.TestMethodsdemo"/>

            <methods>

              <include name="test1">

              <include name="test2">

            </methods>

        </classes>

      </test>

      <listeners>

        <listener class-name="com.vimalselvam.testng.listener.ExtentTestngFormater"><>

      </listeners>

    </suite>

    执行:

    多出文件夹test-output,文件emailable-report.html,邮件copy path,打开浏览器输入复制的链接

    多出文件夹test-output,文件report.html,邮件copy path,打开浏览器输入复制的链接(有一个cdn的css加载不出来)

    解决样式加载不到的问题:

    网上搜索,主要意思是自己创建一个监听类,overwrite

    https://www.cnblogs.com/kasen95/p/9798417.html

    https://blog.csdn.net/HY_smile/article/details/81705951

     需修改下,第113行代码:

    //怎么样解决cdn.rawgit.com访问不了的情况
    htmlReporter.config().setResourceCDN(ResourceCDN.EXTENTREPORTS);

     

  • 相关阅读:
    佛经中的 云何梵 什么意思?
    论节拍器的重要性,一定要习惯使用。
    Linux文件系统分析
    uboot启动内核分析
    Linux内核启动流程分析
    Linux内核配置机制与编译过程分析
    Linux内核源码目录结构分析
    Kconfig文件分析
    Ubuntu下安装make
    Ubuntu下交叉编译器gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12的安装和使用
  • 原文地址:https://www.cnblogs.com/lizhiyan/p/10560378.html
Copyright © 2011-2022 走看看