本文整理汇总了Python中OWDTestToolkit.apps.messages.Messages.go_back方法的典型用法代码示例。如果您正苦于以下问题:Python Messages.go_back方法的具体用法?Python Messages.go_back怎么用?Python Messages.go_back使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OWDTestToolkit.apps.messages.Messages
的用法示例。
在下文中一共展示了Messages.go_back方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import go_back [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)
示例2: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import go_back [as 别名]
class test_main(GaiaTestCase):
test_msg = "Test message."
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()
self.UTILS.general.insertContact(self.contact)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Launch messages app.
self.messages.launch()
# Create and send a new test message.
self.messages.create_and_send_sms([self.phone_number], "Test message.")
self.messages.wait_for_message()
# Tap the header to create a contact.
self.messages.header_addToContact()
# Select our contact.
self.contacts.view_contact(self.contact["givenName"], False)
# Check the phone number.
second_phone = self.UTILS.element.getElement(("id", "number_1"), "2nd phone number.")
self.UTILS.test.test(second_phone.get_attribute("value") == self.phone_number,
"Contact now has a 2nd number which is '{}' (it was '{}').".format(self.phone_number, second_phone.get_attribute("value")))
# Press the Done button.
done_btn = self.UTILS.element.getElement(DOM.Contacts.edit_update_button, "Update button")
done_btn.tap()
# Wait for contacts app to close and return to sms app.
self.marionette.switch_to_frame()
self.UTILS.element.waitForNotElements(("xpath", "//iframe[contains(@src, '{}')]".format(DOM.Contacts.frame_locator[1])),
"Contacts iframe")
self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
# Verify the header is now the name,
header = self.UTILS.element.getElement(DOM.Messages.message_header, "Message header")
self.UTILS.test.test(header.text == self.contact["name"],
"Message header has been changed to match the contact (it was '{}').".format(header.text))
# Go back to the threads view and check the message name there too.
self.messages.go_back()
self.messages.openThread(self.contact["name"])
示例3: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import go_back [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"])
示例4: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import go_back [as 别名]
class test_main(GaiaTestCase):
test_msg = "Test message."
def setUp(self):
# Set up child objects...
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")
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Launch messages app.
self.messages.launch()
# Create and send a new test message.
self.messages.create_and_send_sms([self.phone_number], "Test message.")
x = self.messages.wait_for_message()
# Tap the header to create a contact.
self.messages.header_createContact()
# Fill in some details.
contFields = self.contacts.get_contact_fields()
self.contacts.replace_str(contFields['givenName'], "Test")
self.contacts.replace_str(contFields['familyName'], "Testerton")
# Press the Done button.
x = self.UTILS.element.getElement(DOM.Contacts.done_button, "Done button")
x.tap()
# Wait for contacts app to close and return to sms app.
self.marionette.switch_to_frame()
self.UTILS.element.waitForNotElements(("xpath",
"//iframe[contains(@src, '{}')]".format(DOM.Contacts.frame_locator[1])),
"Contacts iframe")
self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
# Verify the header is now the name,
x = self.UTILS.element.getElement(DOM.Messages.message_header, "Message header")
self.UTILS.test.test(x.text == "Test Testerton",
"Message header has been changed to match the contact (it was '{}').".format(x.text))
# Go back to the threads view and check the message name there too.
self.messages.go_back()
self.messages.openThread("Test Testerton")
示例5: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import go_back [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 and set up the contact.
self.num1 = self.UTILS.general.get_config_variable("phone_number", "custom")
self.incoming_sms_num = self.UTILS.general.get_config_variable("sms_platform_numbers", "common").split(',')
self.contact = MockContact(tel={'type': 'Mobile', 'value': self.num1})
self.UTILS.general.insertContact(self.contact)
self.data_layer.delete_all_sms()
self.UTILS.statusbar.clearAllStatusBarNotifs()
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Launch messages app.
self.messages.launch()
self.test_msg = "Test message at {}".format(time.time())
# Send a message to myself (long and short number to get a few threads).
self.messages.create_and_send_sms([self.num1], self.test_msg)
self.UTILS.messages.create_incoming_sms(self.num1, self.test_msg)
self.messages.go_back()
self.UTILS.statusbar.wait_for_notification_toaster_detail(self.test_msg, timeout=120)
incoming_num = self.UTILS.statusbar.wait_for_notification_toaster_with_titles(self.incoming_sms_num,
frame_to_change=DOM.Messages.frame_locator, timeout=5)
# Check the threads for the required elements: name, time and excerpt
for num in [self.contact["name"], incoming_num]:
thread = self.UTILS.element.getElementByXpath(DOM.Messages.thread_selector_xpath.format(num))
name = self.marionette.find_element(*DOM.Messages.threads, id=thread.id).text
self.UTILS.test.test(num == name, "Expected thread name: {} Actual value: {}".format(num, name))
thread_time = self.marionette.find_element('css selector', 'p.summary time', id=thread.id).text
self.UTILS.test.test(thread_time, "Thread time found: {}".format(thread_time))
excerpt = self.marionette.find_element('css selector', 'p.summary span.body-text', id=thread.id)
self.UTILS.test.test(excerpt, "Thread excerpt found: {}".format(excerpt))
示例6: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import go_back [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)
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()
# 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.
self.messages.enterSMSMsg("xxx")
# Click the back button.
self.messages.go_back()
# Check for the save/discard popup.
discard_btn = self.UTILS.element.getElement(DOM.Messages.discard_msg_btn, "Discard button")
discard_btn.tap()
# Verify that we're now in the correct place.
self.UTILS.element.headerCheck("Messages")
threads = self.UTILS.element.getElement(DOM.Messages.no_threads_message, "No threads message")
self.UTILS.test.test(threads, "There are no threads, as expected")
示例7: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import go_back [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
# Get the correct number for the sms device.
self.num = self.UTILS.general.get_config_variable("phone_number", "custom")
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Launch messages app.
self.messages.launch()
"""
Send a message to a valid number to create a thread with just an
outgoing message
"""
msg_text = str(time.time())
self.messages.create_and_send_sms([self.num], msg_text)
self.messages.wait_for_message()
# Add another message to the same thread
msg_text = str(time.time())
self.messages.enterSMSMsg(msg_text)
self.messages.sendSMS()
self.messages.wait_for_message()
# Return to the threads view.
self.messages.go_back()
# Get the preview txt for our test.
preview_text = self.messages.getThreadText(self.num)
self.UTILS.test.test(preview_text in msg_text,
"Preview text (" + preview_text + ") is in the original message text(" + msg_text + ").")
示例8: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import go_back [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.cp_incoming_number = self.UTILS.general.get_config_variable("sms_platform_numbers", "common").split(',')
self.UTILS.reporting.logComment("Sending sms to telephone number " + self.phone_number)
self.test_msg = "Test message."
self.data_layer.delete_all_sms()
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Start by making sure we have no other notifications.
self.UTILS.statusbar.clearAllStatusBarNotifs()
self.UTILS.messages.create_incoming_sms(self.phone_number, self.test_msg)
self.UTILS.statusbar.wait_for_notification_toaster_detail(self.test_msg, timeout=120)
title = self.UTILS.statusbar.wait_for_notification_toaster_with_titles(self.cp_incoming_number, timeout=5)
# Click the notifier.
self.UTILS.statusbar.click_on_notification_title(title, DOM.Messages.frame_locator)
self.messages.check_last_message_contents(self.test_msg)
self.messages.go_back()
# Check the message via the thread.
self.messages.openThread(title)
self.messages.check_last_message_contents(self.test_msg)
示例9: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import go_back [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
# Start with no SMS.
self.data_layer.delete_all_sms()
# Get the correct number for the sms device.
self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Launch messages app.
self.messages.launch()
"""
Send a message to an invalid number to create a thread with just an
outgoing message..
"""
msg_text = str(time.time())
self.messages.create_and_send_sms([self.phone_number], msg_text)
self.messages.wait_for_message()
# Return to the threads view.
self.messages.go_back()
# Get the preview txt for our test.
preview_text = self.messages.getThreadText(self.phone_number)
self.UTILS.test.test(preview_text in msg_text,
"Preview text ({}) is in the original message text({}).".format(preview_text, msg_text))
示例10: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import go_back [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
self.own_number = self.UTILS.general.get_config_variable("phone_number", "custom")
self.nums = [self.own_number, self.UTILS.general.get_config_variable("short_phone_number", "custom")]
self.data_layer.delete_all_sms()
self.UTILS.statusbar.clearAllStatusBarNotifs()
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.data_layer.remove_all_contacts()
# Launch messages app.
self.messages.launch()
for num in self.nums:
test_msg = "Test message at {} for {}".format(time.time(), num)
self.messages.create_and_send_sms([num], test_msg)
if num == self.own_number:
send_time = self.messages.last_sent_message_timestamp()
self.messages.wait_for_message(send_time=send_time)
else:
self.UTILS.statusbar.wait_for_notification_toaster_detail(test_msg, timeout=120)
self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
self.messages.go_back()
target_names = self.UTILS.element.getElements(DOM.Messages.thread_target_names, "Threads target names")
bools = [title.text in self.nums for title in target_names]
msgs = ["A thread exists for {}".format(elem) for elem in self.nums]
map(self.UTILS.test.test, bools, msgs)
示例11: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import go_back [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)
# Prepare the contact we're going to insert.
self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
self.contact = MockContact(tel={'type': '', 'value': self.phone_number})
self.test_msg = "Test."
self.UTILS.general.insertContact(self.contact)
self.UTILS.reporting.logComment("Using target telephone number " + self.contact["tel"]["value"])
self.data_layer.delete_all_sms()
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
msgapp = self.messages.launch()
self.messages.create_and_send_sms([self.phone_number], "Test")
send_time = self.messages.last_sent_message_timestamp()
self.messages.wait_for_message(send_time=send_time)
self.messages.go_back()
self.messages.openThread(self.contact["name"])
# Delete the contact
self.apps.kill(msgapp)
self.contacts.launch()
self.contacts.delete_contact(self.contact["name"])
# Go back to SMS app and try to open the thread by phone number
self.messages.launch()
self.messages.openThread(self.contact["tel"]["value"])
示例12: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import go_back [as 别名]
class test_main(GaiaTestCase):
test_msg = "First message."
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)
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 and send some new tests messages.
self.messages.create_and_send_sms([self.phone_number], self.test_msg)
self.messages.wait_for_message()
self.messages.go_back()
# Delete this thread.
self.messages.deleteThreads([self.phone_number])
# Check thread isn't there anymore.
self.UTILS.element.waitForNotElements(("xpath", DOM.Messages.thread_selector_xpath.format(self.phone_number)),
"Thread")
示例13: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import go_back [as 别名]
class test_main(GaiaTestCase):
test_msg = "Test message."
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
self.incoming_sms_num = self.UTILS.general.get_config_variable("sms_platform_numbers", "common").split(',')
# Import details of our test contacts.
self.test_contacts = [MockContact() for i in range(3)]
self.test_contacts[0]["tel"] = {'type': 'Mobile', 'value': self.phone_number}
self.test_contacts[1]["tel"] = {'type': 'Mobile', 'value': self.incoming_sms_num[0]}
self.test_contacts[2]["tel"] = {'type': 'Mobile', 'value': self.incoming_sms_num[1]}
map(self.UTILS.general.insertContact, self.test_contacts)
self.data_layer.delete_all_sms()
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.UTILS.statusbar.clearAllStatusBarNotifs()
# Launch messages app.
self.messages.launch()
# Create and send a new test message.
self.UTILS.reporting.debug("*** Sending SMS to {}".format(self.test_contacts[0]["tel"]["value"]))
self.messages.create_and_send_sms([self.test_contacts[0]["tel"]["value"]], self.test_msg)
self.messages.go_back()
for i in range(2):
self.test_msg = "Test message {} at {}".format(i, time.time())
self.UTILS.messages.create_incoming_sms(self.phone_number, self.test_msg)
self.UTILS.statusbar.wait_for_notification_toaster_detail(self.test_msg, timeout=120)
self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
# Delete all threads, except the last one.
self.messages.threadEditModeON()
edit_btn = self.UTILS.element.getElement(DOM.Messages.edit_threads_button, "Edit threads button")
edit_btn.tap()
select_btn = self.UTILS.element.getElement(DOM.Messages.edit_msgs_select_threads_btn, "Select messages button")
select_btn.tap()
thread_list = self.UTILS.element.getElements(DOM.Messages.threads_list, "Message threads")
for i in range(len(thread_list) - 1):
thread_list[i].tap()
self.messages.deleteSelectedThreads()
# Check there is now only 1 thread.
msgs = self.UTILS.element.getElements(DOM.Messages.threads_list, "Message threads after deletion")
self.UTILS.test.test(len(msgs) == 1, "Only 1 thread is left after deleting the other two.")
示例14: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import go_back [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
self.messages = Messages(self)
tlf = self.UTILS.general.get_config_variable("phone_number", "custom")
self.contact = MockContact(tel={'type': 'Mobile', 'value': tlf})
self.num2 = "123456789"
self.UTILS.general.insertContact(self.contact)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Create a thread for this contact.
# (Just so we can switch to it later)
self.messages.launch()
self.messages.create_and_send_sms([self.contact["tel"]["value"]], "Test message")
self.messages.wait_for_message()
self.messages.go_back()
self.messages.create_and_send_sms([self.num2], "Thread for a different number")
self.apps.kill_all()
time.sleep(2)
self.UTILS.reporting.logResult("info", "<b>If SMS app is closed when you click 'send sms' in contacts ...</b>")
self._doTest()
self.apps.kill_all()
time.sleep(2)
self.messages.launch()
self.UTILS.reporting.logResult(
"info", "<b>If SMS app is still open when you click 'send sms' in contacts ...</b>")
self.messages.openThread(self.num2)
self._doTest()
def _doTest(self):
# Launch contacts app etc...
self.contacts.launch()
self.contacts.view_contact(self.contact['name'], False)
smsBTN = self.UTILS.element.getElement(DOM.Contacts.sms_button, "Send SMS button")
smsBTN.tap()
# Switch to sms frame and complete the tests + send the message.
time.sleep(5)
self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
self.UTILS.reporting.logResult(
"info", "<b>NOTE: </b>expecting to be in a 'compose new sms' screen (not a thread) ...")
self.messages.enterSMSMsg("Test msg.")
self.messages.sendSMS()
# Verify that we are now in the thread for this contact.
self.UTILS.reporting.logResult("info",
"<b>NOTE: </b> expecting to be automatically taken to the thread for '{}' ...".
format(self.contact['name']))
msg_count = self.UTILS.element.getElements(DOM.Messages.message_list, "Thread messages", False, 5, False)
if msg_count:
self.UTILS.test.test(len(msg_count) > 1, "There are <i>some</i> messages in this thread already.")
else:
self.UTILS.reporting.logResult(False, "There are <i>some</i> messages in this thread already.")
示例15: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import go_back [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
self.settings = Settings(self)
self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
self.cp_incoming_number = self.UTILS.general.get_config_variable("sms_platform_numbers", "common").split(',')
self.test_msg = "Test message."
self.data_layer.delete_all_sms()
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.UTILS.statusbar.clearAllStatusBarNotifs()
self.UTILS.date_and_time.set_time_to_now("Europe", "Madrid")
# Create and send a new test message.
self.UTILS.messages.create_incoming_sms(self.phone_number, self.test_msg)
self.UTILS.statusbar.wait_for_notification_toaster_detail(self.test_msg, timeout=120)
title = self.UTILS.statusbar.wait_for_notification_toaster_with_titles(self.cp_incoming_number, timeout=5)
self.UTILS.statusbar.click_on_notification_title(title, DOM.Messages.frame_locator)
# Check the time of this message.
time.sleep(2)
_orig_msg_timestamp = self.messages.time_of_last_message_in_thread()
self.UTILS.reporting.debug("*** original message timestamp = '{}'".format(_orig_msg_timestamp))
# Return to the threads screen and check the time of this thread.
self.messages.go_back()
time.sleep(1)
# Get the time of this thread.
_orig_thread_timestamp = self.messages.time_of_thread(title)
self.UTILS.reporting.debug("*** original thread timestamp = '{}'".format(_orig_thread_timestamp))
# Change to a (unlikely!) timezone.
self.apps.kill_all()
self.UTILS.date_and_time.set_time_to_now("Antarctica", "Casey")
# Open the sms app again.
self.messages.launch()
# Get the new thread time.
_new_thread_timestamp = self.messages.time_of_thread(title)
self.UTILS.reporting.debug("*** new thread timestamp = '{}'".format(_new_thread_timestamp))
# Open our thread.
self.messages.openThread(title)
# Get the new message time.
_new_msg_timestamp = self.messages.time_of_last_message_in_thread()
self.UTILS.reporting.debug("*** new message timestamp = '{}'".format(_new_msg_timestamp))
self.UTILS.test.test(_orig_thread_timestamp != _new_thread_timestamp, "Thread timestamp has changed.")
self.UTILS.test.test(_orig_msg_timestamp != _new_msg_timestamp, "Message timestamp has changed.")