~cimi/unity8/scope-settings

« back to all changes in this revision

Viewing changes to tests/autopilot/unity8/shell/emulators/main_window.py

  • Committer: Andrea Cimitan
  • Date: 2014-08-07 16:17:06 UTC
  • mfrom: (1109.1.25 unity8)
  • Revision ID: andrea.cimitan@gmail.com-20140807161706-j6ndy7bgz457xn4n
[ Michal Hruby ]
* Work with the scopes-v4 branch + departments->navigation renaming
[ Michał Sawicz ]
* Hardcode art shape size for click scope local and predefined
  categories While at it, drop the fillmode of cards
* Use the correct API in PageHeader. (LP: #1353048)
* Refactor dash activity indicator. (LP: #1351539)
[ Albert Astals ]
* Dash Departments fixes Update maxHeight manually since it depends on
  the position of the item and its parents and it can't know when the
  binding has to be updated Make parent stuff non interactive when the
  department list is shown
* PageHeader: when on search clip y-coordinates otherwise the
  background spills out when on search (LP: #1350398)
* Dash: Implement OverlayColor support in Cards
* Hardcode art shape size for click scope local and predefined
  categories While at it, drop the fillmode of cards
* Make test_departments test more stable There's various
  DashDepartments on the dash, make sure we're working over the one
  that is on screen, otherwise clicks don't end up where they should
* Work with the scopes-v4 branch + departments->navigation renaming
* Fixes for dash as app Load i18n catalog Process command line options
  Add the posibility to have a mouse touch adaptor (LP: #1353351)
* Implement the Expandable Preview Widget Now TextSummary is not
  expandable by itself anymore, you have to use it inside an
  Expandable to get the behaviour
* Add test prefix to xml output, seems CI needs it
[ Antti Kaijanmäki ]
* Indicators: Adds new ModemInfoItem to be used with indicator-network
  (LP: #1329204)
[ Michael Terry ]
* When the edge demo is running, don't show the greeter if the screen
  is turned off. This avoids an odd interaction where parts of the
  greeter are disabled but the edge demo isn't visible until you slide
  the greeter away. (LP: #1283425)
* Don't hardcode the phablet password in our testing script.
[ Ying-Chun Liu ]
* Add divider dots.
[ Mirco Müller ]
* Make sure the TextField of a snap-decision notification has the
  active focus upon creation, thus the osk shows up right away. (LP:
  #1346867)
[ Andrea Cimitan ]
* Add touchdown effect to dash cards.
* Import Ubuntu.Components for preview image gallery to pick up
  default flicking speeds.
[ Michael Zanetti ]
* Split the dash from the shell into a separate app (LP: #1232687)
[ Leo Arias ]
* Update the autopilot tests to work with the new dash app.
[ Daniel d'Andrada ]
* Split the dash from the shell into a separate app (LP: #1232687)

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
from unity8.shell import emulators
26
26
from unity8.shell.emulators.greeter import Greeter
27
27
from unity8.shell.emulators.hud import Hud
28
 
from unity8.shell.emulators.dash import Dash
29
28
from unity8.shell.emulators.launcher import Launcher
30
29
 
31
30
logger = logging.getLogger(__name__)
61
60
    def get_hud_edge_drag_area(self):
62
61
        return self.select_single(objectName="hudDragArea")
63
62
 
64
 
    def get_dash(self):
65
 
        return self.select_single(Dash)
66
 
 
67
63
    def get_bottombar(self):
68
64
        return self.select_single("Bottombar")
69
65
 
76
72
            objectName="pinPadLoader"
77
73
        )
78
74
 
79
 
    def get_pinPadButton(self, buttonId):
80
 
        return self.select_single(
81
 
            "PinPadButton",
82
 
            objectName="pinPadButton%i" % buttonId
83
 
        )
84
 
 
85
75
    def get_lockscreen(self):
86
76
        return self.select_single("Lockscreen")
87
77
 
117
107
    @autopilot_logging.log_action(logger.info)
118
108
    def show_dash_swiping(self):
119
109
        """Show the dash swiping from the left."""
120
 
        width = self.width
121
 
        height = self.height
122
 
        start_x = 0
123
 
        start_y = height // 2
124
 
        end_x = width
125
 
        end_y = start_y
 
110
        x, y, width, height = self._get_shell().globalRect
 
111
        start_x = x
 
112
        end_x = x + width
 
113
        start_y = end_y = y + height // 2
126
114
 
127
115
        self.pointing_device.drag(start_x, start_y, end_x, end_y)
128
 
        return self.get_dash()
 
116
 
 
117
    def _get_shell(self):
 
118
        return self.select_single('Shell')
129
119
 
130
120
    def get_current_focused_app_id(self):
131
121
        """Return the id of the focused application."""
132
 
        return self.select_single('Shell').focusedApplicationId
 
122
        return self._get_shell().focusedApplicationId
133
123
 
134
124
    @autopilot_logging.log_action(logger.info)
135
 
    def search(self, query):
136
 
        self.get_dash().enter_search_query(query)
 
125
    def enter_pin_code(self, code):
 
126
        """Enter code 'code' into the single-pin lightdm pincode entry screen.
 
127
 
 
128
        :param code: must be a string of numeric characters.
 
129
        :raises: TypeError if code is not a string.
 
130
        :raises: ValueError if code contains non-numeric characters.
 
131
 
 
132
        """
 
133
        if not isinstance(code, str):
 
134
            raise TypeError(
 
135
                "'code' parameter must be a string, not %r."
 
136
                % type(code)
 
137
            )
 
138
        for num in code:
 
139
            if not num.isdigit():
 
140
                raise ValueError(
 
141
                    "'code' parameter contains non-numeric characters."
 
142
                )
 
143
            self.pointing_device.click_object(
 
144
                self._get_pinpad_button(int(num)))
 
145
 
 
146
    def _get_pinpad_button(self, button_id):
 
147
        return self.select_single(
 
148
            'PinPadButton',
 
149
            objectName='pinPadButton{}'.format(button_id)
 
150
        )