我能够运行所有测试,但我不知道如何在 pom.xml 中配置组并使用 maven 运行测试组。
我正在使用 TestNG 框架,但没有像 pom.xml 中的 testing.xml 那样添加任何内容。
谁能帮我在 pom.xml 中使用 testng.. 下面是我的 pom.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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.automation.tests</groupId>
<artifactId>autotest</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>autotest</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<classifier>jdk15</classifier>
<version>5.11</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>LATEST</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
<!--<executions> <execution> <phase>pre-integration-test</phase> <goals>
<goal>start-server</goal> </goals> <configuration> <background>true</background>
</configuration> </execution> <execution> <id>stop-selenium</id> <phase>post-integration-test</phase>
<goals> <goal>stop-server</goal> </goals> </execution> </executions> -->
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- Skip the normal tests, we'll run them in the integration-test phase -->
<skip>true</skip>
</configuration>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>false</skip>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>