zoukankan      html  css  js  c++  java
  • mvn test 执行testng测试用例

    maven项目,把testng用例防止test目录下,配置pom.xml 文件如下,执行mvn test 能自动执行testng里面的用例

    <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.test</groupId>
      <artifactId>mvntestng</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <packaging>jar</packaging>
    
      <name>mvntestng</name>
      <url>http://maven.apache.org</url>
    
      <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      </properties>
    
      <dependencies>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>3.8.1</version>
          <scope>test</scope>
        </dependency>
                <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>6.9.13.6</version>
            </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.19.1</version>
            <configuration>
              <suiteXmlFiles>
                <file>testng.xml</file>
               <file>testng2.xml</file>
              </suiteXmlFiles>
              <properties>
                <property>
                  <name>suitethreadpoolsize</name>
                  <value>2</value>
                </property>
              </properties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </project>

    执行结果

  • 相关阅读:
    django:开发一个下载图片的接口
    django:cbv模式和fbv模式的区别
    java生成二维码/java解析二维码
    java如何台生成二维码详解
    html5 WebSocket的Js实例教程
    vue 组件传参
    Vue路由注意事项
    Vue全家桶
    浅谈vue对seo的影响
    vue打包详情
  • 原文地址:https://www.cnblogs.com/testway/p/6672910.html
Copyright © 2011-2022 走看看