I'm running TestNG tests via maven using: mvn test
or mvn test -Dtest=<Class-Name>
or mvn test -Dgroups=<groups...>
.
There are a lot of output arriving from the tests that I want to store in files, but the console output I need is like:
TestA.test1 - Passed
TestA.test2 - Failed
TestB.test11 - Passed
I implemented a listener that implements ITestListener and put System.out.println(message); with suitable messages for each method. In the pom.xml I added a plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.9</version>
<configuration>
<properties>
<property>
<name>listener</name>
<value><my listener full name class></value>
</property>
</properties>
</configuration>
</plugin>
But nothing seems to respond, and the same output keeps coming to the console.
Any idea what am I doing wrong here? I want to keep running my tests via mvn test
but change the output to be more organized.