I am trying to use espresso and junit4. The problem is that I have code that is statically initialized in activity.on Creating and de-initializing in activity.onDestroy
Now, when I run espresso, the tests seem to work in "parallel." I added a log class to the onCreate and onDestroy actions.
What i see
onCreate = example.package.MainActivity@ABC onCreate = example.package.MainActivity@JKL onDestroy = example.package.MainActivity@ABC onCreate = example.package.MainActivity@XYZ onDestroy = example.package.MainActivity@JKL onDestroy = example.package.MainActivity@XYZ
, and of course, it fails in NPE in the third test, because the second onDestroy test ran after the third onCreate (which removed the static code)
Is this normal behavior? Can I force an espresso to start an activity instance and then start a new one? Thanks!
android junit4 android-testing android-espresso
urSus
source share