Sunday 14 September 2014

Run JUnit/TestNG test suite using MAVEN : 

Maven is a build automation, project management and comprehension tool. Both JUnit and TestNg test cases can be executed using Maven. Surefire report plugin generates html report of executed test cases..

Here is how.....

Execute JUnit test Suite: Create some JUnit test cases as i have designed three test case named TC01.java, TC02.java and TC03.java. Add a JUnit test suite, which will call these test case in batch.


Download sample POM.xml for JUnit test cases execution. Execute test with "mvn test" and enjoy..  :)

==================================================================


Execute TestNG test Suite: Create some TestNG test cases and make suite in TestNG.xml to run all test in batch.


Download sample POM.xml for TestNG test cases execution. Execute test with "mvn test" and enjoy..  :)

==================================================================

Generate surefire reports: Now, its time to generate reports. Execute following command after "mvn test"
mvn site  

Refresh project and navigate to "Site" and open "surefire-report.html", here is a snippet of report...



No comments:

Post a Comment