zoukankan      html  css  js  c++  java
  • selenium+jenkins+maven+testNG搭建持续集成环境

    为了简明起见,分几大部分,很基础的细节就不详述了

    一·安装jenkins

    二·创建一个maven项目的job

      2.1   填上SVN的Repository URL

      2.2  由于是在本地执行maven命令,所以添加构建步骤:Execute windows batch command

         写入以下命令(注意需要在pom.xml文件中加上maven的插件,pom.xml文件在后面)

        cd D:Program Files (x86)JenkinsworkspaceZTHaiWaiGouKeZhiFu.java
          mvn install
        mvn Suite.xml

    三·

     ---------------------------------------------分割线----------------------------------------

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
    
      <groupId>com.zzt.test</groupId>
      <artifactId>Test</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <packaging>jar</packaging>
    
      <name>Test</name>
      <url>http://maven.apache.org</url>
    
      <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      </properties>
    
    
    
    
    
        <pluginRepositories>
    
            <pluginRepository>
    
                <id>apache.snapshots</id>
    
                    <url>
    
                    http://people.apache.org/repo/m2-snapshot-repository/
    
                    </url>
    
            </pluginRepository>
    
        </pluginRepositories>
    
    
      <dependencies>
            <dependency>
              <groupId>junit</groupId>
              <artifactId>junit</artifactId>
              <version>3.8.1</version>
              <scope>test</scope>
            </dependency>
        
        <!--添加selenium依赖   https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
              <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-java</artifactId>
                <version>2.44.0</version>
              </dependency>
        
      
      
      
              <!--添加TestNG依赖  -->
              <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>6.9.10</version>
              </dependency>
       
      </dependencies>
      
      <!-- 添加maven插件 -->
      <build>
              <plugins>
                  <plugin>  
                    <groupId>org.apache.maven.plugins</groupId>  
                    <artifactId>maven-surefire-plugin</artifactId>  
                    <configuration>  
                        <suiteXmlFiles>  
                            <suiteXmlFile>Suite.xml</suiteXmlFile>  <!-- 此处写上需要执行的TestNG测试套件 -->
                        </suiteXmlFiles>  
                    </configuration>  
                    <version>2.5</version>  
                    </plugin>  
               </plugins>
        </build>       
      
    </project>
    pom.xml
  • 相关阅读:
    abp vnext v2.9.0 Blogging模块安装遇到的问题及解决方法
    TestCafe前端E2E自动化测试技术要点(转)
    UI自动化测试框架 ---TestCafe(转)
    一条龙(1)
    Nginx常用命令
    如何下载各大视频网站的视频,从html5中video标签截取blob视频流(纯使用Downie下载工具非代码操作)
    beego连接Mysql,生成WebAPI+CRUD和Swagger
    Go每日一题(7)
    Go每日一题(6)
    Go每日一题(5)
  • 原文地址:https://www.cnblogs.com/gcgc/p/5624696.html
Copyright © 2011-2022 走看看