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


Python settings.Settings类代码示例

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


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

示例1: test_main

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

示例2: test_main

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

示例3: test_main

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

示例4: test_main

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

示例5: test_main

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

示例6: test_main

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

示例7: test_main

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

示例8: test_main

class test_main(GaiaTestCase):

    def setUp(self):

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

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

    def test_run(self):

        # Set the volume to be low (no need to wake up the office! ;o)
        self.settings.set_alarm_volume(0)

        # Launch clock app.
        self.clock.launch()

        # Delete all previous alarms.
        #
        self.clock.delete_all_alarms()

        # Create an alarm that is 1 minute in the future.
        # (Make sure we're not about to do this at the end of a minute or an hour.)
        #
        now_mins = time.strftime("%M", time.gmtime())
        diff_m = 60 - int(now_mins)
        if diff_m <= 1:
            time.sleep(60)

        now_secs = time.strftime("%S", time.gmtime())
        diff_s = 60 - int(now_secs)
        if diff_s <= 15:
            time.sleep(diff_s)

        t = datetime.datetime.now() + datetime.timedelta(minutes=1)

        title = "Test alarm"
        self.clock.create_alarm(t.hour, t.minute, title)
        """
        Return to the main screen (since this is where the user will
        most likely be when the alarm goes off).
        """

        self.UTILS.home.goHome()

        # Check the statusbar icon exists.
        self.UTILS.test.test(self.clock.checkStatusbarIcon(), "Alarm icon is present in statusbar.")

        # Wait for the alarm to start.
        self.clock.checkAlarmRingDetails(t.hour, t.minute, title)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:55,代码来源:_test_26348.py

示例9: setUp

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.clock = Clock(self)
        self.settings = Settings(self)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:7,代码来源:_test_26348.py

示例10: setUp

    def setUp(self):
        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")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:7,代码来源:test_26412.py

示例11: setUp

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)
        self.test_contact = MockContact()
        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()
        self.UTILS.general.insertContact(self.test_contact)
        # Clean start
        if not self.loop.is_installed():
            self.loop.install()
        else:
            self.loop.launch()
            # If already logged in, logout
            if not self.loop.wizard_or_login():
                self.loop.open_settings()
                self.loop.logout()

        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
        self.apps.kill_all()
        time.sleep(2)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:26,代码来源:test_35076.py

示例12: setUp

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

        self.test_contact = MockContact(givenName="QA", familyName="Automation")
        self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")
        _ = setup_translations(self)
        self.expected_msg = _("This contact does not have either a phone number or an email address.")

        self.contacts.launch()
        self.contacts.start_create_new_contact()
        cont_fields = self.contacts.get_contact_fields()
        self.contacts.replace_str(cont_fields['givenName'], self.test_contact['givenName'])
        self.contacts.replace_str(cont_fields['familyName'], self.test_contact['familyName'])
        done_button = self.UTILS.element.getElement(DOM.Contacts.done_button, "'Done' button")
        done_button.tap()

        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)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:28,代码来源:test_35093.py

示例13: setUp

    def setUp(self):

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

        self.settings = Settings(self)
        self.download_manager = DownloadManager(self)
开发者ID:owdqa,项目名称:OWD_TEST_TOOLKIT,代码行数:7,代码来源:test_88888.py

示例14: setUp

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.contacts = Contacts(self)
        self.settings = Settings(self)
        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.target_name = "QA"
        self.test_contacts = [MockContact() for i in range(3)]
        self.test_contacts[0]["givenName"] = self.target_name
        self.test_contacts[0]["familyName"] = "Automation"
        self.test_contacts[0]["name"] = "{} {}".format(
            self.test_contacts[0]["givenName"], self.test_contacts[0]["familyName"])
        map(self.UTILS.general.insertContact, self.test_contacts)
    
        self.contacts.launch()
        self._add_contact_as_favorite(self.test_contacts[0])

        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)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:27,代码来源:test_35086.py

示例15: setUp

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

        self.fxa_user_1 = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass_1 = self.UTILS.general.get_config_variable("fxa_pass", "common")
        self.connect_to_network()

        self.loop.initial_test_checks()
        self.settings.launch()
        self.settings.fxa()

        if self.settings.is_fxa_logged_in():
            self.settings.fxa_log_out()
        self.settings.fxa_log_in(self.fxa_user_1, self.fxa_pass_1)

        self.apps.kill_all()
        time.sleep(2)

        # First, login with the first fxa
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.tap_on_firefox_login_button()

            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")
            self.loop.open_settings()
            self.loop.logout()
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:31,代码来源:test_34949.py


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