on xenial help sign in
Fix dash emulators.
f2fff70Michał Sawicz
tests/autopilot/unity8/shell/emulators/dash.py+5−2
@@ -196,9 +196,12 @@ class DashApps(GenericScopeView):
196 category_element = self._get_category_element(category)
196 category_element = self._get_category_element(category)
197 application_cards = category_element.select_many('AbstractButton')
197 application_cards = category_element.select_many('AbstractButton')
198
198
199− # sort by y, x
199+ # sort by y, x, filter those out of view
200+ categoryBottom = category_element.globalRect.y \
201+ + category_element.height
200 application_cards = sorted(
202 application_cards = sorted(
201− application_cards,
203+ (card for card in application_cards
204+ if card.globalRect.y < categoryBottom),
202 key=lambda card: (card.globalRect.y, card.globalRect.x))
205 key=lambda card: (card.globalRect.y, card.globalRect.x))
203
206
204 result = []
207 result = []
tests/autopilot/unity8/shell/tests/test_emulators.py+5−5
@@ -191,9 +191,9 @@ class DashAppsEmulatorTestCase(DashBaseTestCase):
191 def _get_number_of_application_slots(self, category):
191 def _get_number_of_application_slots(self, category):
192 category_element = self.applications_scope._get_category_element(
192 category_element = self.applications_scope._get_category_element(
193 category)
193 category)
194− grid = category_element.select_single('CardFilterGrid')
194+ cardgrid = category_element.select_single('CardGrid')
195− filtergrid = grid.select_single('FilterGrid')
195+ if (category_element.expanded):
196− if (grid.filtered):
196+ return cardgrid.select_single('QQuickGridView').count
197− return filtergrid.collapsedRowCount * filtergrid.columns
198 else:
197 else:
199− return filtergrid.uncollapsedRowCount * filtergrid.columns
198+ return cardgrid.collapsedRows \
199+ * cardgrid.select_single('ResponsiveGridView').columns