本文整理汇总了Python中OWDTestToolkit.apps.messages.Messages.closeThread方法的典型用法代码示例。如果您正苦于以下问题:Python Messages.closeThread方法的具体用法?Python Messages.closeThread怎么用?Python Messages.closeThread使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OWDTestToolkit.apps.messages.Messages
的用法示例。
在下文中一共展示了Messages.closeThread方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import closeThread [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 the correct number).
self.telNum = self.UTILS.general.get_config_variable("phone_number", "custom")
self.UTILS.reporting.logComment("Using target telephone number " + self.telNum)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Launch messages app.
self.messages.launch()
"""
Send a message to create a thread (use number, not name as this
avoids some blocking bugs just now).
"""
self.messages.create_and_send_sms([self.telNum], "Test message.")
returnedSMS = self.messages.wait_for_message()
# Examine the header.
self.UTILS.element.headerCheck(self.telNum)
# Close the thread and check we can find it again with this number.
self.messages.closeThread()
self.messages.openThread(self.telNum)
示例2: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import closeThread [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)
timestamp = time.time()
self.test_msgs = ["Hello world {} at {}".format(i, timestamp) for i in range(3)]
# 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()
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
for msg in self.test_msgs:
self.messages.create_and_send_mms("image", [self.phone_number], msg)
self.messages.wait_for_message()
self.messages.closeThread()
self.messages.openThread(self.phone_number)
self.messages.deleteMessagesInThisThread()
示例3: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import closeThread [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"])
示例4: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import closeThread [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)
self.settings = Settings(self)
self.test_msg = "Hello World"
self.phone_number = self.UTILS.general.get_config_variable("incoming_call_number", "common")
self.UTILS.reporting.logComment("Sending mms to telephone number " + self.phone_number)
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.messages.launch()
# Create and Send all MMS
for msg in ["Test {}".format(i) for i in range(3)]:
self.messages.create_and_send_mms("image", [self.phone_number], msg)
self.messages.closeThread()
self.messages.openThread(self.phone_number)
# Check the messages
msg_list = self.UTILS.element.getElements(DOM.Messages.message_list, "Message list", False)
pos = 0
for (pos, msg) in enumerate(msg_list):
# Do the check for each message.
self.UTILS.test.test(msg.find_element("css selector", "p span").text == "Test {}".format(pos),
"The message at position {} contains the string 'Test {}'.".format(pos, pos))
self.UTILS.test.test("outgoing" in msg.get_attribute("class"),
"The message at position {} is outgoing.".format(pos))
示例5: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import closeThread [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)
# Establish which phone number to use.
self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
self.UTILS.reporting.logComment("Using target telephone number " + self.phone_number)
self.incoming_sms_num = self.UTILS.general.get_config_variable("sms_platform_numbers", "common").split(',')
self.data_layer.delete_all_sms()
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.messages.launch()
sms_msg = "Just creating a message thread."
self.UTILS.messages.create_incoming_sms(self.phone_number, sms_msg)
self.UTILS.statusbar.wait_for_notification_toaster_detail(sms_msg, timeout=120)
title = self.UTILS.statusbar.wait_for_notification_toaster_with_titles(self.incoming_sms_num, timeout=5)
self.UTILS.statusbar.click_on_notification_title(title, DOM.Messages.frame_locator)
# Return to main SMS page.
self.messages.closeThread()
# Press the edit button (without selecting any threads).
self.messages.editAndSelectThreads([])
# Check that the delete button is not enabled.
delete_btn = self.UTILS.element.getElement(DOM.Messages.threads_delete_button, "Delete button")
disabled = delete_btn.get_attribute("disabled")
self.UTILS.test.test(disabled, "Delete button is not enabled.")
示例6: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import closeThread [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
# Define target phone numbers
num_prefix_plus = self.UTILS.general.get_config_variable("phone_number", "custom")
num_prefix_double_zero = num_prefix_plus.replace("+", "00")
num_no_prefix = num_prefix_plus.replace("+34", "")
self.target_numbers = [num_prefix_plus, num_prefix_double_zero, num_no_prefix]
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.messages.launch()
for num in self.target_numbers:
test_msg = "Hello World at {} for {}".format(time.time(), num)
self.messages.create_and_send_mms("image", [num], test_msg)
self.messages.wait_for_message()
self.messages.closeThread()
time.sleep(3)
# Check how many elements are there
count = self.messages.countNumberOfThreads()
self.UTILS.reporting.logResult("info", "Number of threads {} in list.".format(count))
self.UTILS.test.test(count == 1, "There are {} threads (expected {})".format(count, 1))
示例7: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import closeThread [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)
self.test_msg = "Hello World"
# Establish which phone number to use.
num1 = 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": num1})
self.UTILS.reporting.logComment("Using target telephone number " + self.contact1["tel"]["value"])
self.UTILS.general.insertContact(self.contact1)
num2 = self.UTILS.general.get_config_variable("incoming_call_number", "common")
self.contact2 = MockContact(givenName="Name 3", familyName="Surname 3",
name="Name 3 Surname 3", tel={"type": "Mobile", "value": num2})
self.UTILS.reporting.logComment("Using target telephone number " + self.contact2["tel"]["value"])
self.UTILS.general.insertContact(self.contact2)
self.data_layer.delete_all_sms()
self.UTILS.statusbar.clearAllStatusBarNotifs()
self.test_nums = [self.contact1["tel"]["value"], self.contact2["tel"]["value"]]
def tearDown(self):
self.UTILS.general.remove_files()
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.messages.launch()
# Create a new SMS
self.messages.startNewSMS()
# Insert the phone numbers in the To field
for num in self.test_nums:
self.messages.addNumbersInToField([num])
# Create MMS.
self.messages.enterSMSMsg(self.test_msg)
# Add an image file
self.UTILS.general.add_file_to_device('./tests/_resources/80x60.jpg')
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()
self.messages.closeThread()
self.messages.openThread(self.contact1["name"])
self.messages.wait_for_message(send_time=send_time)
# Obtaining file attached type
img_type = self.UTILS.element.getElement(DOM.Messages.attach_preview_img_type, "preview type")
typ = img_type.get_attribute("data-attachment-type")
if typ != "img":
self.UTILS.test.test(False, "Incorrect file type. The file must be img ")
self.messages.closeThread()
# Check how many elements are there
self.UTILS.reporting.logResult("info", "Check how many threads are there")
original_count = self.messages.countNumberOfThreads()
self.UTILS.reporting.logResult("info", "Number of threads {} in list.".format(original_count))
self.UTILS.test.test(original_count == 2, "Check how many threads are there")