本文整理汇总了Python中OWDTestToolkit.apps.messages.Messages.startNewSMS方法的典型用法代码示例。如果您正苦于以下问题:Python Messages.startNewSMS方法的具体用法?Python Messages.startNewSMS怎么用?Python Messages.startNewSMS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OWDTestToolkit.apps.messages.Messages
的用法示例。
在下文中一共展示了Messages.startNewSMS方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import startNewSMS [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
# Import contact (adjust to the correct number).
self.test_num = self.UTILS.general.get_config_variable("phone_number", "custom")
self.contact1 = MockContact(givenName="Name 1", familyName="Surname 1",
name="Name 1 Surname 1", tel={"type": "Mobile", "value": self.test_num})
self.UTILS.reporting.logComment("Using target telephone number " + self.contact1["tel"]["value"])
self.UTILS.general.insertContact(self.contact1)
self.call_number = self.UTILS.general.get_config_variable("incoming_call_number", "common")
self.data_layer.delete_all_sms()
self.UTILS.statusbar.clearAllStatusBarNotifs()
_ = setup_translations(self)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.messages.launch()
self.messages.startNewSMS()
self.messages.addContactToField(self.contact1["name"])
# Insert the phone number in the To field
self.messages.addNumbersInToField([self.call_number])
search_str = _("2 recipients")
self.UTILS.element.headerCheck(search_str)
# Enter the message.
self.UTILS.reporting.logResult("info", "Enter the message.")
self.messages.enterSMSMsg("Test 29911")
# Send the message.
self.messages.sendSMS()
self.UTILS.statusbar.wait_for_notification_toaster_title(self.contact1["name"])
self.UTILS.iframe.switch_to_frame(*DOM.Messages.frame_locator)
# Verify the number is shown in the header as there is no contact name
self.messages.openThread(self.call_number)
self.messages.checkThreadHeader(self.call_number)
self.UTILS.reporting.logResult("info", "Verify the number is shown in the header as there is no contact name")
# Return to main SMS page.
self.messages.closeThread()
# Verify the thread now contains the name of the contact instead of the phone number
self.UTILS.reporting.logResult("info", "Trying to open the thread with name: " + self.contact1["name"])
self.messages.openThread(self.contact1["name"])
self.messages.checkThreadHeaderWithNameSurname(self.contact1["name"])
示例2: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import startNewSMS [as 别名]
class test_main(GaiaTestCase):
test_msg = "Hello World {}".format(time.time())
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
self.gallery = Gallery(self)
self.music = Music(self)
self.video = Video(self)
# Establish which phone number to use.
self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
self.UTILS.reporting.logComment("Sending mms to telephone number " + self.phone_number)
self.data_layer.delete_all_sms()
self.UTILS.statusbar.clearAllStatusBarNotifs()
self.expected_sizes = ["4.8", "62.3", "175.6"]
self.expected_names = ["80x60.jpg", "30k_basic_AMR.amr", "mpeg4.3gp"]
self.UTILS.general.add_file_to_device('./tests/_resources/80x60.jpg')
self.UTILS.general.add_file_to_device('./tests/_resources/30k_basic_AMR.amr')
self.UTILS.general.add_file_to_device('./tests/_resources/mpeg4.mp4')
def tearDown(self):
self.UTILS.general.remove_files()
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.messages.launch()
self.messages.startNewSMS()
self.messages.addNumbersInToField([self.phone_number])
self.messages.enterSMSMsg(self.test_msg)
self.messages.create_mms_image()
self.gallery.click_on_thumbnail_at_position_mms(0)
self.messages.create_mms_music()
self.music.click_on_song_mms()
self.messages.create_mms_video()
self.video.click_on_video_at_position_mms(0)
# Click send and wait for the message to be received
self.messages.sendSMS()
last_msg = self.messages.wait_for_message()
attachments = self.messages.get_mms_attachments_info(last_msg)
self.UTILS.reporting.debug("*** ATTACHMENTS: {}".format(attachments))
# Check the names and sizes of all attachments are as expected
for (i, att) in enumerate(attachments):
self.UTILS.test.test(self.expected_names[i] == att["name"] and self.expected_sizes[i] == att["size"],
"Attachment [{}] ({}kb) Expected [{}] ({}kb)".\
format(self.expected_names[i], self.expected_sizes[i],
att["name"], att["size"]))
示例3: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import startNewSMS [as 别名]
class test_main(GaiaTestCase):
test_str = "abcdefghijklmnopqrstuvwxyz"
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
# Establish which phone number to use.
self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
self.UTILS.reporting.logComment("Sending sms to telephone number " + self.phone_number)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Launch messages app.
self.messages.launch()
"""
Type a message containing the required string
(the test is already included in 'enterSMSMsg' because it uses 'typeThis()').
"""
self.messages.startNewSMS()
self.messages.enterSMSMsg(self.test_str, False)
self.UTILS.debug.screenShot("5968")
示例4: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import startNewSMS [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
# Prepare the contact we're going to insert.
self.contact = MockContact(givenName="Name", familyName="Surname", name="Name Surname")
self.UTILS.general.insertContact(self.contact)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.messages.launch()
self.messages.startNewSMS()
self.messages.addContactToField(self.contact["name"])
self.UTILS.reporting.logResult("info", "Correct name is in the 'To' list.")
示例5: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import startNewSMS [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
self.messages = Messages(self)
# Import contact (adjust the correct number).
self.contact = MockContact()
self.UTILS.general.insertContact(self.contact)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.messages.launch()
# Start a new SMS and add the message and contact name.
self.messages.startNewSMS()
self.messages.selectAddContactButton()
self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
self.contacts.view_contact(self.contact["givenName"], False)
self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
self.messages.checkIsInToField(self.contact["name"], True)
# Remove it.
self.messages.removeContactFromToField(self.contact["name"])
# Verify the contact name is no longer present before removing it.
self.messages.checkIsInToField(self.contact["name"], False)
示例6: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import startNewSMS [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
self.contacts = Contacts(self)
self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
self.contact = MockContact(tel={'type': '', 'value': self.phone_number})
self.UTILS.general.insertContact(self.contact)
self.UTILS.reporting.logComment("Using target telephone number " + self.contact["tel"]["value"])
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.messages.launch()
# Type a message containing the required string
self.messages.startNewSMS()
self.messages.enterSMSMsg("Test message")
# Search for our contact.
self.messages.selectAddContactButton()
self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
self.contacts.search("Knot A Match")
self.contacts.check_search_results("Knot A Match", False)
示例7: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import startNewSMS [as 别名]
class test_main(GaiaTestCase):
test_msg = "Hello World"
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
self.gallery = Gallery(self)
self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
self.UTILS.reporting.logComment("Sending mms to telephone number " + self.phone_number)
self.test_msg = "Test message for test 31727"
self.UTILS.general.add_file_to_device('./tests/_resources/300x300.png')
def tearDown(self):
self.UTILS.general.remove_files()
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.messages.launch()
self.messages.startNewSMS()
self.messages.addNumbersInToField([self.phone_number])
self.messages.enterSMSMsg(self.test_msg)
self.messages.create_mms_image()
self.gallery.click_on_thumbnail_at_position_mms(0)
self.messages.sendSMS()
self.messages.wait_for_message()
self.messages.check_last_message_contents(self.test_msg, mms=True)
self.messages.verify_mms_received('img', self.phone_number)
示例8: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import startNewSMS [as 别名]
class test_main(GaiaTestCase):
test_msg = "Test."
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
self.contacts = Contacts(self)
self.gallery = Gallery(self)
# Import contact (adjust to the correct number).
self.test_num = self.UTILS.general.get_config_variable("phone_number", "custom")
self.cont = MockContact(tel={"type": "Mobile", "value": self.test_num})
self.UTILS.reporting.logComment("Using target telephone number " + self.cont["tel"]["value"])
def tearDown(self):
self.UTILS.general.remove_files()
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.UTILS.general.add_file_to_device('./tests/_resources/imgd.jpg')
# Launch messages app.
self.messages.launch()
# Create a new SMS
self.messages.startNewSMS()
# Insert the phone number in the To field
self.messages.addNumbersInToField([self.test_num])
# Create MMS.
self.messages.enterSMSMsg(self.test_msg)
self.messages.create_mms_image()
self.gallery.click_on_thumbnail_at_position_mms(0)
# Click send and wait for the message to be received
self.messages.sendSMS()
send_time = self.messages.last_sent_message_timestamp()
"""
Open contacts app and create a contact with the same phone number used to send the MMS in the
previous step
"""
self.contacts.launch()
self.contacts.create_contact(self.cont)
# Switch back to the messages app.
self.UTILS.home.goHome()
self.messages.launch()
# Verify the thread now contains the name of the contact instead of the phone number
self.UTILS.reporting.logComment("Trying to open the thread with name: " + self.cont["name"])
self.messages.openThread(self.cont["name"])
self.messages.wait_for_message(send_time)
示例9: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import startNewSMS [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
# Establish which phone number to use.
self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
self.UTILS.reporting.logComment("Sending sms to telephone number " + self.phone_number)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Launch messages app.
self.messages.launch()
# Start a new sms.
self.messages.startNewSMS()
# Enter a message the message area.
x = self.messages.enterSMSMsg("Test text.")
# Check the 'Send button isn't enabled yet.
x = self.UTILS.element.getElement(DOM.Messages.send_message_button, "Send message button")
self.UTILS.test.test(not x.is_enabled(),
"Send button is not enabled after message supplied, but target still empty.")
示例10: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import startNewSMS [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
self.contacts = Contacts(self)
self.contact = MockContact(tel=[{'type': 'Mobile', 'value': '111111111'},
{'type': 'Mobile', 'value': '222222222'}])
self.UTILS.general.insertContact(self.contact)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.messages.launch()
# Type a message containing the required string
self.messages.startNewSMS()
self.messages.enterSMSMsg("Test message")
# Search for our contact.
self.messages.selectAddContactButton()
self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
self.contacts.search(self.contact['name'])
self.contacts.select_search_result_several_phones(self.contact['name'],
self.contact['tel'][0]['value'], cancel=True)
示例11: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import startNewSMS [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
self.gallery = Gallery(self)
# Establish which phone number to use.
self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
self.UTILS.reporting.logComment("Sending sms to telephone number " + self.phone_number)
self.data_layer.delete_all_sms()
def tearDown(self):
self.UTILS.general.remove_files()
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.UTILS.statusbar.clearAllStatusBarNotifs()
self.UTILS.general.add_file_to_device('./tests/_resources/80x60.jpg')
# Create message.
sms_message = "Test"
# Launch messages app.
self.messages.launch()
# Create and send a new test message.
self.messages.create_and_send_sms([self.phone_number], sms_message)
self.messages.wait_for_message()
self.messages.go_back()
self.UTILS.element.waitForNotElements(DOM.Messages.mms_icon, "MMS Icon")
self.messages.startNewSMS()
# Insert the phone number in the To field
self.messages.addNumbersInToField([self.phone_number])
# Create MMS.
self.messages.enterSMSMsg(sms_message)
self.messages.create_mms_image()
self.gallery.click_on_thumbnail_at_position_mms(0)
# Click send and wait for the message to be received
self.messages.sendSMS()
self.messages.wait_for_message()
self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
self.messages.go_back()
self.messages.checkMMSIcon(self.phone_number)
示例12: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import startNewSMS [as 别名]
class test_main(GaiaTestCase):
test_msg = "Test."
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
self.contacts = Contacts(self)
# Import contact (adjust to the correct number).
self.test_num = self.UTILS.general.get_config_variable("phone_number", "custom")
self.cont = MockContact(tel={"type": "Mobile", "value": self.test_num})
self.UTILS.reporting.logComment("Using target telephone number " + self.cont["tel"]["value"])
self.data_layer.delete_all_sms()
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Launch messages app.
self.messages.launch()
# Create a new SMS
self.messages.startNewSMS()
# Insert the phone number in the To field
self.messages.addNumbersInToField([self.test_num])
# Create SMS.
self.messages.enterSMSMsg(self.test_msg)
# Click send and wait for the message to be received
self.messages.sendSMS()
self.messages.wait_for_message()
self.messages.go_back()
"""
Open contacts app and create a contact with the same phone number used to send the SMS in the
previous step
"""
self.contacts.launch()
self.contacts.create_contact(self.cont)
# Switch back to the messages app.
# self.UTILS.app.switchToApp("Messages")
self.messages.launch()
# Verify the thread now contains the name of the contact instead of the phone number
self.UTILS.reporting.logComment("Trying to open the thread with name: " + self.cont["name"])
self.messages.openThread(self.cont["name"])
示例13: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import startNewSMS [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
self.target_num = self.UTILS.general.get_config_variable("phone_number", "custom")
self.test_msg = "Test."
self.data_layer.delete_all_sms()
def tearDown(self):
self.UTILS.reporting.reportResults()
self.UTILS.statusbar.toggleViaStatusBar('airplane')
def test_run(self):
# Create a new SMS
self.messages.launch()
self.messages.startNewSMS()
# Insert the phone number in the To field
self.messages.addNumbersInToField([self.target_num])
# Create SMS.
self.messages.enterSMSMsg(self.test_msg)
# Click send.
self.messages.sendSMS()
send_time = self.messages.last_sent_message_timestamp()
# Wait for the SMS to arrive.
self.messages.wait_for_message(send_time=send_time)
self.UTILS.home.goHome()
# Put the phone into airplane mode.
self.UTILS.statusbar.toggleViaStatusBar('airplane')
self.UTILS.reporting.debug("*** Launching messages again!!!")
self.messages.launch()
# Open sms app and go to the previous thread
self.messages.openThread(self.target_num)
# Create another SMS.
self.messages.enterSMSMsg(self.test_msg)
# Click send.
self.messages.sendSMS()
# Check that popup appears.
self.messages.checkAirplaneModeWarning()
示例14: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import startNewSMS [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
self.keyboard = Keyboard(self.marionette)
# Establish which phone number to use.
self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
self.UTILS.reporting.logComment("Sending sms to telephone number " + self.phone_number)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Launch messages app.
self.messages.launch()
# Start a new sms.
self.messages.startNewSMS()
# Enter a number in the target field.
self.messages.addNumbersInToField([self.phone_number])
# Enter a message the message area.
test_msg = "test message"
self.messages.enterSMSMsg(test_msg)
# Check the 'Send' button is now enabled.
send_btn = self.UTILS.element.getElement(DOM.Messages.send_message_button, "Send message button")
self.UTILS.test.test(send_btn.is_enabled(), "Send button is enabled when everything's filled in.")
"""
Delete the text (we should already be in the message area with the
keyboard present, but we need to 'manually' use the keyboard for this).
"""
for i in range(len(test_msg)):
self.keyboard.tap_backspace()
self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
msg_area = self.UTILS.element.getElement(DOM.Messages.input_message_area, "Message area")
self.UTILS.test.test(msg_area.text == "", "Message area is clear after deleting all characters in it.")
# Check the Send button isn't enabled any more.
send_btn = self.UTILS.element.getElement(DOM.Messages.send_message_button, "Send message button")
self.UTILS.test.test(not send_btn.is_enabled(),
"Send button is not enabled after target number is supplied, but message still empty.")
示例15: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import startNewSMS [as 别名]
class test_main(GaiaTestCase):
test_msg = "Test."
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
self.gallery = Gallery(self)
self.music = Music(self)
self.settings = Settings(self)
# Establish which phone number to use.
self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
self.UTILS.reporting.logComment("Sending mms to telephone number " + self.phone_number)
def tearDown(self):
self.UTILS.general.remove_files()
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Load files into the device.
self.UTILS.general.add_file_to_device('./tests/_resources/imgd.jpg')
self.UTILS.general.add_file_to_device('./tests/_resources/MP3.mp3')
# Launch messages app.
self.messages.launch()
# Create a new SMS
self.messages.startNewSMS()
# Insert the phone number in the To field
self.messages.addNumbersInToField([self.phone_number])
# Create MMS.
self.messages.enterSMSMsg(self.test_msg)
self.messages.create_mms_image()
self.gallery.click_on_thumbnail_at_position_mms(0)
self.messages.create_mms_music()
self.music.click_on_song_mms()
# Click send and wait for the message to be received
self.messages.sendSMS()
self.messages.wait_for_message()
self.messages.verify_mms_received('img', self.phone_number)
self.messages.verify_mms_received('audio', self.phone_number)