This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13660 from AndreiH/bug934480_v1.2
Bug 934480 - [v1.2] Write a test for Messages app matching with contacts
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
tests/python/gaia-ui-tests/gaiatest/tests/functional/messages/test_sms_contact_match.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |