| 1 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
| 2 |
# Copyright 2013, 2014 Canonical Ltd. |
| 3 |
# |
| 4 |
# This program is free software: you can redistribute it and/or modify it |
| 5 |
# under the terms of the GNU General Public License version 3, as published |
| 6 |
# by the Free Software Foundation. |
| 7 |
|
| 8 |
import lomiriuitoolkit |
| 9 |
|
| 10 |
|
| 11 |
class MainScreen(lomiriuitoolkit.MainView): |
| 12 |
"""An emulator class that makes it easy to interact with the gallery app""" |
| 13 |
|
| 14 |
def get_header(self): |
| 15 |
"""Return the Header emulator of the MainView.""" |
| 16 |
return self.select_single(AppHeader, objectName='MainView_Header') |
| 17 |
|
| 18 |
|
| 19 |
class AppHeader(lomiriuitoolkit.Header): |
| 20 |
"""Header Autopilot helper. |
| 21 |
|
| 22 |
We override this helper because on the gallery the gesture to show the |
| 23 |
header when it's hidden it's not the default. |
| 24 |
|
| 25 |
""" |
| 26 |
|
| 27 |
# XXX We are overriding internal methods that may change on the toolkit. |
| 28 |
# The helper on the toolkit needs a public method that will be safe to |
| 29 |
# override. Reported as bug http://pad.lv/1363591 --elopio - 2014-31-08 |
| 30 |
|
| 31 |
def _is_visible(self): |
| 32 |
return self.visible |
| 33 |
|
| 34 |
def _show(self): |
| 35 |
self.pointing_device.click_object(self._get_top_container()) |
| 36 |
self.visible.wait_for(True) |