本文整理汇总了Python中gaiatest.apps.messages.app.Messages.switch_to_messages_frame方法的典型用法代码示例。如果您正苦于以下问题:Python Messages.switch_to_messages_frame方法的具体用法?Python Messages.switch_to_messages_frame怎么用?Python Messages.switch_to_messages_frame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gaiatest.apps.messages.app.Messages
的用法示例。
在下文中一共展示了Messages.switch_to_messages_frame方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestSmsAddContact
# 需要导入模块: from gaiatest.apps.messages.app import Messages [as 别名]
# 或者: from gaiatest.apps.messages.app.Messages import switch_to_messages_frame [as 别名]
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)
示例2: TestContactValidation
# 需要导入模块: from gaiatest.apps.messages.app import Messages [as 别名]
# 或者: from gaiatest.apps.messages.app.Messages import switch_to_messages_frame [as 别名]
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)
示例3: TestSmsWithAttachments
# 需要导入模块: from gaiatest.apps.messages.app import Messages [as 别名]
# 或者: from gaiatest.apps.messages.app.Messages import switch_to_messages_frame [as 别名]
class TestSmsWithAttachments(GaiaTestCase):
def test_sms_send(self):
self.data_layer.connect_to_cell_data()
_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)
select_attachment = new_message.tap_attachment()
camera = select_attachment.tap_camera()
# switch frame to camera iframe
camera.switch_to_camera_frame()
camera.wait_for_camera_ready()
camera.tap_capture()
camera.wait_for_select_button_displayed()
camera.tap_select_button()
# switch back to messages app frame
self.messages.switch_to_messages_frame()
# 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(_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)
示例4: TestSmsCreateContact
# 需要导入模块: from gaiatest.apps.messages.app import Messages [as 别名]
# 或者: from gaiatest.apps.messages.app.Messages import switch_to_messages_frame [as 别名]
class TestSmsCreateContact(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
_text_message_content = "Automated Test %s" % str(time.time())
self.data_layer.send_sms(self.testvars['carrier']['phone_number'], _text_message_content)
self.messages = Messages(self.marionette)
self.messages.launch()
def test_sms_create_new_contact(self):
self.contact = MockContact()
self.message_thread = self.messages.tap_first_received_message()
self.message_thread.wait_for_received_messages()
# Check that we received the correct message
self.assertEqual(self.message_thread.header_text, self.testvars['carrier']['phone_number'])
activities = self.message_thread.tap_header()
# Create a new contact
activities.tap_create_new_contact()
# Populate new contact fields
new_contact = NewContact(self.marionette)
new_contact.type_given_name(self.contact['givenName'])
new_contact.type_family_name(self.contact['familyName'])
new_contact.type_email(self.contact['email']['value'])
new_contact.type_street(self.contact['adr']['streetAddress'])
new_contact.type_zip_code(self.contact['adr']['postalCode'])
new_contact.type_city(self.contact['adr']['locality'])
new_contact.type_country(self.contact['adr']['countryName'])
new_contact.type_comment(self.contact['note'])
new_contact.tap_done(return_contacts=False)
self.messages.switch_to_messages_frame()
self.wait_for_condition(lambda m: self.message_thread.header_text == self.contact['name'])
contacts = Contacts(self.marionette)
contacts.launch()
contact_details = contacts.contacts[0].tap()
self.assertEqual(contact_details.phone_numbers[0], self.testvars['carrier']['phone_number'])
示例5: TestSmsAddToExistingContact
# 需要导入模块: from gaiatest.apps.messages.app import Messages [as 别名]
# 或者: from gaiatest.apps.messages.app.Messages import switch_to_messages_frame [as 别名]
class TestSmsAddToExistingContact(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.contact = MockContact()
self.data_layer.insert_contact(self.contact)
_text_message_content = "Automated Test %s" % str(time.time())
self.data_layer.send_sms(self.testvars['carrier']['phone_number'], _text_message_content)
self.messages = Messages(self.marionette)
self.messages.launch()
def test_sms_add_number_to_existing_contact(self):
# open the message thread screen
self.message_thread = self.messages.tap_first_received_message()
self.message_thread.wait_for_received_messages()
# Check that we received the correct message
self.assertEqual(self.message_thread.header_text, self.testvars['carrier']['phone_number'])
activities = self.message_thread.tap_header()
contacts = activities.tap_add_to_contact()
contacts.wait_for_contacts(1)
contacts.contacts[0].tap(return_details=False)
edit_contact = EditContact(self.marionette)
edit_contact.tap_update(return_details=False)
self.messages.switch_to_messages_frame()
self.wait_for_condition(lambda m: self.message_thread.header_text == self.contact['name'])
contacts = Contacts(self.marionette)
contacts.launch()
contact_details = contacts.contacts[0].tap()
self.assertEqual(contact_details.phone_numbers[1], self.testvars['carrier']['phone_number'])
示例6: TestContactMatch
# 需要导入模块: from gaiatest.apps.messages.app import Messages [as 别名]
# 或者: from gaiatest.apps.messages.app.Messages import switch_to_messages_frame [as 别名]
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'][0])
keyboard.tap_enter()
self.messages.switch_to_messages_frame()
# verify that contacts and tel number match
self.assertEqual(self.contact['name'][0], new_message.first_recipient_name)
self.assertEqual(self.contact['tel'][0]['value'], new_message.first_recipient_number_attribute)
示例7: test_sms_send
# 需要导入模块: from gaiatest.apps.messages.app import Messages [as 别名]
# 或者: from gaiatest.apps.messages.app.Messages import switch_to_messages_frame [as 别名]
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.wait_for_camera_ready()
camera.tap_capture()
camera.wait_for_select_button_displayed()
camera.tap_select_button()
# switch back to messages app frame
messages.switch_to_messages_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)