@@ -16,6 +16,7 @@
16# You should have received a copy of the GNU General Public License
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
19+from unity8.shell.emulators.dash import ListViewWithPageHeader
20"""Tests for the Dash autopilot emulators.
21"""Tests for the Dash autopilot emulators.
@@ -182,9 +183,18 @@ class DashAppsEmulatorTestCase(DashBaseTestCase):
183 def test_get_applications_should_return_correct_applications(self):
184 def test_get_applications_should_return_correct_applications(self):
184 category = '2'
185 category = '2'
186+ category_element = self.applications_scope._get_category_element(
188+ list_view = self.dash.get_scope('clickscope')\
189+ .select_single(ListViewWithPageHeader)
185 expected_apps_count = self._get_number_of_application_slots(category)
190 expected_apps_count = self._get_number_of_application_slots(category)
186 expected_applications = self.available_applications[
191 expected_applications = self.available_applications[
187 :expected_apps_count]
192 :expected_apps_count]
193+ x_center = list_view.globalRect.x + list_view.width / 2
194+ y_center = list_view.globalRect.y + list_view.height / 2
195+ y_diff = category_element.y - list_view.height + category_element.height
196+ list_view._slow_drag(x_center, x_center,
197+ y_center, y_center - y_diff)
188 applications = self.applications_scope.get_applications(category)
198 applications = self.applications_scope.get_applications(category)
189 self.assertEqual(expected_applications, applications)
199 self.assertEqual(expected_applications, applications)