使用Calabash打开和关闭飞行模式的最佳方法 [英] Best way to turn airplane mode on and off with Calabash

查看:113
本文介绍了使用Calabash打开和关闭飞行模式的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用calabash-android打开和关闭飞行模式的最佳方法是什么?

What is the best way to turn airplane mode on and off using calabash-android?

我可以使用 perform_action('set_preferences', ....) ??

上面的set_preferences有什么作用?我想在应用程序测试期间设置android设置。

What does set_preferences do above? I would like to set up android settings during test of application.

谢谢

推荐答案

您的问题有点含糊。是用于模拟器还是设备?

Your question is a bit vague. Is it for simulator or device?

如果只需要禁用wifi,则可以使用

In case you just need to disable wifi, you could use

def disable_network
%x(adb shell svc wifi disable)
end


def enable_network
%x(adb shell svc wifi enable)
end

在此处找到 https://azevedorafaela.wordpress.com/tag/disable-wifi-android-simulator-calabash/
不过我自己还没有尝试过。

Found here https://azevedorafaela.wordpress.com/tag/disable-wifi-android-simulator-calabash/ I have not tried it myself though.

这篇关于使用Calabash打开和关闭飞行模式的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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