32
32
grid_view = self.grid_view()
33
33
return grid_view.select_many("OrganicItemInteraction")[0]
35
def go_to_photos(self):
37
Switch to the photos tab on picker screen
38
Return the Page object representing the photos
40
self.switch_to_tab('photosTab')
41
return self.select_single(Page10, objectName='photosPage')
43
def click_pick_button(self):
44
"""Click on the pick button"""
45
self.pointing_device.click_object(self.pick_button())
47
def select_photo(self, photo_name):
48
"""Go to the photos view and pick the named photo"""
49
photos_page = self.go_to_photos()
50
photos_page.click_named_photo(photo_name)
51
self.click_pick_button()
54
class Page10(PickerScreen):
55
"""Class to represent photos page view from picker screen"""
35
57
def _get_named_photo_element(self, photo_name):
37
59
Return the ShapeItem container object for the named photo.
38
60
This object can be clicked to enable the photo to be selected.
40
photo_element = self.grid_view().wait_select_single('QQuickImage',
62
photo_element = self.grid_view().wait_select_single(
63
'QQuickImage', source=photo_name)
42
64
return photo_element.get_parent()
44
def select_named_photo(self, photo_name):
66
def click_named_photo(self, photo_name):
45
67
"""Select the named photo from the picker view."""
46
68
photo_element = self._get_named_photo_element(photo_name)
47
69
self.pointing_device.click_object(photo_element)