Robotium:我如何等待装载到出发前完成? [英] Robotium: How do I wait for loading to complete before proceeding?

查看:135
本文介绍了Robotium:我如何等待装载到出发前完成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想写一个Robotium / JUnit测试Android应用程序。在某些步骤,我想我的测试等到纺纱加载符号消失在屏幕上。

I want to write a Robotium/Junit test for an android app. At certain steps, I want my test to wait until the spinning loading symbol disappears off the screen.

我怎么能这样做?

推荐答案

有不同的方式,你可以做到这一点。在Robotium有很多,你可以使用不同的WAITFOR方法。你的情况,你可以使用:

There are different ways in which you can do that. In Robotium there are a lot of different waitFor methods that you can use. In your case you can use:

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文档了解更多WAITFOR方法Robotium。

Please see the Robotium API Documentation for more waitFor methods in Robotium.

这篇关于Robotium:我如何等待装载到出发前完成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆