@@ -159,7 +159,7 @@ class GenericScopeView(emulators.UnityEmulatorBase):
159159 def _get_category_element(self, category):
160160 try:
161161 return self.wait_select_single(
162− 'Base', objectName='dashCategory{}'.format(category))
162+ 'Base', objectName='dashSectionHeader{}'.format(category))
163163 except dbus.StateNotFoundError:
164164 raise emulators.UnityEmulatorException(
165165 'No category found with name {}'.format(category))
@@ -176,10 +176,14 @@ class DashApps(GenericScopeView):
176176 """
177177 category_element = self._get_category_element(category)
178178 application_tiles = category_element.select_many('Card')
179− # TODO return them on the same order they are displayed.
180− # --elopio - 2014-1-15
181179 result = []
182180 for card in application_tiles:
183181 if card.objectName != 'cardToolCard':
184182 result.append(card)
185− return result
183+
184+ def visible_order(card):
185+ """Enable sorting of cards by vertical, horizontal."""
186+ # NOTE that we limit testable resolution to 10K
187+ return card.globalRect[1] * 10000 + card.globalRect[0]
188+
189+ return sorted(result, key=visible_order)