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


Python Settings.launch方法代码示例

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


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

示例1: test_main

# 需要导入模块: from OWDTestToolkit.apps.settings import Settings [as 别名]
# 或者: from OWDTestToolkit.apps.settings.Settings import launch [as 别名]
class test_main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.settings = Settings(self)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.settings.launch()
        self.settings.wifi()
        self.settings.wifi_switch_on()

        available_networks = self.UTILS.element.getElements(
            DOM.Settings.wifi_available_networks, "Available networks", False)
        self.UTILS.reporting.logResult("info", "Found {} networks".format(len(available_networks)))

        for network in available_networks:
            network_name = network.find_element(*("css selector", "span")).text
            try:
                network.find_element(*("css selector", "aside.secured"))
                network.find_element(*("css selector", "small[data-l10n-id='securedBy']"))
                self.UTILS.reporting.logResult('info', "Network [{}] is secured".format(network_name))
            except:
                self.UTILS.reporting.logResult('info', "Network [{}] is NOT secured".format(network_name))
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:30,代码来源:test_26544.py

示例2: test_main

# 需要导入模块: from OWDTestToolkit.apps.settings import Settings [as 别名]
# 或者: from OWDTestToolkit.apps.settings.Settings import launch [as 别名]
class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.settings = Settings(self)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.settings.launch()

        self.UTILS.test.test(self.UTILS.network.is_network_type_enabled("airplane") == False,
                             "Airplane mode is disabled by default.")

        self.UTILS.reporting.logResult("info", "Turning airplane mode on ...")
        self.UTILS.test.test(True, "Getting airplane mode switch")
        x = self.UTILS.element.getElement(DOM.Settings.airplane_mode_switch, "Airplane mode switch")
        self.UTILS.test.test(True, "Airplane mode switch: {}".format(x))
        time.sleep(5)
        x.tap()

        self.UTILS.network.wait_for_network_item_enabled("airplane")

        self.UTILS.test.test(self.UTILS.network.is_network_type_enabled("airplane") == True,
                             "Airplane mode is now enabled.")
        self.UTILS.test.test(self.data_layer.get_setting('ril.radio.disabled') == True,
                             "Radio functionality is now disabled.")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:34,代码来源:test_26511.py

示例3: test_main

# 需要导入模块: from OWDTestToolkit.apps.settings import Settings [as 别名]
# 或者: from OWDTestToolkit.apps.settings.Settings import launch [as 别名]
class test_main(GaiaTestCase):

    def __init__(self, *args, **kwargs):
        kwargs['restart'] = True
        super(test_main, self).__init__(*args, **kwargs)
        
    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.settings = Settings(self)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.UTILS.network.disableAllNetworkSettings()

        self.UTILS.test.test(self.UTILS.network.is_network_type_enabled("data") == False, "Data conn is disabled.")

        self.settings.launch()
        time.sleep(1)
        self.settings.cellular_and_data()

        data_switch = self.UTILS.element.getElement(DOM.Settings.celldata_DataConn_switch, "Data connection switch")
        data_switch.tap()

        # Wait for confirmation screen
        self.settings.confirm_data_conn()

        self.UTILS.network.wait_for_network_item_enabled("data")

        self.UTILS.test.test(self.UTILS.network.is_network_type_enabled("data") == True, "Data conn is now enabled.")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:37,代码来源:test_26513.py

示例4: test_main

# 需要导入模块: from OWDTestToolkit.apps.settings import Settings [as 别名]
# 或者: from OWDTestToolkit.apps.settings.Settings import launch [as 别名]
class test_main(GaiaTestCase):

    def setUp(self):

        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)

        self.settings = Settings(self)
        self.download_manager = DownloadManager(self)
        _ = setup_translations(self)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.UTILS.statusbar.clearAllStatusBarNotifs()

        self.settings.launch()
        self.settings.downloads()
        self.download_manager.clean_downloads_list()

        # Verify no downloads are present
        no_downloads = self.UTILS.element.getElement(
            DOM.DownloadManager.download_empty_list_content, "Getting empty list content")
        self.UTILS.test.test(no_downloads.text == _("No downloads"),
                             "Verifying '{}' message is displayed".format(_("No downloads")))
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:29,代码来源:test_33931.py

示例5: test_main

# 需要导入模块: from OWDTestToolkit.apps.settings import Settings [as 别名]
# 或者: from OWDTestToolkit.apps.settings.Settings import launch [as 别名]
class test_main(GaiaTestCase):

    def __init__(self, *args, **kwargs):
        kwargs['restart'] = True
        super(test_main, self).__init__(*args, **kwargs)

    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.settings = Settings(self)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        # Open the Settings application.
        self.settings.launch()

        # Tap hotspot.
        self.settings.hotspot()

        hotspot_settings = self.UTILS.element.getElement(DOM.Settings.hotspot_settings, "Hotspot settings")
        self.UTILS.test.test(hotspot_settings.is_enabled(),
                        "Hotspot settings are enabled by default (<b>meaning that 'hotspot' is off</b>).")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:29,代码来源:test_26535.py

示例6: test_main

# 需要导入模块: from OWDTestToolkit.apps.settings import Settings [as 别名]
# 或者: from OWDTestToolkit.apps.settings.Settings import launch [as 别名]
class test_main(GaiaTestCase):

    def setUp(self):

        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)

        self.browser = Browser(self)
        self.settings = Settings(self)
        self.download_manager = DownloadManager(self)
        self.video = Video(self)
        self.test_url = self.UTILS.general.get_config_variable("download_url", "common")
        self.file_name = "clipcanvas_14348_H264_320x180.mp4"
        self.data_url = "{}/{}".format(self.test_url, self.file_name)

        self.connect_to_network()
        self.settings.launch()
        self.settings.downloads()
        self.download_manager.clean_downloads_list()

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.UTILS.statusbar.clearAllStatusBarNotifs()
    
        self.browser.launch()
        self.browser.open_url(self.test_url)
        self.download_manager.download_file(self.file_name)
        self.UTILS.statusbar.wait_for_notification_toaster_title("Download complete", timeout=120)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:33,代码来源:test_33941.py

示例7: main

# 需要导入模块: from OWDTestToolkit.apps.settings import Settings [as 别名]
# 或者: from OWDTestToolkit.apps.settings.Settings import launch [as 别名]
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.connect_to_network()

        self.loop.initial_test_checks()

        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
        self.apps.kill_all()
        time.sleep(2)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.phone_login()
            self.loop.allow_permission_phone_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:32,代码来源:test_36669.py

示例8: test_main

# 需要导入模块: from OWDTestToolkit.apps.settings import Settings [as 别名]
# 或者: from OWDTestToolkit.apps.settings.Settings import launch [as 别名]
class test_main(GaiaTestCase):

    def __init__(self, *args, **kwargs):
        kwargs['restart'] = True
        super(test_main, self).__init__(*args, **kwargs)

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.settings = Settings(self)

        self.wifi_name = self.UTILS.general.get_config_variable("ssid", "wifi")
        self.wifi_pass = self.UTILS.general.get_config_variable("password", "wifi")

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.settings.launch()
        time.sleep(1)
        self.settings.wifi()
        self.settings.connect_to_wifi(self.wifi_name, self.wifi_pass)

        self.UTILS.test.test(self.UTILS.network.is_network_type_enabled("wifi") == True, "Wifi mode is now enabled.")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:29,代码来源:test_26512.py

示例9: test_main

# 需要导入模块: from OWDTestToolkit.apps.settings import Settings [as 别名]
# 或者: from OWDTestToolkit.apps.settings.Settings import launch [as 别名]
class test_main(GaiaTestCase):

    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.Browser = Browser(self)

        self.wifi_name = self.UTILS.general.get_config_variable("ssid", "wifi")
        self.wifi_pass = self.UTILS.general.get_config_variable("password", "wifi")

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.settings.launch()
        self.settings.wifi()
        self.settings.connect_to_wifi(self.wifi_name, self.wifi_pass)
        network = {'ssid': self.wifi_name}
        self.wait_for_condition(lambda m: self.data_layer.is_wifi_connected(network), timeout=30)

        self.UTILS.iframe.switchToFrame(*DOM.Settings.frame_locator)
        self.settings.wifi_list_tap_name(self.wifi_name)
        self.settings.wifi_forget()

        self.wait_for_condition(lambda m: not self.data_layer.is_wifi_connected(network), timeout=30)

        # make sure we need to add the details again.
        self.UTILS.iframe.switchToFrame(*DOM.Settings.frame_locator)
        self.settings.wifi_list_tap_name(self.wifi_name)
        time.sleep(1)
        self.UTILS.element.waitForElements(DOM.Settings.wifi_login_pass, "Password field")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:36,代码来源:test_26561.py

示例10: test_main

# 需要导入模块: from OWDTestToolkit.apps.settings import Settings [as 别名]
# 或者: from OWDTestToolkit.apps.settings.Settings import launch [as 别名]
class test_main(GaiaTestCase):

    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.browser = Browser(self)

        self.wifi_name = self.UTILS.general.get_config_variable("ssid", "wifi")
        self.wifi_pass = self.UTILS.general.get_config_variable("password", "wifi")

        self.testURL = self.UTILS.general.get_config_variable("test_url", "common")
        self.apps.set_permission_by_url(Browser.search_manifest_url, 'geolocation', 'deny')

        # switch off keyboard FTU screen
        self.data_layer.set_setting("keyboard.ftu.enabled", False)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        # Open the settings application.
        self.settings.launch()

        # Connect to the wifi.
        self.settings.wifi()
        self.settings.connect_to_wifi(self.wifi_name, self.wifi_pass)

        # Open the browser app.
        self.browser.launch()
        # Open our URL.
        self.browser.open_url(self.testURL)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:37,代码来源:test_26332.py

示例11: test_main

# 需要导入模块: from OWDTestToolkit.apps.settings import Settings [as 别名]
# 或者: from OWDTestToolkit.apps.settings.Settings import launch [as 别名]
class test_main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        _ = setup_translations(self)

        # Make sure bluetooth is not enabled before the tests starts
        self.data_layer.bluetooth_disable()
        self.wait_for_condition(lambda m: not self.data_layer.bluetooth_is_enabled,
                                timeout=20, message="Bluetooth disabled")

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.UTILS.statusbar.toggleViaStatusBar("bluetooth")
        self.marionette.switch_to_frame()
        self.UTILS.element.waitForElements(DOM.Statusbar.bluetooth, "Bluetooth icon in statusbar", True, 20, False)

        # Open settings and check bluetooth is on.
        self.settings.launch()

        bluetooth = self.UTILS.element.getElement(DOM.Settings.bluetooth, "Bluetooth")
        self.UTILS.element.scroll_into_view(bluetooth)
        time.sleep(3)

        bluetooth_description = self.UTILS.element.getElement(DOM.Settings.bluetooth_desc, "Bluetooth description")
        self.UTILS.test.test(bluetooth_description.text == _("No devices paired"), "Bluetooth is marked as turned on.")

        self.UTILS.statusbar.toggleViaStatusBar("bluetooth")
        self.marionette.switch_to_frame()
        self.UTILS.element.waitForNotElements(DOM.Statusbar.bluetooth, "Bluetooth icon in statusbar")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:37,代码来源:test_26410.py

示例12: test_main

# 需要导入模块: from OWDTestToolkit.apps.settings import Settings [as 别名]
# 或者: from OWDTestToolkit.apps.settings.Settings import launch [as 别名]
class test_main(GaiaTestCase):

    def setUp(self):

        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)

        self.settings = Settings(self)
        self.download_manager = DownloadManager(self)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.UTILS.statusbar.clearAllStatusBarNotifs()

        self.settings.launch()
        self.settings.downloads()

        edit_mode = self.UTILS.element.getElement(DOM.DownloadManager.download_edit_button,
                                                  "Download edit button", True, 10)
        self.UTILS.test.TEST(edit_mode.get_attribute("class") == "disabled", "Edit mode button is disabled")

        edit_mode.tap()
        self.UTILS.element.waitForNotElements(DOM.DownloadManager.downloads_edit_header_title,
                                           "Edit downloads header")
开发者ID:owdqa,项目名称:OWD_TEST_TOOLKIT,代码行数:29,代码来源:test_88888.py

示例13: test_main

# 需要导入模块: from OWDTestToolkit.apps.settings import Settings [as 别名]
# 或者: from OWDTestToolkit.apps.settings.Settings import launch [as 别名]
class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.gallery = Gallery(self)
        self.settings = Settings(self)

        self.test_msg = "Hello World"

        # Establish which phone number to use.
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.UTILS.reporting.logComment("Sending mms to telephone number " + self.phone_number)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        # Configure Auto Retrieve as "on_with_r = On with roaming option" from messaging settings
        self.settings.launch()
        self.settings.configure_mms_auto_retrieve("on_with_r")

        self.messages.create_and_send_mms("image", [self.phone_number], self.test_msg)
        self.messages.wait_for_message()

        # Verify that the MMS has been received.
        self.messages.verify_mms_received("img", self.phone_number)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:34,代码来源:test_29899.py

示例14: test_main

# 需要导入模块: from OWDTestToolkit.apps.settings import Settings [as 别名]
# 或者: from OWDTestToolkit.apps.settings.Settings import launch [as 别名]
class test_main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.browser = Browser(self)
        self.settings = Settings(self)

        self.wifi_name = self.UTILS.general.get_config_variable("ssid", "wifi")
        self.wifi_pass = self.UTILS.general.get_config_variable("password", "wifi")
        self.data_layer.connect_to_wifi()
        self.data_layer.is_wifi_connected()

        self.apps.kill_all()
        self.url = "https://acperez.github.io/gecko-sw-test/"
        self.sw_scope = "https://acperez.github.io/gecko-sw-test/"
        self.sw_header = "https://acperez.github.io!appId=22&inBrowser=1"
        self.script_spec = "https://acperez.github.io/gecko-sw-test/service-worker.js"

    def tearDown(self):
        self.data_layer.disable_wifi()
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.browser.launch()
        self.browser.open_url(self.url)

        register_btn = self.UTILS.element.getElement(dom.acperez_register_btn_dom, "Register Worker button")
        register_btn.tap()

        self.settings.launch()
        time.sleep(2)
        self.settings.developer_settings()
        time.sleep(2)
        self.settings.service_workers_menu()

        div_dom = (DOM.Settings.service_worker_div[0], DOM.Settings.service_worker_div[1].format(self.sw_scope))
        div_elem = self.UTILS.element.getElement(div_dom, "Service worker div")
        self.UTILS.element.scroll_into_view(div_elem)

        header = div_elem.find_element(*DOM.Settings.service_worker_header)
        self.UTILS.test.test(header.text == self.sw_header, "Header found [{}] Expected [{}]".
                             format(header.text, self.sw_header))

        scope = div_elem.find_element(*DOM.Settings.service_worker_scope)
        self.UTILS.test.test(self.sw_scope == scope.text, "Scope found [{}] Expected [{}]".
                             format(scope.text, self.sw_scope))

        script_spec = div_elem.find_element(*DOM.Settings.service_worker_script_spec)
        self.UTILS.test.test(self.script_spec == script_spec.text, "Script spec found [{}] Expected [{}]".
                             format(script_spec.text, self.script_spec))

        worker_url = div_elem.find_element(*DOM.Settings.service_worker_current_url)
        self.UTILS.test.test(self.script_spec == worker_url.text, "URL found [{}] Expected [{}]".
                             format(worker_url.text, self.script_spec))

        unregister_btn = div_elem.find_element(*DOM.Settings.service_worker_unregister_btn)
        unregister_btn.tap()
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:61,代码来源:test_basic_acperez.py

示例15: main

# 需要导入模块: from OWDTestToolkit.apps.settings import Settings [as 别名]
# 或者: from OWDTestToolkit.apps.settings.Settings import launch [as 别名]
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.scenario = "scenarios/urls/single/revoked/idb"
        self.aux_files_dir = self.UTILS.general.get_config_variable("aux_files", "loop")
        self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")
        self.connect_to_network()

        # Insert our test contacts
        number_of_contacts = 3
        contact_given = "Test"
        contact_family = map(str, range(1, number_of_contacts + 1))
        contact_name = ["{} {}".format(contact_given, contact_family[i])
                        for i in range(number_of_contacts)]
        contact_numbers = ["666666666666", "777777777777", "888888888888"]

        test_contacts = [MockContact(name=contact_name[i], givenName=contact_given,
                                     familyName=contact_family[i],
                                     tel={'type': 'Mobile', 'value': contact_numbers[i]})
                         for i in range(number_of_contacts)]
        map(self.UTILS.general.insertContact, test_contacts)

        self.loop.initial_test_checks()

        # Make sure we're not logged in FxA
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.loop.launch()
        # This needs to be done at this point, bcs if the app is freshly installed the persistence
        # directories are not in its place until the app is launched for the first time
        self.loop.update_db("{}/{}".format(self.aux_files_dir, self.scenario))
        result = self.loop.wizard_or_login()

        if result:
            self.loop.firefox_login(self.fxa_user, self.fxa_pass)
            self.loop.allow_permission_ffox_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")

        self.loop.switch_to_urls()
        self.loop.open_settings()
        self.loop.delete_just_revoked(cancel=False)

        self.UTILS.element.waitForElements(DOM.Loop.call_log, "Check we are returned to the call log")
        current = self.loop.get_number_of_revoked_urls()
        self.UTILS.test.test(current == 0, "Check that after deleting the URL, we have one less")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:60,代码来源:test_35870.py


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