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


Python app.CostControl类代码示例

本文整理汇总了Python中gaiatest.apps.cost_control.app.CostControl的典型用法代码示例。如果您正苦于以下问题:Python CostControl类的具体用法?Python CostControl怎么用?Python CostControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: test_cost_control_ftu

    def test_cost_control_ftu(self):

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

        ftu_step1 = cost_control.ftu_step1
        ftu_step2 = ftu_step1.tap_next()

        ftu_step2.select_reset_report_value('Weekly')
        ftu_step3 = ftu_step2.tap_next()

        ftu_step3.toggle_data_alert_switch(True)
        ftu_step3.select_when_use_is_above_unit_and_value('MB', '0.1')
        ftu_step3.tap_lets_go()

        self.assertTrue(cost_control.is_mobile_data_tracking_on)
开发者ID:malini,项目名称:gaia-ui-tests-1,代码行数:16,代码来源:test_cost_control_ftu.py

示例2: test_cost_control_ftu

    def test_cost_control_ftu(self):

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

        # This will switch to ftu iframe
        cost_control.switch_to_ftu()

        ftu_step1 = cost_control.ftu_step1
        ftu_step2 = ftu_step1.tap_next()

        ftu_step2.select_reset_report_value('Weekly')
        ftu_step3 = ftu_step2.tap_next()

        ftu_step3.toggle_data_alert_switch(True)
        ftu_step3.select_when_use_is_above_unit_and_value(u'MB', '0.1')
        ftu_step3.tap_lets_go()

        self.marionette.switch_to_frame(self.apps.displayed_app.frame)
        self.assertTrue(cost_control.is_mobile_data_tracking_on)
开发者ID:AaronMT,项目名称:gaia-ui-tests,代码行数:20,代码来源:test_cost_control_ftu.py

示例3: test_cost_control_ftu

    def test_cost_control_ftu(self):

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

        # This will switch to ftu iframe
        cost_control.switch_to_ftu()

        from gaiatest.apps.cost_control.regions.ftu_step1 import FTUStep1
        ftu_step1 = FTUStep1(self.marionette)
        ftu_step2 = ftu_step1.tap_next()

        ftu_step2.select_reset_report_value('Weekly')
        ftu_step3 = ftu_step2.tap_next()

        ftu_step3.enable_data_alert_toggle()
        ftu_step3.select_when_use_is_above_unit_and_value(u'MB', '0.1')
        ftu_step3.tap_lets_go()

        self.apps.switch_to_displayed_app()
        self.wait_for_condition(
            lambda m: cost_control.is_mobile_data_tracking_on)
开发者ID:4gh,项目名称:gaia,代码行数:22,代码来源:test_cost_control_ftu.py

示例4: test_cost_control_data_alert_mobile

    def test_cost_control_data_alert_mobile(self):
        """https://moztrap.mozilla.org/manage/case/8938/"""

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

        cost_control.switch_to_ftu()
        cost_control.run_ftu_accepting_defaults()

        self.assertTrue(cost_control.is_mobile_data_tracking_on)
        self.assertFalse(cost_control.is_wifi_data_tracking_on)

        settings = cost_control.tap_settings()
        self.assertFalse(settings.is_data_alert_switch_checked)
        settings.toggle_data_alert_switch()
        self.assertTrue(settings.is_data_alert_switch_checked)
        settings.reset_mobile_usage()
        settings.select_when_use_is_above_unit_and_value(u'MB', '0.1')
        settings.tap_done()
        self.assertTrue(cost_control.is_mobile_data_tracking_on)

        # open browser to get some data downloaded
        search = Search(self.marionette)
        search.launch(launch_timeout=30000)
        browser = search.go_to_url('http://mozqa.com/qa-testcase-data/Images/sample_png_02.png')
        browser.wait_for_page_to_load(180)

        browser.switch_to_content()
        Wait(self.marionette, timeout=60).until(lambda m: "sample_png_02.png" in m.title)
        browser.switch_to_chrome()

        system = System(self.marionette)
        utility_tray = system.open_utility_tray()
        utility_tray.wait_for_notification_container_displayed()

        # switch to cost control widget
        usage_iframe = self.marionette.find_element(*self._cost_control_widget_locator)
        self.marionette.switch_to_frame(usage_iframe)

        # make sure the color changed
        # The timeout is increased, because for some reason, it takes some time
        # before the limit view is shown (the browser has to finish loading?)
        usage_view = self.marionette.find_element(*self._data_usage_view_locator)
        Wait(self.marionette, timeout=40).until(lambda m: 'reached-limit' in usage_view.get_attribute('class'),
             message='Data usage bar did not breach limit')
        usage_view.tap()

        self.wait_for_condition(lambda m: self.apps.displayed_app.name == cost_control.name)
开发者ID:WilliamMolina,项目名称:gaia,代码行数:48,代码来源:test_cost_control_data_alert_mobile.py

示例5: test_cost_control_data_alert_mobile

    def test_cost_control_data_alert_mobile(self):
        """https://moztrap.mozilla.org/manage/case/8938/"""

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

        cost_control.switch_to_ftu()
        cost_control.run_ftu_accepting_defaults()

        self.assertTrue(cost_control.is_mobile_data_tracking_on)
        self.assertFalse(cost_control.is_wifi_data_tracking_on)

        settings = cost_control.tap_settings()
        settings.enable_data_alert_switch()
        settings.reset_mobile_usage()
        settings.select_when_use_is_above_unit_and_value(u'MB', '0.1')
        settings.tap_done()
        self.assertTrue(cost_control.is_mobile_data_tracking_on)

        # open browser to get some data downloaded
        search = Search(self.marionette)
        search.launch(launch_timeout=30000)
        search.go_to_url('http://mozqa.com/qa-testcase-data/Images/sample_png_02.png')

        system = System(self.marionette)
        # We could have waited on the page to be loaded, but the toaster can appear before
        # the end of the load. That's why the timeout is expanded, the webpage loaded just above
        # might take longer.
        system.wait_for_notification_toaster_displayed(timeout=180)
        system.wait_for_notification_toaster_not_displayed()
        utility_tray = system.open_utility_tray()
        utility_tray.wait_for_notification_container_displayed()

        cost_control_widget = utility_tray.cost_control_widget
        cost_control_widget.wait_for_limit_to_be_reached()
        cost_control_widget.tap()
        cost_control.wait_to_be_displayed()
开发者ID:ruvsmirnov,项目名称:gaia,代码行数:37,代码来源:test_cost_control_data_alert_mobile.py

示例6: test_cost_control_data_alert_mobile

    def test_cost_control_data_alert_mobile(self):
        """https://moztrap.mozilla.org/manage/case/8938/"""

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

        cost_control.switch_to_ftu()
        cost_control.run_ftu_accepting_defaults()

        self.assertTrue(cost_control.is_mobile_data_tracking_on)
        self.assertFalse(cost_control.is_wifi_data_tracking_on)

        settings = cost_control.tap_settings()
        settings.toggle_data_alert_switch(True)
        settings.select_when_use_is_above_unit_and_value(u'MB', '0.1')
        settings.reset_mobile_usage()
        settings.tap_done()
        self.assertTrue(cost_control.is_mobile_data_tracking_on)

        # open browser to get some data downloaded
        browser = Browser(self.marionette)
        browser.launch()
        browser.go_to_url('http://developer.mozilla.org/', timeout=120)
        browser.switch_to_content()
        self.wait_for_element_present(*self._page_body_locator, timeout=120)
        browser.switch_to_chrome()

        # get the notification bar
        self.marionette.switch_to_frame()
        self.marionette.execute_script("window.wrappedJSObject.UtilityTray.show()")

        # switch to cost control widget
        usage_iframe = self.marionette.find_element(*self._cost_control_widget_locator)
        self.marionette.switch_to_frame(usage_iframe)

        # make sure the color changed
        self.wait_for_condition(
            lambda m: 'reached-limit' in self.marionette.find_element(
                *self._data_usage_view_locator).get_attribute('class'),
            message='Data usage bar did not breach limit')
开发者ID:HondaDai,项目名称:gaia,代码行数:41,代码来源:test_cost_control_data_alert_mobile.py

示例7: __init__

 def __init__(self, marionette):
     CostControl.__init__(self, marionette)
     view = self.marionette.find_element(*self._view_locator)
     self.wait_for_condition(lambda m: view.location['x'] == 0)
开发者ID:Bharatpattani,项目名称:gaia,代码行数:4,代码来源:ftu_step2.py

示例8: __init__

 def __init__(self, marionette):
     CostControl.__init__(self, marionette)
     header = self.marionette.find_element(*self._data_alert_header_locator)
     self.wait_for_condition(lambda m: header.location['x'] == 0)
开发者ID:AaronMT,项目名称:gaia-ui-tests,代码行数:4,代码来源:ftu_step3.py

示例9: test_cost_control_reset_wifi

    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
        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)

        # disable wifi and kill the browser before reset data, wait for wifi to be closed, and switch back to the app
        self.apps.kill(browser.app)
        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:BobJameson,项目名称:gaia,代码行数:38,代码来源:test_cost_control_reset_wifi.py

示例10: __init__

 def __init__(self, marionette):
     CostControl.__init__(self, marionette)
     view = self.marionette.find_element(*self._view_locator)
     Wait(self.marionette).until(lambda m: view.location['x'] == 0)
开发者ID:WuChengLin,项目名称:gaia-1,代码行数:4,代码来源:ftu_step3.py

示例11: test_cost_control_reset_wifi

    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,代码行数:39,代码来源:test_cost_control_reset_wifi.py

示例12: __init__

 def __init__(self, marionette):
     CostControl.__init__(self, marionette)
     self.wait_for_element_displayed(*self._data_report_title_locator)
开发者ID:pcheng13,项目名称:gaia-ui-tests,代码行数:3,代码来源:ftu_step2.py

示例13: __init__

 def __init__(self, marionette):
     CostControl.__init__(self, marionette)
     menu = self.marionette.find_element(*self._reset_report_menu_locator)
     self.wait_for_condition(lambda m: menu.location['x'] == 0)
开发者ID:AaronMT,项目名称:gaia-ui-tests,代码行数:4,代码来源:ftu_step2.py

示例14: __init__

 def __init__(self, marionette):
     CostControl.__init__(self, marionette)
     self.wait_for_element_displayed(*self._data_report_title_locator)
     # Wait for the <script defer> to complete
     time.sleep(1)
开发者ID:rwood-moz,项目名称:gaia-ui-tests,代码行数:5,代码来源:ftu_step2.py


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