Short question for those folks out there.
If I am starting from scratch, how exactly do I add TestNG unit tests to my existing Android project along with running them?
I’m also using IntelliJ (I know not Maven Android) to run the tests.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use testNG to run any kind of test cases you want.
You can just create a test package, and then a test class to start writing your tests.
Suppose that your class is called AndroidTests.java, you need to import testng and start writting your tests, just like this:
Then, when you have enough test cases, you need to create your suite:
And finally run this suite from eclipse or using command line.
Please refer to more info in testNG doc:
http://testng.org/doc/documentation-main.html
And also take a look to Android test documentation:
http://developer.android.com/tools/testing/testing_android.html