I want to write testcases for my android application using JUnit. And I faced some problems.
Is it possible to check that activity displays some dialog at current moment? Here is a small piece of my test application:
...
Instrumentation instr = getInstrumentation();
monitor = instr.addMonitor(MainActivity.class.getName(), null, false);
/* Click on login button */
TouchUtils.clickView(this, mLoginButton);
/* wait MainActivity */
mMainActivity = instr.waitForMonitorWithTimeout(monitor, 3);
assertNotNull(mMainActivity);
/* Here a want to check that progress dialog displayed on mMainActivity */
Thanks in advance!