Merge lp:~om26er/gallery-app/add_test_for_auto_enhance into lp:gallery-app

Proposed by Omer Akram
Status: Merged
Approved by: Omer Akram
Approved revision: 735
Merged at revision: 746
Proposed branch: lp:~om26er/gallery-app/add_test_for_auto_enhance
Merge into: lp:gallery-app
Diff against target: 110 lines (+32/-3)
4 files modified
src/photo/photo.cpp (+1/-1)
tests/autopilot/gallery_app/emulators/photo_viewer.py (+4/-0)
tests/autopilot/gallery_app/tests/__init__.py (+1/-1)
tests/autopilot/gallery_app/tests/test_photo_viewer.py (+26/-1)
To merge this branch: bzr merge lp:~om26er/gallery-app/add_test_for_auto_enhance
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Günter Schwann (community) Approve
Review via email: mp+170054@code.launchpad.net

Commit message

Add autopilot test for the auto-enhance feature in the edit dialog. Also add a test to make sure that deleting the last photo in the gallery take you back to the main view

Description of the change

Add autopilot test for the auto-enhance feature in the edit dialog. Also add a test to make sure that deleting the last photo in the gallery take you back to the main view, this test fails as the bug needs to be fixed.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Günter Schwann (schwann) wrote :

once the fix is merged, it's fine

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (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)
735. By Omer Akram

fix failing tests

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 'src/photo/photo.cpp'
--- src/photo/photo.cpp 2013-06-17 12:57:21 +0000
+++ src/photo/photo.cpp 2013-06-24 11:17:26 +0000
@@ -802,7 +802,7 @@
802 QImage enhanced_image(width, height, dest_format);802 QImage enhanced_image(width, height, dest_format);
803803
804 for (int j = 0; j < height; j++) {804 for (int j = 0; j < height; j++) {
805 QApplication::processEvents();805 //QApplication::processEvents();
806 for (int i = 0; i < width; i++) {806 for (int i = 0; i < width; i++) {
807 QColor px = enhance_txn.transformPixel(807 QColor px = enhance_txn.transformPixel(
808 QColor(unenhanced_img.pixel(i, j)));808 QColor(unenhanced_img.pixel(i, j)));
809809
=== modified file 'tests/autopilot/gallery_app/emulators/photo_viewer.py'
--- tests/autopilot/gallery_app/emulators/photo_viewer.py 2013-06-18 13:22:53 +0000
+++ tests/autopilot/gallery_app/emulators/photo_viewer.py 2013-06-24 11:17:26 +0000
@@ -70,6 +70,10 @@
70 """Returns the revert to original menu item in the edit dialog."""70 """Returns the revert to original menu item in the edit dialog."""
71 return self.app.select_single("Standard", objectName="revertListItem")71 return self.app.select_single("Standard", objectName="revertListItem")
7272
73 def get_auto_enhance_menu_item(self):
74 """Returns the 'auto enhance' menu item in the edit dialog."""
75 return self.app.select_single("Standard", objectName='enhanceListItem')
76
73 def get_delete_popover_delete_item(self):77 def get_delete_popover_delete_item(self):
74 """Returns the delete button of the delete popover."""78 """Returns the delete button of the delete popover."""
75 return self.app.select_single("Button",79 return self.app.select_single("Button",
7680
=== modified file 'tests/autopilot/gallery_app/tests/__init__.py'
--- tests/autopilot/gallery_app/tests/__init__.py 2013-06-18 07:56:00 +0000
+++ tests/autopilot/gallery_app/tests/__init__.py 2013-06-24 11:17:26 +0000
@@ -162,7 +162,7 @@
162162
163 self.pointing_device.drag(tx, ty, tx / 8, ty)163 self.pointing_device.drag(tx, ty, tx / 8, ty)
164 else:164 else:
165 self.click_item(tabs_bar)165 self.click_item(tabs_bar, delay=0.5)
166166
167 albums_tab_button = self.gallery_utils.get_albums_tab_button()167 albums_tab_button = self.gallery_utils.get_albums_tab_button()
168 # Due to some timing issues sometimes mouse moves to the location a bit168 # Due to some timing issues sometimes mouse moves to the location a bit
169169
=== modified file 'tests/autopilot/gallery_app/tests/test_photo_viewer.py'
--- tests/autopilot/gallery_app/tests/test_photo_viewer.py 2013-06-19 15:47:39 +0000
+++ tests/autopilot/gallery_app/tests/test_photo_viewer.py 2013-06-24 11:17:26 +0000
@@ -62,6 +62,7 @@
62 def test_photo_delete_works(self):62 def test_photo_delete_works(self):
63 """Clicking the trash button must show the delete dialog."""63 """Clicking the trash button must show the delete dialog."""
64 trash_button = self.photo_viewer.get_toolbar_delete_button()64 trash_button = self.photo_viewer.get_toolbar_delete_button()
65 photo_viewer = self.photo_viewer.get_main_photo_viewer()
6566
66 self.pointing_device.move_to_object(trash_button)67 self.pointing_device.move_to_object(trash_button)
67 self.pointing_device.click()68 self.pointing_device.click()
@@ -89,6 +90,17 @@
89 self.assertThat(lambda: exists(self.sample_file),90 self.assertThat(lambda: exists(self.sample_file),
90 Eventually(Equals(False)))91 Eventually(Equals(False)))
9192
93 self.reveal_toolbar()
94 self.pointing_device.click_object(trash_button)
95
96 delete_dialog = self.photo_viewer.get_delete_dialog()
97 self.assertThat(delete_dialog.visible, Eventually(Equals(True)))
98
99 delete_item = self.photo_viewer.get_delete_popover_delete_item()
100 self.click_item(delete_item)
101
102 self.assertThat(photo_viewer.visible, Eventually(Equals(False)))
103
92 # def test_nav_bar_album_picker_button(self):104 # def test_nav_bar_album_picker_button(self):
93 # """Clicking the album picker must show the picker dialog."""105 # """Clicking the album picker must show the picker dialog."""
94 # album_button = self.photo_viewer.get_toolbar_album_button()106 # album_button = self.photo_viewer.get_toolbar_album_button()
@@ -165,6 +177,10 @@
165 revert_item = self.photo_viewer.get_revert_menu_item()177 revert_item = self.photo_viewer.get_revert_menu_item()
166 self.click_item(revert_item)178 self.click_item(revert_item)
167179
180 def click_enhance_item(self):
181 enhance_item = self.photo_viewer.get_auto_enhance_menu_item()
182 self.click_item(enhance_item)
183
168 def test_photo_editor_crop(self):184 def test_photo_editor_crop(self):
169 """Cropping a photo must crop it."""185 """Cropping a photo must crop it."""
170 old_file_size = os.path.getsize(self.sample_file)186 old_file_size = os.path.getsize(self.sample_file)
@@ -176,6 +192,7 @@
176 self.click_crop_item()192 self.click_crop_item()
177193
178 self.assertThat(crop_box.state, Eventually(Equals("shown")))194 self.assertThat(crop_box.state, Eventually(Equals("shown")))
195 self.assertThat(crop_box.opacity, Eventually(Equals(1)))
179196
180 crop_corner = self.photo_viewer.get_top_left_crop_corner()197 crop_corner = self.photo_viewer.get_top_left_crop_corner()
181 x, y, h, w = crop_corner.globalRect198 x, y, h, w = crop_corner.globalRect
@@ -254,7 +271,7 @@
254 # implemented properly271 # implemented properly
255 sleep(1)272 sleep(1)
256273
257 def test_photo_editor_redo_undo_revert_to_original_states(self):274 def test_photo_editor_redo_undo_revert_enhance_states(self):
258 undo_item = self.photo_viewer.get_undo_menu_item()275 undo_item = self.photo_viewer.get_undo_menu_item()
259 redo_item = self.photo_viewer.get_redo_menu_item()276 redo_item = self.photo_viewer.get_redo_menu_item()
260 revert_item = self.photo_viewer.get_revert_menu_item()277 revert_item = self.photo_viewer.get_revert_menu_item()
@@ -310,3 +327,11 @@
310 self.assertThat(undo_item.enabled, Eventually(Equals(True)))327 self.assertThat(undo_item.enabled, Eventually(Equals(True)))
311 self.assertThat(redo_item.enabled, Eventually(Equals(False)))328 self.assertThat(redo_item.enabled, Eventually(Equals(False)))
312 self.assertThat(revert_item.enabled, Eventually(Equals(False)))329 self.assertThat(revert_item.enabled, Eventually(Equals(False)))
330
331 self.click_enhance_item()
332
333 self.reveal_toolbar()
334 self.click_edit_button()
335
336 revert_item = self.photo_viewer.get_revert_menu_item()
337 self.assertThat(lambda: revert_item.enabled, Eventually(Equals(True)))

Subscribers

People subscribed via source and target branches