Android Espresso-Web浏览器 [英] Android Espresso - Web browser

查看:60
本文介绍了Android Espresso-Web浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题

我想测试单击按钮后是否使用espresso启动了网络浏览器. 问题是:是否有可能测试这种东西? 如果是这样,我该怎么办?

I want to test whether after button click the web browser is beign launched using espresso. And the question is: is it even possible to test such thing? If so any ideas how would I do that?

推荐答案

实际上不是. Espresso将允许您单击按钮,并且启动浏览器后,测试将结束.您还可以选择让类激发浏览器的Intent,以便您可以测试剩余的流(如果有).

Actually no. Espresso will allow you to click in the button and once the browser is fired up, the test will end. The alternative you have is having your class that fires the browser Intent mocked, so that you can test the remaining flow (if any).

看看这个答案:控制何时自动化测试结束-浓咖啡(Espresso),我在其中描述了如何实现这一目标.

HAve a look in this answer: Controlling when an automation test ends - Espresso, where I describe how you could achieve that.

这篇关于Android Espresso-Web浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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