Maven run tests from commandline - CheatSheet





PurposeCommand
Run all tests mvn test
Run using testng verifymvn verify
Run the allure reports mvn site
Run a single maven test within a class mvn -Dtest=TestObjects#ostiariusAddUserWithCancel test
where "TestObjects" is the test class name and "ostiariusAddUserWithCancel" is the test method.
Run all tests within a groupmvn test -Dgroups=slow test
Run all tests within a classmvn -Dtest=com.amedia.qa.automation.testcases.testgoogle.TestGoogle test
mvn clean test -Dtest=xxxxTest
Only runs all the test classes ending in PerformanceTest.mvn -Dtest=*PerformanceTest clean test
To run test suite xml filemvn test -DsuiteXmlFile=src/test/resources/testsuite/test.xml

Further Reading: http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html

Comments

  1. Thanks for providing the information . The articles in your blog helped me a lot for improving the knowledge on the subject. Also check my small collection on this at selenium Online Training blog

    ReplyDelete

Post a Comment

Popular posts from this blog

Trim / Remove spaces in Xpath?

Complete list of Serenity properties

XPATH for IE / internet explorer