zoukankan      html  css  js  c++  java
  • TESTNG+JENKINS持续集成

    一、环境搭建

    1. 安装testNG插件到eclipse.
      -) 选择菜单 Help /Software updates / Find and Install.
      -) 点击add button然后在location中输入http://beust.com/eclipse/
      -) 确定后会自动安装testNG插件。
      二.包的引入
      WebDriver包:selenium-server-standalone.jar

      testng 包: testng-6.8.jar

      reportng包:reporting.jar,velocity-dep.jar
      ant包:ant-contrib.jar

    三、新建一个testNG工程:(手动创建lib文件夹,需要把以上三个JAR包放在lib下面)

    创建类和方法:
    import org.testng.annotations.Test;
    public class test {
    @Test(groups="init")
    public void f() {
    System.out.println("This is test f" );
    }
    @Test(groups="init")
    public void g() {
    System.out.println("This is test g" );
    }
    @Test(dependsOnGroups="init",groups="proccess")
    public void h() {
    System.out.println("This is test h " );
    }
    @Test(dependsOnGroups="init",groups="proccess")
    public void i() {
    System.out.println("This is test i" );
    }

    }
    testng.xml 文件:
    //















    ant build.xml文件内容:
    //

    JENKINS引入SVN下载工程包,编译运行:
    SVN配置:

    ANT配置:

    报告输出:
    (JENKINS安装TESTNG report 插件)
    jenkins console执行报告输出,基本上到这一步就成功了。

    再看TESTNG插件生成的TESTNG报告:

  • 相关阅读:
    解决页面报错: GEThttp://localhost:8080/favicon.ico 404 (Not Found)
    vs2019快捷键整理
    js保存图片至本地
    PHP输出方式的区别
    js运算精度问题
    Hadoop相关问题
    2015年10月5日 12:49:07
    Hive数据倾斜
    Hadoop错误日志
    使用maven开发MR
  • 原文地址:https://www.cnblogs.com/stone-xiao/p/6029600.html
Copyright © 2011-2022 走看看