Merge lp://qastaging/~vrruiz/gallery-app/autopilot-app-class into lp://qastaging/gallery-app

Proposed by Víctor R. Ruiz
Status: Needs review
Proposed branch: lp://qastaging/~vrruiz/gallery-app/autopilot-app-class
Merge into: lp://qastaging/gallery-app
Diff against target: 2084 lines (+720/-698)
9 files modified
tests/autopilot/gallery_app/__init__.py (+415/-0)
tests/autopilot/gallery_app/tests/__init__.py (+6/-280)
tests/autopilot/gallery_app/tests/test_album_editor.py (+34/-54)
tests/autopilot/gallery_app/tests/test_album_view.py (+55/-56)
tests/autopilot/gallery_app/tests/test_albums_view.py (+11/-19)
tests/autopilot/gallery_app/tests/test_events_view.py (+41/-53)
tests/autopilot/gallery_app/tests/test_photo_viewer.py (+102/-156)
tests/autopilot/gallery_app/tests/test_photos_view.py (+35/-48)
tests/autopilot/gallery_app/tests/test_picker_mode.py (+21/-32)
To merge this branch: bzr merge lp://qastaging/~vrruiz/gallery-app/autopilot-app-class
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Leo Arias (community) Needs Fixing
Review via email: mp+222667@code.qastaging.launchpad.net

Commit message

Create a class to drive the UI, and refactor test cases to use it.

Description of the change

Create a class to drive the UI, and refactor test cases to use it.

To post a comment you must log in.
Revision history for this message
Víctor R. Ruiz (vrruiz) wrote :

One thing to think about: the UI-driver methods were moved from the case classes to GalleryApp. The problem is that some of them use asserts, that make sense as part of tests, but not so much a pure UI test. Right now, it's not a big deal, because the test_case is a required argument to instantiate GalleryApp, but in the medium term, we won't have it.

Revision history for this message
Víctor R. Ruiz (vrruiz) wrote :

Another comment. The code is a not as elegant as it could be: lots of direct calls to the UI in the test cases. They probably can be refactored, but that wasn't the target of the present changes.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Leo Arias (elopio) wrote :

> One thing to think about: the UI-driver methods were moved from the case
> classes to GalleryApp. The problem is that some of them use asserts, that make
> sense as part of tests, but not so much a pure UI test. Right now, it's not a
> big deal, because the test_case is a required argument to instantiate
> GalleryApp, but in the medium term, we won't have it.

I think that's just what we want, move the assertions out of the helpers and into the tests.
Many assertions can be replaced by wait_for.

Revision history for this message
Leo Arias (elopio) wrote :

Victor, I'm sorry it took so long to make this review. You will likely have to merge with trunk now.
I'll try harder to make the reviews the same day. But next time I won't make soon a review you request please keep pinging me. I'll owe you a beer for every day you wait :)

For the gallery and apps developers: this change seeks to make it easier for us to test multiple applications at the same time. On its own, it just seems like a huge branch not really useful, and now you will have to call something like self.app.main_view instead of just self.main_view. But it makes a lot of sense when you see a test like this:

address_book = AddressBook.launch()
add_contact_page = address_book.main_view.go_to_add_contact()
add_contact_page.click_contact_image()
gallery_app = GalleryApp()
gallery_app.main_view.pick_image(...)
add_contact_page.main_view.fill_form(...)
add_contact_page.save()

For that we need to move the app helpers out of the test cases because there's no nice way to make a test case that inherits from both the base test cases in address book and gallery.

review: Needs Fixing
Revision history for this message
Leo Arias (elopio) wrote :

Sorry, about the comment:
This empty line is not needed.

I mean, the line between

from pkg_resources import resource_filename

and

from ubuntuuitoolkit import emulators as toolkit_emulators.

999. By Víctor R. Ruiz

Merge with trunk

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

Unmerged revisions

999. By Víctor R. Ruiz

Merge with trunk

998. By Víctor R. Ruiz

Autopilot: Refactor for app class pattern (test_picker_mode)

997. By Víctor R. Ruiz

Autopilot: Refactor for app class pattern (test_photos_view)

996. By Víctor R. Ruiz

Autopilot: Refactor for app class pattern (test_photo_viewer)

995. By Víctor R. Ruiz

Autopilot: Refactor for app class pattern (test_events_view)

994. By Víctor R. Ruiz

Autopilot: Refactor for app class pattern (test_album_view)

993. By Víctor R. Ruiz

Autopilot: Refactor for app class pattern (test_albums_view)

992. By Víctor R. Ruiz

Autopilot: Refactor for app class pattern (test_albums_view)

991. By Víctor R. Ruiz

Autopilot: Refactor for app class pattern (test_album_editor)

990. By Víctor R. Ruiz

Autopilot: Refactoring for app class pattern

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches