GalleryUtils already has a pointing_device attribute. You should just call the super __init__()
I would actually prefer not to inherit from something like GalleryUtils, but from an autopilot introspection object, but that probably should be in a later refactor.
35 + def _swipe_setup(self):
Here I don't like that you are adding attributes to the object on a method that's not __init__.
I think it could be clearer something like this:
I would prefer if this inherits from a general GalleryAppException. Then you could ignore all the GalleryAppExceptions in some cases.
119 def number_of_photos_in_events(self):
[...]
123 + """Return the number of events"""
I think that docstring is wrong.
514 + def media_view(self):
If you do this as a property, then every time you call it the select_single will be executed. Is there a reason for not doing this on the __init__ like:
I don't like it being part of a utils module. There's probably a helper for dialogs on the toolkit, and we should return the dialog object from the method that opens it.
Anyway, thanks a lot for this. It's now a lot more understandable.
22 + self.pointing_ device = ubuntuuitoolkit .emulators. get_pointing_ device( )
GalleryUtils already has a pointing_device attribute. You should just call the super __init__()
I would actually prefer not to inherit from something like GalleryUtils, but from an autopilot introspection object, but that probably should be in a later refactor.
35 + def _swipe_setup(self):
Here I don't like that you are adding attributes to the object on a method that's not __init__.
I think it could be clearer something like this:
def swipe_page_ left(self, page_number): _swipe_ page(page_ number, 'left')
self.
def _swipe_page(self, page_number, direction): album_view( ) spread_ view() animationRunnin g.wait_ for(False)
album = self.get_
spread = self.get_
album.
spread_center_x = spread.globalRect.x + spread.globalRect.w // 2
spread_center_y = spread.globalRect.y + spread.globalRect.h // 2
start_x = spread.globalRect.x
start_y = stop_y = spread_center_y
if direction == 'left':
expected_ page_matcher = LessThan
expected_ page_matcher = GreatherThan
stop_x = spread_center_x
elif direction == 'right':
stop_x = spread.globalRect.x
else:
raise Something.
self. pointing_ device. drag(
start_x, start_y, stop_x, stop_y)
album. animationRunnin g.wait_ for(False) viewingPage. wait_for( expected_ page_matcher( page_number) )
spread.
88 +class EventsViewExcep tion(Exception) :
I would prefer if this inherits from a general GalleryAppExcep tion. Then you could ignore all the GalleryAppExcep tions in some cases.
119 def number_ of_photos_ in_events( self):
[...]
123 + """Return the number of events"""
I think that docstring is wrong.
514 + def media_view(self):
If you do this as a property, then every time you call it the select_single will be executed. Is there a reason for not doing this on the __init__ like:
self.media_view = self.app. select_ single( MediaViewer)
?
In general, this is a big step forward, so +1. I still don't like some things, but they don't come from before your branch.
Like this:
203 + def click_delete_ dialog_ cancel_ button( self):
I don't like it being part of a utils module. There's probably a helper for dialogs on the toolkit, and we should return the dialog object from the method that opens it.
Anyway, thanks a lot for this. It's now a lot more understandable.