当前位置: 首页>>代码示例>>Python>>正文


Python System.wait_for_airplane_mode_icon_displayed方法代码示例

本文整理汇总了Python中gaiatest.apps.system.app.System.wait_for_airplane_mode_icon_displayed方法的典型用法代码示例。如果您正苦于以下问题:Python System.wait_for_airplane_mode_icon_displayed方法的具体用法?Python System.wait_for_airplane_mode_icon_displayed怎么用?Python System.wait_for_airplane_mode_icon_displayed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gaiatest.apps.system.app.System的用法示例。


在下文中一共展示了System.wait_for_airplane_mode_icon_displayed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_toggle_airplane_mode

# 需要导入模块: from gaiatest.apps.system.app import System [as 别名]
# 或者: from gaiatest.apps.system.app.System import wait_for_airplane_mode_icon_displayed [as 别名]
    def test_toggle_airplane_mode(self):

        settings = Settings(self.marionette)
        settings.launch()

        settings.wait_for_airplane_toggle_ready()

        # Switch on Airplane mode
        settings.toggle_airplane_mode()

        # wait for wifi to be disabled, this takes the longest when airplane mode is switched on
        self.wait_for_condition(lambda s: 'Disabled' in settings.wifi_menu_item_description)

        # wait for airplane mode icon is diaplayed on status bar
        self.marionette.switch_to_default_content()
        system_app = System(self.marionette)
        system_app.wait_for_airplane_mode_icon_displayed()

        # check Wifi is disabled
        self.assertFalse(self.data_layer.is_wifi_connected(self.testvars['wifi']), "WiFi was still connected after switching on Airplane mode")

        # check that Cell Data is disabled
        self.assertFalse(self.data_layer.get_setting('ril.data.enabled'), "Cell Data was still connected after switching on Airplane mode")

        # check GPS is disabled
        self.assertFalse(self.data_layer.get_setting('geolocation.enabled'), "GPS was still connected after switching on Airplane mode")

        # switch back to app frame
        self.apps.switch_to_displayed_app()

        # Switch off Airplane mode
        settings.wait_for_airplane_toggle_ready()
        settings.toggle_airplane_mode()

        # Wait for wifi to be connected, because this takes the longest to connect after airplane mode is switched off
        self.wait_for_condition(lambda s: 'Connected to ' + self.testvars['wifi']['ssid'] in settings.wifi_menu_item_description, timeout=40)

        # check Wifi is enabled
        self.assertTrue(self.data_layer.is_wifi_connected(self.testvars['wifi']), "WiFi was not connected after switching off Airplane mode")

        # check that Cell Data is enabled
        self.assertTrue(self.data_layer.get_setting('ril.data.enabled'), "Cell data was not connected after switching off Airplane mode")

        # check GPS is enabled
        self.assertTrue(self.data_layer.get_setting('geolocation.enabled'), "GPS was not enabled after switching off Airplane mode")
开发者ID:4gh,项目名称:gaia,代码行数:47,代码来源:test_settings_airplane_mode.py


注:本文中的gaiatest.apps.system.app.System.wait_for_airplane_mode_icon_displayed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。