當前位置: 首頁>>代碼示例>>Python>>正文


Python CostControl.toggle_mobile_data_tracking方法代碼示例

本文整理匯總了Python中gaiatest.apps.cost_control.app.CostControl.toggle_mobile_data_tracking方法的典型用法代碼示例。如果您正苦於以下問題:Python CostControl.toggle_mobile_data_tracking方法的具體用法?Python CostControl.toggle_mobile_data_tracking怎麽用?Python CostControl.toggle_mobile_data_tracking使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gaiatest.apps.cost_control.app.CostControl的用法示例。


在下文中一共展示了CostControl.toggle_mobile_data_tracking方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_cost_control_reset_wifi

# 需要導入模塊: from gaiatest.apps.cost_control.app import CostControl [as 別名]
# 或者: from gaiatest.apps.cost_control.app.CostControl import toggle_mobile_data_tracking [as 別名]
    def test_cost_control_reset_wifi(self):

        self.data_layer.connect_to_wifi()

        cost_control = CostControl(self.marionette)
        cost_control.launch()

        cost_control.switch_to_ftu()
        cost_control.run_ftu_accepting_defaults()

        cost_control.toggle_mobile_data_tracking(False)
        cost_control.toggle_wifi_data_tracking(True)

        # open browser to get some data downloaded
        search = Search(self.marionette)
        search.launch()
        search.go_to_url('http://mozqa.com/data/firefox/layout/mozilla.html')

        self.data_layer.disable_wifi()
        time.sleep(5)

        # go back to Cost Control
        cost_control.launch()
        # if we can't trigger any data usage, there must be something wrong
        self.assertNotEqual(cost_control.wifi_data_usage_figure, u'0.00 B', 'No data usage shown after browsing.')

        # # go to settings section
        settings = cost_control.tap_settings()
        settings.reset_wifi_usage()
        settings.tap_done()

        # wait for usage to be refreshed
        self.wait_for_condition(
            lambda m: cost_control.wifi_data_usage_figure == u'0.00 B',
            message='Wifi usage did not reset back to 0.00 B')
開發者ID:4k1k0,項目名稱:gaia,代碼行數:37,代碼來源:test_cost_control_reset_wifi.py

示例2: test_cost_control_reset_wifi

# 需要導入模塊: from gaiatest.apps.cost_control.app import CostControl [as 別名]
# 或者: from gaiatest.apps.cost_control.app.CostControl import toggle_mobile_data_tracking [as 別名]
    def test_cost_control_reset_wifi(self):

        self.data_layer.connect_to_wifi()
        cost_control = CostControl(self.marionette)
        cost_control.launch()
        cost_control.run_ftu_accepting_defaults()

        cost_control.toggle_mobile_data_tracking(False)
        cost_control.toggle_wifi_data_tracking(True)

        # open browser to get some data downloaded
        # please remove this once there is a better way than launching browser app/obj to do so
        browser = Browser(self.marionette)
        browser.launch()
        browser.go_to_url('http://mozqa.com/data/firefox/layout/mozilla.html')
        browser.switch_to_content()
        self.wait_for_element_present(*self._page_title_locator)

        # go back to Cost Control
        cost_control.launch()
        # if we can't trigger any data usage, there must be something wrong
        self.assertNotEqual(cost_control.wifi_data_usage_figure, u'0.00 B', 'No data usage shown after browsing.')

        # disable wifi before reset data, wait for wifi to be closed, and switch back to the app
        self.data_layer.disable_wifi()
        time.sleep(1)
        cost_control.launch()

        # # go to settings section
        settings = cost_control.tap_settings()
        settings.reset_data_usage()
        settings.tap_done()

        # wait for usage to be refreshed
        self.wait_for_condition(lambda m: cost_control.wifi_data_usage_figure == u'0.00 B', message='Wifi usage did not reset back to 0.00 B')
開發者ID:malini,項目名稱:gaia-ui-tests-1,代碼行數:37,代碼來源:test_cost_control_reset_wifi.py

示例3: test_cost_control_reset_wifi

# 需要導入模塊: from gaiatest.apps.cost_control.app import CostControl [as 別名]
# 或者: from gaiatest.apps.cost_control.app.CostControl import toggle_mobile_data_tracking [as 別名]
    def test_cost_control_reset_wifi(self):

        self.data_layer.connect_to_wifi()

        cost_control = CostControl(self.marionette)
        cost_control.launch()

        cost_control.switch_to_ftu()
        cost_control.run_ftu_accepting_defaults()

        cost_control.toggle_mobile_data_tracking(False)
        cost_control.toggle_wifi_data_tracking(True)

        # If we don't kill the app manually it might get killed by the oom process.
        # In that case when we re-launch the app it has a hash attached at the end of the src. - Bug 1091676
        self.apps.kill(cost_control.app)

        # open browser to get some data downloaded
        search = Search(self.marionette)
        search.launch()
        search.go_to_url(self.marionette.absolute_url('mozilla.html'))

        self.data_layer.disable_wifi()
        time.sleep(5)

        # go back to Cost Control
        cost_control.launch()
        # if we can't trigger any data usage, there must be something wrong
        self.assertNotEqual(cost_control.wifi_data_usage_figure, u'0.00 B', 'No data usage shown after browsing.')

        # # go to settings section
        settings = cost_control.tap_settings()
        settings.reset_wifi_usage()
        settings.tap_done()

        # wait for usage to be refreshed
        self.wait_for_condition(
            lambda m: cost_control.wifi_data_usage_figure == u'0.00 B',
            message='Wifi usage did not reset back to 0.00 B')
開發者ID:AaskaShah,項目名稱:gaia,代碼行數:41,代碼來源:test_cost_control_reset_wifi.py


注:本文中的gaiatest.apps.cost_control.app.CostControl.toggle_mobile_data_tracking方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。