Code review comment for lp:~artmello/gallery-app/gallery-app-remove_photo_from_album

Revision history for this message
Chris Gagnon (chris.gagnon) wrote :

This only tests one button of the 3 new buttons. The other 2 buttons should be tested. (make sure on the remove from album and delete test that you verify the file is removed from the file system.)

The one button test you have is pretty solid and would not be a flaky test, but a couple of small changes can make it easier to maintain and troubleshoot.

def get_remove_* should be made private to _get_remove, then consumed by a click_* method. something like click_remove_from_album_button(). You can check the button becoming visible and being not shown as part of the same function

@autopilot_logging.log_action(logger.info) should be used as a method decorator on the click_* method(s) see example:
method http://bazaar.launchpad.net/~elopio/ubuntu-ui-toolkit/intermediate_flickables/revision/976/tests/autopilot/ubuntuuitoolkit/emulators.py

238 + photo = self.album_view.get_first_photo()
239 + self.main_view.close_toolbar()
240 + self.click_item(photo)

This should also be a method click_first_photo() in album_view with the @autopilot_logging.log_action(logger.info) decorator

so you can use self.album_view.click_first_photo() or better self.album_view.click_photo(path or photo name) instead of using 3 lines. That way if the toolbar goes away we won't have to delete a line from alot of tests, just the 1 line.

review: Needs Fixing

« Back to merge proposal