当前位置: 首页>>代码示例>>Python>>正文


Python Messages.wait_for_message_list方法代码示例

本文整理汇总了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
开发者ID:AkshayTiwari,项目名称:gaia,代码行数:9,代码来源:message_thread.py

示例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
开发者ID:DouglasSherk,项目名称:gaia,代码行数:11,代码来源:message_thread.py

示例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
开发者ID:alison-shiue,项目名称:MTBF-Driver,代码行数:59,代码来源:test_1022755.py


注:本文中的gaiatest.apps.messages.app.Messages.wait_for_message_list方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。