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


Python Wait.close方法代码示例

本文整理汇总了Python中marionette_driver.Wait.close方法的典型用法代码示例。如果您正苦于以下问题:Python Wait.close方法的具体用法?Python Wait.close怎么用?Python Wait.close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在marionette_driver.Wait的用法示例。


在下文中一共展示了Wait.close方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: download_and_apply_forced_update

# 需要导入模块: from marionette_driver import Wait [as 别名]
# 或者: from marionette_driver.Wait import close [as 别名]
    def download_and_apply_forced_update(self):
        # The update wizard dialog opens automatically after the restart but with a short delay
        dialog = Wait(self.marionette, ignored_exceptions=[NoSuchWindowException]).until(
            lambda _: self.windows.switch_to(lambda win: type(win) is UpdateWizardDialog)
        )

        # In case of a broken complete update the about window has to be used
        if self.updates[self.current_update_index]['patch']['is_complete']:
            about_window = None
            try:
                self.assertEqual(dialog.wizard.selected_panel,
                                 dialog.wizard.error)
                dialog.close()

                # Open the about window and check for updates
                about_window = self.browser.open_about_window()
                update_available = self.check_for_updates(about_window)
                self.assertTrue(update_available,
                                'Available update has been found')

                # Download update and wait until it has been applied
                self.download_update(about_window)
                self.wait_for_update_applied(about_window)

            finally:
                self.updates[self.current_update_index]['patch'] = self.patch_info

            # Restart Firefox to apply the forced update
            self.restart(callback=lambda: about_window.deck.apply.button.click())

        else:
            try:
                self.assertEqual(dialog.wizard.selected_panel,
                                 dialog.wizard.error_patching)

                # Start downloading the fallback update
                self.download_update(dialog)

            finally:
                self.updates[self.current_update_index]['patch'] = self.patch_info

            # Restart Firefox to apply the forced update
            self.restart(callback=lambda: dialog.wizard.finish_button.click())
开发者ID:subsevenx2001,项目名称:gecko-dev,代码行数:45,代码来源:testcases.py


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