Ejemplo n.º 1
0
    def test_receive_new_message_with_tutorial(self):
        """Verify if the tutorial appears after receive a message"""
        thread_list = self.app.select_single(objectName='threadList')
        self.assertThat(thread_list.visible, Equals(True))
        self.assertThat(thread_list.count, Equals(0))

        number = '5555555678'
        message = 'open me'
        # receive message
        helpers.receive_sms(number, message)
        # verify that we got the message
        self.assertThat(thread_list.count, Eventually(Equals(1)))

        # click message thread
        mess_thread = self.verify_thread(number, message)
        self.pointing_device.click_object(mess_thread)

        swipe_item_demo = self.main_view.get_swipe_item_demo()
        self.assertThat(swipe_item_demo.enabled, Eventually(Equals(True)))
        self.assertThat(swipe_item_demo.necessary, Eventually(Equals(True)))
        got_it_button = swipe_item_demo.select_single('Button',
                                                      objectName='gotItButton')
        self.pointing_device.click_object(got_it_button)
        self.assertThat(swipe_item_demo.enabled, Eventually(Equals(False)))
        self.assertThat(swipe_item_demo.necessary, Eventually(Equals(False)))
Ejemplo n.º 2
0
    def test_receive_message(self):
        """Verify that we can receive a text message"""
        # receive an sms message
        phone_num = '0815'
        message = 'hello to Ubuntu'
        helpers.receive_sms(phone_num, message)

        # verify that we got the message
        self.assertThat(self.thread_list.count, Eventually(Equals(1)))

        self.verify_thread(phone_num, message)
Ejemplo n.º 3
0
    def test_delete_message_thread_swipe_right(self):
        """Verify we can delete a message thread by swiping right"""
        # receive an sms message
        helpers.receive_sms('0815', 'hello to Ubuntu')

        # verify that we got the message
        self.assertThat(self.thread_list.count, Eventually(Equals(1)))

        # delete thread by swiping
        self.main_view.delete_thread('0815')
        self.assertThat(self.thread_list.count, Eventually(Equals(0)))
Ejemplo n.º 4
0
    def test_messages_with_color_name_ids(self):
        """Verify that we can open threads with numbers matching color names"""
        # receive an sms message
        phone_num = 'Orange'
        message = 'hello to Ubuntu'
        helpers.receive_sms(phone_num, message)

        # verify that we got the message
        self.assertThat(self.thread_list.count, Eventually(Equals(1)))

        # verify thread
        self.verify_thread(phone_num, message)
Ejemplo n.º 5
0
 def receive_messages(self, count=3):
     # send the required number of messages. Reversed because on the QML,
     # the one with the 0 index is the latest received.
     messages = []
     message_indexes = list(reversed(range(count)))
     for index in message_indexes:
         message_text = 'test message {}'.format(index)
         helpers.receive_sms(self.number, message_text)
         time.sleep(1)
         # Prepend to make sure that the indexes match.
         messages.insert(0, message_text)
     # Wait for the thread.
     self.main_page.get_thread_from_number(self.number)
     return messages
Ejemplo n.º 6
0
 def test_open_received_message(self):
     """Verify we can open a txt message we have received"""
     number = '5555555678'
     message = 'open me'
     # receive message
     helpers.receive_sms(number, message)
     self.assertThat(self.thread_list.count, Eventually(Equals(1)))
     # click message thread
     mess_thread = self.verify_thread(number, message)
     self.pointing_device.click_object(mess_thread)
     self.main_view.get_message(message)
     # send new message
     self.main_view.type_message('{} 2'.format(message))
     self.main_view.click_send_button()
     # verify both messages are seen in list
     self.main_view.get_message('{} 2'.format(message))
     self.main_view.get_message(message)
Ejemplo n.º 7
0
 def test_receive_text_with_letters_in_phone_number(self):
     """verify we can receive a text message with letters for a phone #"""
     number = 'letters'
     message = 'open me'
     # receive message
     helpers.receive_sms(number, message)
     self.assertThat(self.thread_list.count, Eventually(Equals(1)))
     # click message thread
     # phonesim sends text with number as letters@
     mess_thread = self.main_view.get_thread_from_number('letters@')
     self.pointing_device.click_object(mess_thread)
     self.main_view.get_message(message)
     # send new message
     self.main_view.type_message('{} 2'.format(message))
     self.main_view.click_send_button()
     # verify both messages are seen in list
     self.main_view.get_message('{} 2'.format(message))
     self.main_view.get_message(message)
Ejemplo n.º 8
0
    def test_check_multiple_messages_received(self):
        """Verify that received messages are correctly displayed"""
        main_page = self.main_view.select_single(emulators.MainPage)
        recipient = '123456'
        helpers.receive_sms(recipient, 'first message')

        # wait for the thread
        main_page.get_thread_from_number(recipient)
        messages_page = main_page.open_thread(recipient)

        for i in list(reversed(range(10))):
            helpers.receive_sms(recipient, 'message %s' % i)

        list_view = messages_page.get_list_view()
        self.assertThat(list_view.count, Eventually(Equals(11)))

        messages = messages_page.get_messages()

        for i in range(10):
            expectedMessage = 'message %s' % i
            self.assertThat(messages[i][1], Equals(expectedMessage))