| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 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) |