Folks!
I'm new on TestNG, and I'm trying it with Maven (Surefire plugin) and Eclipse.
When my tests are run by Maven its reports are put on target/surefire-reports as expected, but the same tests when run by Eclipse TestNG plugin I'd like them to be put inside a target subfolder also (and as so be cleaned by clean Maven goal and ignored by git, not saying about respecting Maven folder organization), but always go to the default ${basedir}/test-output.
There is a way I can do it? I'd prefer one that I do not need to manually config Eclipse settings (Couldn't TestNG in detect it's a Maven project and so change its output folder consistently?), but if there is no such way, anyone surely will help.
TIA and regards,
Heleno
TestNG supports default report generation when a user runs testng. xml, either from an IDE or the command line. By default, all reports are generated at the Project -> test-output folder. If the test-output folder is not present, then TestNG creates it at runtime and saves all the files related to the result.
Running TestNG and JUnit Tests1 and higher provides support to run TestNG and JUnit 4. x in current Maven project. All you need is to introduce TestNG and JUnit dependency in POM.
Run a test suite To be able to run a TestNG test suite, create a run configuration for this suite: From the main menu, select Run | Edit Configurations. and from the list that opens, select TestNG.
There is a no way that testng plugin can automatically figure out.
You can set your testng preferences at the workspace or project level. If you set it at the workbench level then for all projects, by default, testng would put the results there.
Go to Window->Prefs->TestNG.
Change Output directory to be same as maven output directory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With