Debian Codegraph @

tests/autopilot/lomiri_gallery_app/emulators/photos_view.py

raw symbols SCIP
1 # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2 # Copyright 2012 Canonical Ltd.
3 #
4 # This program is free software: you can redistribute it and/or modify it
5 # under the terms of the GNU General Public License version 3, as published
6 # by the Free Software Foundation.
7
8 from lomiri_gallery_app.emulators.gallery_utils import GalleryUtils
9
10
11 class PhotosView(GalleryUtils):
12
13 def __init__(self, app):
14 self.app = app
15
16 def get_photo_in_photos_view_by_index(self, index):
17 """Returns the photo with index in the photos view."""
18 return self.select_many_retry(
19 "QQuickItem",
20 objectName="allPotosGridPhoto")[index]
21
22 def get_first_photo_in_photos_view(self):
23 """Returns the very first photo in the photos view."""
24 return self.get_photo_in_photos_view_by_index(0)
25
26 def number_of_photos(self):
27 """Returns the number of events"""
28 photo_delegates = self.app.select_many("QQuickItem",
29 objectName="allPotosGridPhoto")
30 return len(photo_delegates)
31
32 def get_share_peer_picker(self):
33 """Returns the photo viewer share picker."""
34 return self.app.wait_select_single(objectName="sharePickerPhotos",
35 visible=True)