Maven run tests from commandline - CheatSheet

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

No comments:

Post a Comment