4
我想使用JUnit为我的android应用程序编写测试用例。 我遇到了一些问题。如何在Android单元测试期间检查该活动显示对话框
是否可以在当前时刻检查活动是否显示一些对话框? 这里是我的测试应用程序的一小块:
...
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 */
在此先感谢!
乔纳斯工作,谢谢维护!我尝试使用你的框架,它很快!但不幸的是,我们的公司政策禁止在我们的测试中使用任何第三方组件: – Evgeny 2010-09-24 07:42:35
检查Robotium的代码,它是开源的。也许你可以找到可以帮助你的东西。 – 2010-09-24 12:28:13
乔纳斯,是否有可能检查一些吐司出现在使用robotium的当前活动中? – Evgeny 2010-09-24 13:14:37