I am just starting with Espresso to write UI automation tests. I am able to setup the environment and run tests using ADB command.
adb shell am instrument -w -e class codepath.apps.demointroandroid.EspressoDemo#ValidateApplicationIsLaunched codepath.apps.demointroandroid.test/android.support.test.runner.AndroidJUnitRunner
codepath.apps.demointroandroid.EspressoDemo is the class name containing the tests. ValidateApplicationIsLaunched is the Espresso test case ran using ADB.
Now my question is how to pass any argument to Espresso test case from the command line?
Consider the following use case.
- Design a test case for creating a user account.
- Now I want to run this test case with different parameters e.g. Name, Age etc. which I want to control via command line.