Turning off test output in TestNG

I am currently running my test suit using this XML file:

<suite name="something"> <test name="generic valid compilation"> <parameter name="isValid" value="true"/> <parameter name="testGroup" value="generic"/> <groups> <run> <include name="compilation"></include> <exclude name="module"></exclude> <exclude name="refinement"></exclude> <exclude name="specifications"></exclude> </run> </groups> <classes> <class name="test.TestLauncher"/> </classes> </test> </suite> 

and I'm looking for a way to disable the created test folder, which TestNG apparently runs by default. From http://reportng.uncommons.org/ I see that

You can also disable TestNG resellers by default by setting the useDefaultListeners attribute "False".

which seems to fit my needs, would it not be a fact that their XML structure seems different from mine.

Does anyone know how to disable test output files using TestNG?

thanks

+6
source share
3 answers

As you said, just use this flag to disable default reports. The exact name depends on whether you use the command line, ant or maven. See this line in the documentation that suits you.

+7
source

I just clean it afterwards:

 <plugin> <artifactId>maven-clean-plugin</artifactId> <version>2.4.1</version> <configuration> <filesets> <fileset> <directory>test-output</directory> <followSymlinks>false</followSymlinks> </fileset> </filesets> </configuration> </plugin> 
+2
source

If you run tests from the command line, use –useDefaultListeners false :

 java org.testng.TestNG –useDefaultListeners false testng.xml 

If you want to do this programmatically:

 TestNG testNG = new TestNG(); testNG.setUseDefaultListeners(false); ... 
+2
source

Source: https://habr.com/ru/post/886439/


All Articles