~tpeeters/gallery-app/lean

« back to all changes in this revision

Viewing changes to tests/autopilot/gallery_app/emulators/picker_screen.py

  • Committer: CI bot
  • Author(s): Richard Huddie
  • Date: 2014-05-01 14:37:49 UTC
  • mfrom: (917.1.12 photo_selector)
  • Revision ID: ps-jenkins@lists.canonical.com-20140501143749-lxo8acdohu43czs4
A new emulator method for selecting a specific photo from the picker view. A new test is also added to use this method and then click on the Pick button. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
        grid_view = self.grid_view()
33
33
        return grid_view.select_many("OrganicItemInteraction")[0]
34
34
 
 
35
    def _get_named_photo_element(self, photo_name):
 
36
        """
 
37
        Return the ShapeItem container object for the named photo.
 
38
        This object can be clicked to enable the photo to be selected.
 
39
        """
 
40
        photo_element = self.grid_view().wait_select_single('QQuickImage',
 
41
                                                       source=photo_name)
 
42
        return photo_element.get_parent()
 
43
 
 
44
    def select_named_photo(self, photo_name):
 
45
        """Select the named photo from the picker view."""
 
46
        photo_element = self._get_named_photo_element(photo_name)
 
47
        self.pointing_device.click_object(photo_element)