Merge lp:~rhuddie/gallery-app/photo_selector into lp:gallery-app

Proposed by Richard Huddie
Status: Merged
Merged at revision: 958
Proposed branch: lp:~rhuddie/gallery-app/photo_selector
Merge into: lp:gallery-app
Diff against target: 45 lines (+27/-0)
2 files modified
tests/autopilot/gallery_app/emulators/picker_screen.py (+13/-0)
tests/autopilot/gallery_app/tests/test_picker_mode.py (+14/-0)
To merge this branch: bzr merge lp:~rhuddie/gallery-app/photo_selector
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Arthur Mello (community) Approve
Leo Arias (community) code review Approve
VĂ­ctor R. Ruiz Pending
Javier Collado Pending
Review via email: mp+208761@code.launchpad.net

Commit message

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.

Description of the change

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.

To post a comment you must log in.
Revision history for this message
Leo Arias (elopio) wrote :

Please:
- change the double quotes on strings to single quotes.
- change "Returns" to "Return", and finish your sentences with a period as per pep257.
- add information about the return type on get_named_photo

And I've seen one more detail that will help hiding the implementation details a little, which might be usefule in case of an implementation detail.

Make get_named_photo private, naming it something like _get_named_photo_element()

And make a new public method

def select_photo(self, name):
   photo_element = self.picker_view.get_named_photo(
      'image://gallery-thumbnail//tmp/gallery-ap_sd/new_user.png')
   self.pointing_device.click_object(photo)

review: Needs Fixing (code review)
922. By Richard Huddie

fix review comments

Revision history for this message
Leo Arias (elopio) :
review: Approve (code review)
923. By Richard Huddie

merge from trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
924. By Richard Huddie

update image path to use thumbnailer

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
925. By Richard Huddie

renamed test data file

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
926. By Richard Huddie

changed test to use existing sample file

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
927. By Richard Huddie

use wait_select_single for selecting QQuickImage item

928. By Richard Huddie

merge from trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
929. By Richard Huddie

creat file path based on sample dir

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Arthur Mello (artmello) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Richard Huddie (rhuddie) wrote :

Are there any related MPs required for this MP to build/function as expected? Please list
No

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?
Yes - mako

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/gallery-app) on device or emulator?
Yes - mako

If you changed the UI, was the change specified/approved by design?
No UI changes. - Test code changes only

If you changed the packaging (debian), did you subscribe a core-dev to this MP?
No packaging changes.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/gallery_app/emulators/picker_screen.py'
--- tests/autopilot/gallery_app/emulators/picker_screen.py 2013-08-19 13:58:55 +0000
+++ tests/autopilot/gallery_app/emulators/picker_screen.py 2014-04-09 10:34:08 +0000
@@ -32,3 +32,16 @@
32 grid_view = self.grid_view()32 grid_view = self.grid_view()
33 return grid_view.select_many("OrganicItemInteraction")[0]33 return grid_view.select_many("OrganicItemInteraction")[0]
3434
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)
3548
=== modified file 'tests/autopilot/gallery_app/tests/test_picker_mode.py'
--- tests/autopilot/gallery_app/tests/test_picker_mode.py 2014-04-08 16:47:21 +0000
+++ tests/autopilot/gallery_app/tests/test_picker_mode.py 2014-04-09 10:34:08 +0000
@@ -55,6 +55,20 @@
55 self.assertThat(pick_button.enabled, Eventually(Equals(False)))55 self.assertThat(pick_button.enabled, Eventually(Equals(False)))
56 self.assertThat(first_events_media.isSelected, Eventually(Equals(False)))56 self.assertThat(first_events_media.isSelected, Eventually(Equals(False)))
5757
58 def test_pick_named_photo(self):
59 """Select a named photo and press Pick button."""
60 self.picker_view.switch_to_tab('photosTab')
61 pick_button = self.picker_view.pick_button()
62 self.assertFalse(pick_button.enabled)
63
64 # create the image location path based on sample location
65 image_path = 'image://thumbnailer/{}/sample02.jpg'.format(
66 self.sample_destination_dir)
67 self.picker_view.select_named_photo(image_path)
68
69 self.assertTrue(pick_button.enabled)
70 self.click_item(pick_button)
71
58 @unittest.skip("Temporarily disable as it fails in some cases, supposedly due to problems with the infrastructure")72 @unittest.skip("Temporarily disable as it fails in some cases, supposedly due to problems with the infrastructure")
59 def test_selection_synchronisation(self):73 def test_selection_synchronisation(self):
60 """Checks if the selection is the same for both views"""74 """Checks if the selection is the same for both views"""

Subscribers

People subscribed via source and target branches