Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #13660 from AndreiH/bug934480_v1.2
Browse files Browse the repository at this point in the history
Bug 934480 - [v1.2] Write a test for Messages app matching with contacts
  • Loading branch information
bobsilverberg committed Nov 20, 2013
2 parents dd6666b + d599254 commit 71b9eef
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
Expand Up @@ -14,3 +14,5 @@ skip-if = device == "desktop"
skip-if = device == "desktop"

[test_sms_contact_input_validation.py]

[test_sms_contact_match.py]
@@ -0,0 +1,33 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import time

from gaiatest import GaiaTestCase
from gaiatest.apps.messages.app import Messages
from gaiatest.mocks.mock_contact import MockContact


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()
keyboard = new_message.tap_recipient_section()
keyboard.send(self.contact['name'])
keyboard.tap_enter()
self.messages.switch_to_messages_frame()

# verify that contacts and tel number match
self.assertEqual(self.contact['name'], new_message.first_recipient_name)
self.assertEqual(self.contact['tel'][0]['value'], new_message.first_recipient_number_attribute)

0 comments on commit 71b9eef

Please sign in to comment.