How to automatically test that applications behave as expected with respect to other activities?

I have an application that launches an action right after the call ends. I would like to write an automatic test that ensures that:

  • he launches
  • if any other action appears after activating my activity (for example, another call or SMS), as soon as this new activity is completed by the user, my activity will be shown again (if the user does not press the home button or something.

I looked at the Robotium and Roboelectric frameworks, but could not find the answer, if at all feasible.

+6
source share
1 answer

I hope you can achieve this using the following methods:

  • There is a tool called the monkey runner and its open source that helps you record test cases. You can use the actual physical device to automate test cases.
  • This is a very easy way you can try. you can put journal entries in all the life cycles of your activity, I mean onCreate, onStart, onStop, onResume, onRestart, onDestroy .... this will help you find out if your activity is in the foreground or in the background or successfully launched. To do this, you need to check the log output. Hope this helps you.
+3
source

Source: https://habr.com/ru/post/915554/


All Articles