本文整理汇总了Python中gaiatest.apps.messages.app.Messages.wait_for_message_list方法的典型用法代码示例。如果您正苦于以下问题:Python Messages.wait_for_message_list方法的具体用法?Python Messages.wait_for_message_list怎么用?Python Messages.wait_for_message_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gaiatest.apps.messages.app.Messages
的用法示例。
在下文中一共展示了Messages.wait_for_message_list方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: tap_back_button
# 需要导入模块: from gaiatest.apps.messages.app import Messages [as 别名]
# 或者: from gaiatest.apps.messages.app.Messages import wait_for_message_list [as 别名]
def tap_back_button(self):
# In a message thread, tap the back button to return to main message list
back_header_button = self.marionette.find_element(*self._back_header_link_locator)
back_header_button.tap()
messages = Messages(self.marionette)
messages.wait_for_message_list()
return messages
示例2: tap_back_button
# 需要导入模块: from gaiatest.apps.messages.app import Messages [as 别名]
# 或者: from gaiatest.apps.messages.app.Messages import wait_for_message_list [as 别名]
def tap_back_button(self):
# In a message thread, tap the back button to return to main message list
# TODO: remove tap with coordinates after Bug 1061698 is fixed
self.marionette.find_element(*self._header_link_locator).tap(25, 25)
messages = Messages(self.marionette)
messages.wait_for_message_list()
return messages
示例3: TestSms
# 需要导入模块: from gaiatest.apps.messages.app import Messages [as 别名]
# 或者: from gaiatest.apps.messages.app.Messages import wait_for_message_list [as 别名]
class TestSms(GaiaMtbfTestCase):
def test_sms_send(self):
"""This test sends a text message to itself. It waits for a reply message.
https://moztrap.mozilla.org/manage/case/1322/
"""
self._text_message_content = "Automated Test %s" % str(time.time())
self._last_message = ".message-list li"
self._unread = "#threads-container li"
# launch the app
self.launch_by_touch("sms")
self.apps.switch_to_displayed_app()
self.messages = Messages(self.marionette)
self.messages.wait_for_message_list()
# 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(self._text_message_content)
#click send
self.message_thread = new_message.tap_send()
self.message_thread.tap_back_button()
last_thread = self.marionette.find_element(By.CSS_SELECTOR, self._unread)
self.wait_for_condition(self.wait_for_unread_thread, 23)
def tearDown(self):
if hasattr(self, "message_thread"):
self.apps.switch_to_displayed_app()
self.message_thread.tap_back_button()
GaiaMtbfTestCase.tearDown(self)
def wait_for_unread_thread(self, m):
self.apps.switch_to_displayed_app()
threads = m.find_elements(By.CSS_SELECTOR, self._unread)
last_thread = threads[0]
if "unread" in last_thread.get_attribute("class"):
last_thread.tap()
self.wait_for_element_displayed(*self.message_thread._all_messages_locator)
messages = (m.find_elements(By.CSS_SELECTOR, self._last_message))
last_message = messages[-1]
if self._text_message_content in last_message.text:
return True
return False
def wait_for_last_message(self, m):
self.apps.switch_to_displayed_app()
messages = m.find_elements(By.CSS_SELECTOR, self._last_message)
if len(messages) < 2:
return False
last_message = messages[-1]
if "incoming" in last_message.get_attribute("class") and self._text_message_content in last_message.find_element(By.CSS_SELECTOR, ".bubble p").text:
return True
return False