本文整理汇总了Python中gaiatest.apps.gallery.app.Gallery.app方法的典型用法代码示例。如果您正苦于以下问题:Python Gallery.app方法的具体用法?Python Gallery.app怎么用?Python Gallery.app使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gaiatest.apps.gallery.app.Gallery
的用法示例。
在下文中一共展示了Gallery.app方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: prepare_app
# 需要导入模块: from gaiatest.apps.gallery.app import Gallery [as 别名]
# 或者: from gaiatest.apps.gallery.app.Gallery import app [as 别名]
def prepare_app(self):
picture_count = 100
self.device.b2gpopulate.populate_pictures(picture_count)
# launch the gallery app and wait for the thumbnails to be displayed,
# the first launch after populating the data takes a long time.
gallery = Gallery(self.device.marionette)
gallery.app = self.device.gaiaApps.launch('Gallery')
time.sleep(5)
timeout = 200
starttime = time.time()
while (time.time() - starttime) < timeout:
try:
items = self.device.marionette.find_elements(
*gallery._gallery_items_locator)
progress = self.device.marionette.find_element(
*gallery._progress_bar_locator)
if len(items) == picture_count and not progress.is_displayed():
break
except (NoSuchElementException, StaleElementException):
pass
time.sleep(0.5)
else:
raise TimeoutException('Gallery items not displayed')
self.device.gaiaApps.kill(gallery.app)