You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by srianshi79 <an...@gmail.com> on 2012/05/31 20:00:23 UTC

Testng group issue with maven

Hi Everyone,

I have created a testng group (@Test(groups= smoketest)) in my test class
but when I am trying to run this group from commandline using the command
"mvn -Dtestng.groups=smoketest test/ mvn -Dgroups=smoketest test" it is
running all the test cases which I have in my test package and I want to run
only smoketest group not all.

I am using maven 2.7.1 and testng 2.14.2. 

I have two ways to execute group through maven:

1)    <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.7.1</version>
             <configuration>
                        <testFailureIgnore>true</testFailureIgnore>
                    </configuration>
            <executions>
                <execution>
                    <id>smoketest</id>
                    <phase>smoke-test</phase>
                    <goals>
                        <goal>test</goal>
                    </goals>
                    <configuration>
                        <groups>smoketest</groups>
                        
                        <includeGroups>smoketest,D3</includeGroups>
                       
<reportsDirectory>target/smoke-surefire-reports/</reportsDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>
or 
  2)    <  plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.12</version>
        <configuration>
          <groups>smoketest</groups>
          <reportsDirectory>src/smoke-surefire-reports/</reportsDirectory>
        </configuration>
      </plugin>

I would appreciate your help.

Thanks,
Anshika



      

--
View this message in context: http://maven.40175.n5.nabble.com/Testng-group-issue-with-maven-tp5710476.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org