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


Python app.Messages类代码示例

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


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

示例1: test_sms_forward_sent_message

    def test_sms_forward_sent_message(self):
        """
        https://moztrap.mozilla.org/manage/case/11075/
        """

        # Launch the app
        messages = Messages(self.marionette)
        messages.launch()
        message_thread = messages.tap_first_received_message()
        sent_messages = len(message_thread.sent_messages)

        # Forward the last sent message
        last_sent_message = message_thread.sent_messages[-1]
        activities = last_sent_message.long_press_message()
        new_message = activities.tap_forward_message()

        # Check that the 'To' field is empty
        self.assertEqual(new_message.recipients[0].text, u'')

        # Check that the message field has the content we expect
        self.assertEqual(new_message.message, self._text_message_content)

        new_message.type_phone_number(self.testvars['plivo']['phone_number'])
        new_message.tap_send()

        # Wait for the message to be sent correctly
        self.wait_for_condition(lambda m: len(message_thread.sent_messages) > sent_messages)

        # Check that the last sent message has the content we expect
        self.assertEqual(message_thread.sent_messages[1].text, self._text_message_content)
开发者ID:6a68,项目名称:gaia,代码行数:30,代码来源:test_sms_forward_sent_message.py

示例2: TestContactMatch

class TestContactMatch(GaiaTestCase):
    def test_contact_match(self):

        # insert contact
        self.contact = MockContact(
            tel={'value': '555%s' % repr(time.time()).replace('.', '')[8:]})
        self.data_layer.insert_contact(self.contact)

        # launch Messages app
        self.messages = Messages(self.marionette)
        self.messages.launch()

        new_message = self.messages.tap_create_new_message()

        from gaiatest.apps.keyboard.app import Keyboard
        keyboard = Keyboard(self.marionette)

        keyboard.send(self.contact['name'])
        keyboard.tap_enter()

        # verify that contacts and tel number match
        self.assertEqual(self.contact['name'],
                         new_message.first_recipient_name)
        self.assertEqual(self.contact['tel']['value'],
                         new_message.first_recipient_number_attribute)
开发者ID:nitral,项目名称:gaia,代码行数:25,代码来源:test_sms_contact_match.py

示例3: tap_back_button

 def tap_back_button(self):
     # In a message thread, tap the back button to return to main message list
     back_header_button = self.marionette.find_element(*self._back_header_link_locator)
     back_header_button.tap()
     messages = Messages(self.marionette)
     messages.wait_for_message_list()
     return messages
开发者ID:AkshayTiwari,项目名称:gaia,代码行数:7,代码来源:message_thread.py

示例4: TestDialerFromMessage

class TestDialerFromMessage(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)

    def test_dialer_from_message(self):

        # Send a SMS to the device
        _text_message_content = "Automated Test %s" % str(time.time())

        # Open first received message
        self.messages = Messages(self.marionette)
        self.messages.launch()

        self.data_layer.send_sms(self.testvars['carrier']['phone_number'], _text_message_content)
        self.apps.switch_to_displayed_app()

        self.messages.wait_for_message_received(timeout=180)

        message_thread = self.messages.tap_first_received_message()

        # Check the phone number
        message_thread.tap_header()
        keypad = message_thread.tap_call()
        self.assertEquals(keypad.phone_number, self.testvars['carrier']['phone_number'])
开发者ID:Bharatpattani,项目名称:gaia,代码行数:25,代码来源:test_sms_to_dialer.py

示例5: TestSmsAddContact

class TestSmsAddContact(GaiaTestCase):

    def test_sms_add_contact(self):
        """ Add a contact to a message. """

        _text_message_content = "Automated Test %s" % str(time.time())

        # insert contact
        self.contact = MockContact(tel=[{
            'type': ['Mobile'],
            'value': "%s" % self.testvars['carrier']['phone_number']}])
        self.data_layer.insert_contact(self.contact)

        self.messages = Messages(self.marionette)
        self.messages.launch()

        new_message = self.messages.tap_create_new_message()
        contacts_app = new_message.tap_add_recipient()
        contacts_app.wait_for_contacts()
        contacts_app.contact(self.contact['givenName'][0]).tap(return_details=False)
        contacts_app.wait_for_contacts_frame_to_close()

        self.messages.switch_to_messages_frame()

        self.assertIn(self.contact['givenName'][0], new_message.first_recipient_name)

        new_message.type_message(_text_message_content)

        self.message_thread = new_message.tap_send()
        self.message_thread.wait_for_received_messages()

        last_received_message = self.message_thread.received_messages[-1]
        self.assertEqual(_text_message_content, last_received_message.text)
开发者ID:SasiParuchuri,项目名称:gaia,代码行数:33,代码来源:test_sms_add_contact.py

示例6: test_sms_send

    def test_sms_send(self):
        """
        https://moztrap.mozilla.org/manage/case/10743/
        """
        messages = Messages(self.marionette)
        messages.launch()

        new_message = messages.create_new_message(recipients=[self.environment.phone_numbers[0]],
                                                  message=self._text_message_content)
        activities_list = new_message.tap_attachment()
        camera = activities_list.tap_camera()

        camera.tap_capture()
        camera.tap_select_button()

        # back to messages app frame
        new_message.wait_for_resizing_to_finish()

        self.message_thread = new_message.tap_send(timeout=300)
        self.message_thread.wait_for_received_messages(timeout=300)

        last_received_message = self.message_thread.received_messages[-1]
        last_message = self.message_thread.all_messages[-1]

        self.assertEqual(self._text_message_content, last_received_message.text.strip('\n').strip())
        self.assertEqual(last_received_message.id, last_message.id)
        self.assertTrue(last_message.has_attachments)

        view_image = last_message.tap_attachment()
        view_image.tap_save_image()
        self.assertIn('saved to Gallery', view_image.banner_message)

        # 2 pictures should be on the sd card:
        # One is the picture we sent, the other is the one saved
        self.assertEqual(2, len(self.data_layer.picture_files))
开发者ID:Archaeopteryx,项目名称:gaia,代码行数:35,代码来源:test_sms_with_attachments.py

示例7: TestContactValidation

class TestContactValidation(GaiaTestCase):

    def test_sms_contact_validation(self):

        self.messages = Messages(self.marionette)
        self.messages.launch()

        new_message = self.messages.tap_create_new_message()
        keyboard = new_message.tap_recipient_section()
        keyboard.send('test_contact')
        keyboard.tap_enter()

        # Verify if recipient is invalid and uneditable
        self.assertIn('attention', new_message.recipient_css_class)
        self.assertTrue(new_message.is_recipient_name_editable == 'false')

        new_message.tap_recipient_name()

        self.assertTrue(new_message.is_recipient_name_editable == 'true')

        # Type_message will tap in the field to focus it
        new_message.type_message('This is a test message')

        #TODO Wait for the javascript
        time.sleep(1)

        self.assertFalse(new_message.is_send_button_enabled)
开发者ID:gentlefolk,项目名称:gaia,代码行数:27,代码来源:test_sms_contact_input_validation.py

示例8: TestDialerFromMessage

class TestDialerFromMessage(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)

    def test_dialer_from_message(self):

        # Send a SMS to the device
        _text_message_content = "Automated Test %s" % str(time.time())

        # Open first received message
        self.messages = Messages(self.marionette)
        self.messages.launch()

        self.data_layer.send_sms(self.testvars["carrier"]["phone_number"], _text_message_content)
        self.apps.switch_to_displayed_app()

        self.messages.wait_for_message_received(timeout=180)

        # Sometimes tap is done on the notification instead of message header
        self.marionette.switch_to_frame()
        system = System(self.marionette)
        system.wait_for_notification_toaster_not_displayed()

        self.apps.switch_to_displayed_app()
        message_thread = self.messages.tap_first_received_message()

        # Check the phone number
        keypad = message_thread.tap_call()
        self.assertEquals(keypad.phone_number, self.testvars["carrier"]["phone_number"])
开发者ID:RazorPandaFang,项目名称:gaia,代码行数:29,代码来源:test_sms_to_dialer.py

示例9: TestSMSContactInput

class TestSMSContactInput(GaiaTestCase):

    def test_sms_semicolon_completes_the_entered_recipient(self):
        """
            https://moztrap.mozilla.org/manage/case/10925/
        """

        self.messages = Messages(self.marionette)
        self.messages.launch()

        new_message = self.messages.tap_create_new_message()

        from gaiatest.apps.keyboard.app import Keyboard
        keyboard = Keyboard(self.marionette)

        keyboard.send('074')
        keyboard.send(';')

        # Verify if recipient is valid and uneditable
        self.assertNotIn('invalid', new_message.recipient_css_class)
        self.assertTrue(new_message.is_recipient_name_editable == 'false')

        keyboard.send('777')
        keyboard.send(';')

        self.assertEqual(new_message.number_of_recipients, 2)
        new_message.tap_message()
        self.assertEqual(new_message.number_of_recipients, 2)

        self.marionette.switch_to_frame()
        self.assertTrue(new_message.keyboard.is_keyboard_displayed)
开发者ID:AaskaShah,项目名称:gaia,代码行数:31,代码来源:test_sms_semicolon_completes_the_entered_recipient.py

示例10: test_sms_send

    def test_sms_send(self):
        # launch the app
        messages = Messages(self.marionette)
        messages.launch()

        # click new message
        new_message = messages.tap_create_new_message()
        new_message.type_phone_number(self.testvars['carrier']['phone_number'])

        new_message.type_message(self._text_message_content)
        activities_list = new_message.tap_attachment()
        camera = activities_list.tap_camera()

        camera.tap_capture()
        camera.tap_select_button()

        # back to messages app frame
        new_message.wait_for_resizing_to_finish()

        #click send
        self.message_thread = new_message.tap_send(timeout=300)
        self.message_thread.wait_for_received_messages(timeout=300)

        # get the most recent listed and most recent received text message
        last_received_message = self.message_thread.received_messages[-1]
        last_message = self.message_thread.all_messages[-1]

        # Check the most recent received message has the same text content
        self.assertEqual(self._text_message_content, last_received_message.text.strip('\n').strip())

        # Check that most recent message is also the most recent received message
        self.assertEqual(last_received_message.id, last_message.id)

        # Check that message has attachments
        self.assertTrue(last_message.has_attachments)
开发者ID:AkshayTiwari,项目名称:gaia,代码行数:35,代码来源:test_sms_with_attachments.py

示例11: TestSmsAddContact

class TestSmsAddContact(GaiaTestCase):

    def test_sms_add_contact(self):
        """ Add a contact to a message. """

        _text_message_content = "Automated Test %s" % str(time.time())

        # insert contact
        self.contact = MockContact(tel={
            'type': 'Mobile',
            'value': '555%s' % repr(time.time()).replace('.', '')[8:]})
        self.data_layer.insert_contact(self.contact)

        self.messages = Messages(self.marionette)
        self.messages.launch()

        new_message = self.messages.tap_create_new_message()
        contacts_app = new_message.tap_add_recipient()
        contacts_app.wait_for_contacts()

        # After tap, don't return a class; fall back to the displayed frame which should be Messages app
        contacts_app.contact(self.contact['givenName']).tap(return_class=None)

        self.assertIn(self.contact['givenName'], new_message.first_recipient_name)
        self.assertEquals(self.contact['tel']['value'], new_message.first_recipient_number_attribute)

        new_message.type_message(_text_message_content)
        self.assertTrue(new_message.is_send_button_enabled)
开发者ID:4gh,项目名称:gaia,代码行数:28,代码来源:test_sms_add_contact.py

示例12: test_sms_notification_removed_when_sms_deleted

    def test_sms_notification_removed_when_sms_deleted(self):
        """
        https://moztrap.mozilla.org/manage/case/8778/
        """

        _text_message_content = "Automated Test %s" % str(time.time())

        messages = Messages(self.marionette)
        messages.launch()

        self.data_layer.send_sms(self.environment.phone_numbers[0], _text_message_content, skip_verification=True)

        system = System(self.marionette)

        # We will wait upto 300 seconds for the SMS to arrive due to network latency
        system.wait_for_notification_toaster_displayed(timeout=300)
        system.wait_for_notification_toaster_not_displayed()

        self.apps.switch_to_displayed_app()

        message_thread = messages.tap_first_received_message()
        Wait(self.marionette).until(lambda m: len(message_thread.received_messages) > 0)
        messages_number = len(message_thread.all_messages)
        last_received_message = message_thread.received_messages[-1]

        activities = last_received_message.long_press_message()
        activities.tap_delete_message()
        activities.confirm_delete_message()

        Wait(self.marionette).until(lambda m: len(message_thread.all_messages) == messages_number - 1)

        self.marionette.switch_to_frame()

        utility_tray = system.open_utility_tray()
        self.assertEqual(0, len(utility_tray.notifications))
开发者ID:Archaeopteryx,项目名称:gaia,代码行数:35,代码来源:test_sms_notification_removed_when_sms_deleted.py

示例13: TestDialerFromMessage

class TestDialerFromMessage(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)

        # Launch the SMS app
        self.messages = Messages(self.marionette)
        self.messages.launch()

    def test_dialer_from_message(self):

        # Send a SMS to the device
        _text_message_content = "Automated Test %s" % str(time.time())

        # Tap new message
        new_message = self.messages.tap_create_new_message()
        new_message.type_phone_number(self.testvars['carrier']['phone_number'])

        new_message.type_message(_text_message_content)

        # Tap send
        self.message_thread = new_message.tap_send()
        self.message_thread.tap_header()
        keypad = self.message_thread.tap_call()
        self.assertEquals(keypad.phone_number, self.testvars['carrier']['phone_number'])
开发者ID:Allan019,项目名称:gaia,代码行数:25,代码来源:test_sms_to_dialer.py

示例14: TestContactValidation

class TestContactValidation(GaiaTestCase):

    def test_sms_contact_validation(self):

        self.messages = Messages(self.marionette)
        self.messages.launch()

        new_message = self.messages.tap_create_new_message()
        keyboard = new_message.tap_recipient_section()
        keyboard.send('test_contact')
        keyboard.tap_enter()
        self.messages.switch_to_messages_frame()

        # Verify if recipient is invalid and uneditable
        self.assertIn('attention', new_message.recipient_css_class)
        self.assertTrue(new_message.is_recipient_name_editable == 'false')

        new_message.tap_recipient_name()

        self.assertTrue(new_message.is_recipient_name_editable == 'true')

        # extra step to place the cursor in the message field
        new_message.tap_message_field()
        new_message.type_message('This is a test message')

        self.assertFalse(new_message.is_send_button_enabled)
开发者ID:Allan019,项目名称:gaia,代码行数:26,代码来源:test_sms_contact_input_validation.py

示例15: TestSms

class TestSms(GaiaTestCase):

    def test_sms_send(self):
        """
        This test sends a text message to itself. It waits for a reply message.
        https://moztrap.mozilla.org/manage/case/1322/
        """

        _text_message_content = "Automated Test %s" % str(time.time())

        # launch the app
        self.messages = Messages(self.marionette)
        self.messages.launch()

        # click new message
        new_message = self.messages.tap_create_new_message()
        new_message.type_phone_number(self.testvars['carrier']['phone_number'])

        new_message.type_message(_text_message_content)

        #click send
        self.message_thread = new_message.tap_send()
        self.message_thread.wait_for_received_messages()

        # get the most recent listed and most recent received text message
        last_received_message = self.message_thread.received_messages[-1]
        last_message = self.message_thread.all_messages[-1]

        # Check the most recent received message has the same text content
        self.assertEqual(_text_message_content, last_received_message.text)

        # Check that most recent message is also the most recent received message
        self.assertEqual(last_received_message.id, last_message.id)
开发者ID:AaronMT,项目名称:gaia-ui-tests,代码行数:33,代码来源:test_sms.py


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