• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python messages.Messages类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: test_main

class test_main(GaiaTestCase):

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

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.email = Email(self)

        self.email_user = self.UTILS.general.get_config_variable("gmail_1_user", "common")
        self.email_address = self.UTILS.general.get_config_variable("gmail_1_email", "common")
        self.email_pass = self.UTILS.general.get_config_variable("gmail_1_pass", "common")

        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.emailAddy = self.UTILS.general.get_config_variable("gmail_2_email", "common")
        self.connect_to_network()

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

    def test_run(self):
        self.email.launch()
        self.email.setup_account(self.email_user, self.email_address, self.email_pass)

        # Create and send a new test message.
        self.messages.launch()
        test_msg = "Email address {} test at {}".format(self.emailAddy, time.time())
        self.data_layer.send_sms(self.phone_number, test_msg)
        self.UTILS.statusbar.wait_for_notification_toaster_detail(test_msg, timeout=120)
        self.UTILS.statusbar.click_on_notification_detail(test_msg, DOM.Messages.frame_locator)
        sms = self.messages.last_message_in_this_thread()

        # Verify that the email address opens the email app.
        link = sms.find_element("tag name", "a")
        link.tap()
        self.wait_for_element_displayed(*DOM.Messages.header_send_message_btn, timeout=30)

        cancel = self.UTILS.element.getElement(DOM.Messages.contact_cancel_btn, "Cancel button")
        cancel.tap()

        # Go into edit mode.
        edit_btn = self.UTILS.element.getElement(DOM.Messages.edit_messages_icon, "Edit button")
        edit_btn.tap()

        # Select Messages mode
        select_msgs_btn = self.UTILS.element.getElement(DOM.Messages.edit_msgs_select_btn, "Select messages button")
        select_msgs_btn.tap()
        self.UTILS.element.waitForElements(DOM.Messages.edit_msgs_header, "Edit messages mode header")

        # Verify that the email address does not open the email app.
        sms = self.messages.last_message_in_this_thread()
        link = sms.find_element("tag name", "a")
        link.tap()

        # Now try to find the email app iframe.
        self.wait_for_element_not_displayed(*DOM.Messages.header_send_message_btn, timeout=30)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:60,代码来源:test_26981.py


示例2: test_main

class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)

        # Prepare the contact we're going to insert.
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.contact = MockContact(tel={'type': '', 'value': self.phone_number})
        self.UTILS.general.insertContact(self.contact)
        self.incoming_sms_num = self.UTILS.general.get_config_variable("sms_platform_numbers", "common").split(',')
        self.data_layer.delete_all_sms()

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

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

        # Create message - 5 x 10 chars.
        timestamp = " {}".format(time.time())
        sms_message = "0123456789" * 5 + timestamp
        self.UTILS.reporting.logComment("Message length sent: {}".format((len(sms_message))))

        self.UTILS.messages.create_incoming_sms(self.phone_number, sms_message)
        self.UTILS.statusbar.wait_for_notification_toaster_detail(timestamp, timeout=120)
        title = self.UTILS.statusbar.wait_for_notification_toaster_with_titles(self.incoming_sms_num, timeout=5)
        self.UTILS.statusbar.click_on_notification_title(title, DOM.Messages.frame_locator)

        self.messages.forwardMessageToMultipleRecipients("sms", self.phone_number, self.contact["name"])
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:34,代码来源:test_31570.py


示例3: 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.video = Video(self)

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

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

    def test_run(self):
        self.UTILS.statusbar.clearAllStatusBarNotifs()
        self.messages.create_and_send_mms('video', [self.phone_number], self.test_msg)
        self.messages.verify_mms_received("video", self.phone_number)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:25,代码来源:test_31726.py


示例4: test_main

class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.messages = Messages(self)


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

    def test_run(self):

        self.contacts.launch()
        self.messages.launch()
        self.UTILS.home.touchHomeButton()
        time.sleep(1)

        self.UTILS.home.holdHomeButton()

        self.UTILS.element.waitForElements(DOM.Home.cards_view, "App 'cards' list (task switcher)")

        x = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult("info", "Screenshot:", x)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:28,代码来源:test_26416.py


示例5: test_main

class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)

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

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

    def test_run(self):

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

        # Start a new sms.
        self.messages.startNewSMS()

        # Enter a message the message area.
        x = self.messages.enterSMSMsg("Test text.")

        # Check the 'Send button isn't enabled yet.
        x = self.UTILS.element.getElement(DOM.Messages.send_message_button, "Send message button")
        self.UTILS.test.test(not x.is_enabled(), 
                        "Send button is not enabled after message supplied, but target still empty.")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:32,代码来源:test_27745.py


示例6: test_main

class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)

        # Establish which phone number to use.
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.msg = "Test {}".format(time.time())
        self.cp_incoming_number = self.UTILS.general.get_config_variable("sms_platform_numbers", "common").split(',')
        self.data_layer.delete_all_sms()

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

    def test_run(self):

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

        self.UTILS.messages.create_incoming_sms(self.phone_number, self.msg)
        self.UTILS.statusbar.wait_for_notification_toaster_detail(self.msg, timeout=120)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:26,代码来源:test_26849.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)

        # Prepare the contact we're going to insert.
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.contact = MockContact(tel={'type': '', 'value': self.phone_number})

        self.UTILS.general.insertContact(self.contact)
        self.UTILS.reporting.logComment("Using target telephone number " + self.contact["tel"]["value"])

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

    def test_run(self):

        # Launch messages app.
        self.messages.launch()
        """
        Send a message to create a thread (use number, not name as this
        avoids some blocking bugs just now). 
        """

        self.messages.create_and_send_sms( [self.contact["tel"]["value"]], "Test message.")
        returnedSMS = self.messages.wait_for_message()

        # Examine the header.
        self.UTILS.element.headerCheck(self.contact["name"])
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:34,代码来源:test_27763.py


示例8: 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)
        self.data_layer.delete_all_sms()

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

    def test_run(self):

        # Configure Auto Retrieve as off from messaging settings
        self.settings.launch()
        self.settings.configure_mms_auto_retrieve("on_without_r")

        send_time = self.messages.create_and_send_mms("image", [self.phone_number], self.test_msg)
        self.messages.wait_for_message(send_time)
        self.messages.verify_mms_received("img", self.phone_number)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:31,代码来源:test_29901.py


示例9: test_main

class test_main(GaiaTestCase):

    test_msg = "This text has multiple spaces 1  2  3  4  5."

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)

        # Remove number and import contact.
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.incoming_sms_num = self.UTILS.general.get_config_variable("sms_platform_numbers", "common").split(',')
        self.UTILS.reporting.logComment("Sending sms to telephone number " + self.phone_number)

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

    def test_run(self):
        self.UTILS.messages.create_incoming_sms(self.phone_number, self.test_msg)
        self.UTILS.statusbar.wait_for_notification_toaster_detail(self.test_msg, timeout=120)
        title = self.UTILS.statusbar.wait_for_notification_toaster_with_titles(self.incoming_sms_num, timeout=5)
        self.UTILS.statusbar.click_on_notification_title(title, DOM.Messages.frame_locator)

        # Check the receievd message.
        self.messages.check_last_message_contents(self.test_msg)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:28,代码来源:test_27742.py


示例10: 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)

        timestamp = time.time()
        self.test_msgs = ["Hello world {} at {}".format(i, timestamp) for i in range(3)]

        # 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)
        self.data_layer.delete_all_sms()
        self.UTILS.statusbar.clearAllStatusBarNotifs()

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

    def test_run(self):
        for msg in self.test_msgs:
            self.messages.create_and_send_mms("image", [self.phone_number], msg)
            self.messages.wait_for_message()
            self.messages.closeThread()

        self.messages.openThread(self.phone_number)
        self.messages.deleteMessagesInThisThread()
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:31,代码来源:test_29916.py


示例11: test_main

class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)

        # Import contact (adjust to the correct number).
        self.telNum = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.UTILS.reporting.logComment("Using target telephone number " + self.telNum)

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

    def test_run(self):

        # Launch messages app.
        self.messages.launch()
        """
        Send a message to create a thread (use number, not name as this
        avoids some blocking bugs just now). 
        """

        self.messages.create_and_send_sms([self.telNum], "Test message.")
        returnedSMS = self.messages.wait_for_message()
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:28,代码来源:test_27741.py


示例12: 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.actions = Actions(self.marionette)

        # Establish which phone number to use.
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.incoming_sms_num = self.UTILS.general.get_config_variable("sms_platform_numbers", "common").split(',')
        self.UTILS.reporting.logComment("Sending sms to telephone number " + self.phone_number)
        self.data_layer.delete_all_sms()

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

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

        # Create message
        timestamp = " {}".format(time.time())
        sms_message = "0123456789" * 5 + timestamp
        self.UTILS.reporting.logComment("Message length sent: {}".format((len(sms_message))))

        self.UTILS.messages.create_incoming_sms(self.phone_number, sms_message)
        self.UTILS.statusbar.wait_for_notification_toaster_detail(timestamp, timeout=120)
        title = self.UTILS.statusbar.wait_for_notification_toaster_with_titles(self.incoming_sms_num, timeout=5)
        self.UTILS.statusbar.click_on_notification_title(title, DOM.Messages.frame_locator)

        self.messages.forwardMessage("sms", self.phone_number)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:35,代码来源:test_31573.py


示例13: test_main

class test_main(GaiaTestCase):

    test_msg = "Test message."

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)

        # Establish which phone number to use.
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.cp_incoming_number = self.UTILS.general.get_config_variable("sms_platform_numbers", "common").split(',')
        self.UTILS.reporting.logComment("Sending sms to telephone number " + self.phone_number)
        self.data_layer.delete_all_sms()

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

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

        # Create and send a new test message.
        self.UTILS.messages.create_incoming_sms(self.phone_number, self.test_msg)

        self.UTILS.statusbar.wait_for_notification_toaster_detail(self.test_msg, timeout=120)
        title = self.UTILS.statusbar.wait_for_notification_toaster_with_titles(self.cp_incoming_number, timeout=5)
        self.UTILS.statusbar.click_on_notification_title(title, DOM.Messages.frame_locator)

        self.messages.check_last_message_contents(self.test_msg)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:32,代码来源:test_26860.py


示例14: 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.messages = Messages(self)
        self.Email = Email(self)

        self.email_user = self.UTILS.general.get_config_variable("gmail_1_user", "common")
        self.email_address = self.UTILS.general.get_config_variable("gmail_1_email", "common")
        self.email_pass = self.UTILS.general.get_config_variable("gmail_1_pass", "common")

        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.emailAddy = self.UTILS.general.get_config_variable("gmail_2_email", "common")

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

    def test_run(self):

        # Set up email account.
        self.connect_to_network()

        self.Email.launch()
        self.Email.setup_account(self.email_user, self.email_address, self.email_pass)

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

        # Create and send a new test message.
        msg_text = "Email one [email protected], two {} , three [email protected] at {}".\
                    format(self.emailAddy, time.time())
        self.data_layer.send_sms(self.phone_number, msg_text)
        self.UTILS.statusbar.wait_for_notification_toaster_detail(msg_text, timeout=120)
        self.UTILS.statusbar.click_on_notification_detail(msg_text, DOM.Messages.frame_locator)
        sms = self.messages.last_message_in_this_thread()
        time.sleep(1)

        # Tap the 2nd email link.
        self.UTILS.reporting.logResult("info", "Click the email address in this message: '{}'.".format(sms.text))
        _link = sms.find_elements("tag name", "a")[1]
        _link.tap()

        # Click on "Send email" button from the overlay
        send_btn = self.UTILS.element.getElement(DOM.Messages.header_send_email_btn, "Send email button")
        send_btn.tap()

        # Switch to email frame and verify the email address is in the To field.
        self.UTILS.iframe.switchToFrame(*DOM.Email.frame_locator)
        x = self.UTILS.element.getElement(DOM.Email.compose_to_from_contacts, "To field")
        self.UTILS.test.test(x.text == self.emailAddy,
                             "To field contains '{}' (it was '{}').".format(self.emailAddy, self.emailAddy))
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:59,代码来源:test_26982.py


示例15: test_main

class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.messages = Messages(self)

        # Get details of our test contacts.
        self.contact = MockContact(tel=[{'type': 'Mobile', 'value': '11111111'},
                                    {'type': 'Mobile', 'value': '222222222'}])
        """
        We're not testing adding a contact, so just stick one
        into the database.
        """

        self.UTILS.general.insertContact(self.contact)

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

    def test_run(self):

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

        # Select our contact.

        # View the details of our contact.
        self.contacts.view_contact(self.contact['name'])

        # Tap the 2nd sms button (index=1) in the view details screen to go to the sms page.
        smsBTN = self.UTILS.element.getElement(("id", DOM.Contacts.sms_button_specific_id.format(1)),
                                        "2nd send SMS button")
        smsBTN.tap()
        """
        Switch to the 'Messages' app frame (or marionette will still be watching the
        'Contacts' app!).
        """

        self.marionette.switch_to_frame()
        self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
        time.sleep(3)
        """
        test: this automatically opens the 'send SMS' screen, so
        check the correct name is in the header of this sms.
        """

        self.UTILS.element.headerCheck("1 recipient")

        # Check this is the right number.
        self.messages.checkIsInToField(self.contact["name"])
        self.messages.checkNumberIsInToField(self.contact["tel"][1]["value"])
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:56,代码来源:test_26403.py


示例16: test_main

class test_main(GaiaTestCase):

    link = "www.google.com"
    test_msg = "Test " + link + " this."

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.browser = Browser(self)

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

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

    def test_run(self):
        self.connect_to_network()

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

        # Create and send a new test message.
        self.messages.create_and_send_sms([self.phone_number], self.test_msg)
        """
        Wait for the last message in this thread to be a 'received' one
        and click the link.
        """

        msg = self.messages.wait_for_message()
        self.UTILS.test.test(msg, "Received a message.", True)

        # Go into messages Settings..
        #
        edit_btn = self.UTILS.element.getElement(DOM.Messages.edit_messages_icon, "Edit button")
        edit_btn.tap()

        select_btn = self.UTILS.element.getElement(DOM.Messages.edit_msgs_select_btn, "Select button")
        select_btn.tap()

        tag = msg.find_element("tag name", "a")
        tag.tap()

        header = self.UTILS.element.getElement(DOM.Messages.edit_msgs_header, "1 selected message")
        self.UTILS.test.test(header.text == "1 selected",
            "Into edit mode, if you tap on link, the browser is not open and the message is selected.")

        self.marionette.switch_to_frame()
        time.sleep(5)  # (give the browser time to launch)
        self.UTILS.element.waitForNotElements(("xpath", "//iframe[contains(@src,'browser')]"), "Browser iframe")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:55,代码来源:test_26970.py


示例17: test_main

class test_main(GaiaTestCase):

    test_msg = "Test."

    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.contacts = Contacts(self)
        self.messages = Messages(self)

        # Prepare the contact we're going to insert.
        tlf = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.contact = MockContact(tel={'type': 'Mobile', 'value': tlf})

        self.UTILS.reporting.logComment("Using target telephone number " + self.contact["tel"]["value"])

        # Add this contact (quick'n'dirty method - we're just testing sms, no adding a contact).
        self.UTILS.general.insertContact(self.contact)

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

    def test_run(self):

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

        # View the details of our contact.
        self.contacts.view_contact(self.contact['name'])

        # Tap the sms button in the view details screen to go to the sms page.
        smsBTN = self.UTILS.element.getElement(DOM.Contacts.sms_button, "Send SMS button")
        smsBTN.tap()
        """
        Switch to the 'Messages' app frame (or marionette will still be watching the
        'Contacts' app!).
        """

        time.sleep(2)
        self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)

        # Create SMS.
        x = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult("info", "frame", x)
        self.messages.enterSMSMsg(self.test_msg)

        # Click send.
        self.messages.sendSMS()
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:55,代码来源:test_26883.py


示例18: test_main

class test_main(GaiaTestCase):

    test_msg = "Test message."

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.Email = Email(self)

        self.email_user = self.UTILS.general.get_config_variable("gmail_1_user", "common")
        self.email_address = self.UTILS.general.get_config_variable("gmail_1_email", "common")
        self.email_pass = self.UTILS.general.get_config_variable("gmail_1_pass", "common")
 
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.emailAddy = self.UTILS.general.get_config_variable("gmail_2_email", "common")

        self.contact = MockContact(email = {'type': 'Personal', 'value': self.emailAddy})

        self.UTILS.general.insertContact(self.contact)

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

    def test_run(self):

        # Set up email account.
        self.connect_to_network()

        self.Email.launch()
        self.Email.setup_account(self.email_user, self.email_address, self.email_pass)

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

        # Create and send a new test message.
        self.messages.create_and_send_sms([self.phone_number], "Email {} one.".format(self.emailAddy))
        x = self.messages.wait_for_message()

        # Tap the email link.
        link = x.find_element("tag name", "a")
        link.tap()

        # Press 'add to existing contact' button.
        w = self.UTILS.element.getElement(DOM.Messages.header_send_email_btn, "Send email button")
        w.tap()

        # Switch to email frame and verify the email address is in the To field.
        self.UTILS.iframe.switchToFrame(*DOM.Email.frame_locator)
        x = self.UTILS.element.getElement(DOM.Email.compose_to_from_contacts, "To field")
        self.UTILS.test.test(x.text == self.emailAddy, 
                        "To field contains '{}' (it was '{}').".format(self.emailAddy, self.emailAddy))
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:55,代码来源:test_26980.py


示例19: 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.contacts = Contacts(self)
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")

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

    def test_run(self):

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

        # Create and send a new test message.
        test_str = "Nine 123456789 numbers."
        self.messages.create_and_send_sms([self.phone_number], test_str)
        msg = self.messages.wait_for_message()

        # Long press the emedded number link.
        tag = msg.find_element("tag name", "a")
        tag.tap()

        # Select create new contact.
        create_btn = self.UTILS.element.getElement(DOM.Messages.header_create_new_contact_btn,
                                    "Create new contact button")
        create_btn.tap()
        self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)

        # Cancel the action.
        form_header = self.UTILS.element.getElement(DOM.Contacts.contact_form_header, "Cancel button")
        form_header.tap(25, 25)

        # Wait for the contacts app to go away.
        self.marionette.switch_to_frame()
        self.UTILS.element.waitForNotElements(("xpath",
                                        "//iframe[contains(@src, '{}')]".format(DOM.Contacts.frame_locator[1])),
                                        "Contacts iframe")

        # Kill the SMS app (and all others).
        self.apps.kill_all()

        # Open the contacts app.
        self.contacts.launch()

        # Verify that there are no contacts.
        self.UTILS.element.waitForElements(("xpath", "//p[contains(text(), 'No contacts')]"),
                                    "No contacts message")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:54,代码来源:test_26999.py


示例20: 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.browser = Browser(self)
        self.actions = Actions(self.marionette)

        # Establish which phone number to use.
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.target_email = self.UTILS.general.get_config_variable("gmail_1_email", "common")

        self.msg = "Testing email link with " + self.target_email

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

    def test_run(self):

        self.connect_to_network()

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

        # Create and send a new test message.
        self.messages.create_and_send_sms([self.phone_number], self.msg)
        """
        Wait for the last message in this thread to be a 'received' one
        and click the link.
        """

        x = self.messages.wait_for_message()
        self.UTILS.test.test(x, "Received a message.", True)

        # Long-press the link.
        email_link = x.find_element("tag name", "a")
        email_link.tap()

        x = self.UTILS.element.getElement(DOM.Messages.header_add_to_contact_btn,
                                    "'Add to an existing contact' button")
        x.tap()

        # Check for warning message.
        self.UTILS.iframe.switchToFrame("src", "contacts")

        self.UTILS.element.waitForElements(("xpath", 
                "//p[contains(text(),'contact list is empty')]"), "Warning message")

        fnam = self.UTILS.debug.screenShot("26975")
        self.UTILS.reporting.logResult("info", "Screenshot of final position", fnam)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:54,代码来源:test_26975.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python settings.Settings类代码示例发布时间:2022-05-24
下一篇:
Python loop.Loop类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap