我想为一个Android应用写一个Robotium/Junit测试。在某些步骤中,我希望我的测试等待,直到旋转加载符号从屏幕上消失。
我该如何做呢?
您可以使用不同的方法来实现此目的。在Robotium中,有许多不同的等待方法可供使用。在您的情况下,您可以使用:
solo.waitForDialogToClose() //waits for the dialog to close
solo.waitForActivity() // if there is a activity change
solo.waitForText() //if a certain text appears after the loading is done
solo.waitForView() //if a certain view is shown after the load screen is done.
请查看Robotium API文档,了解更多Robotium的waitFor方法。
solo.waitForActivity(solo.getCurrentActivity().toString());
- user952342