def close_indicator_page(self):
     """Swipe to close the opened indicator, wait until it's closed."""
     indicators_menu = self.wait_select_single('IndicatorsMenu')
     end_x, end_y = input.get_center_point(indicators_menu)
     start_x = end_x
     start_y = self.height
     self.pointing_device.drag(start_x, start_y, end_x, end_y)
     indicators_menu.fullyClosed.wait_for(True)
    def open_indicator_page(self, indicator_name):
        """Swipe to open the indicator, wait until it's open.

        :returns: The indicator page.
        """
        widget = self._get_indicator_panel_item(indicator_name)
        start_x, start_y = input.get_center_point(widget)
        end_x = start_x
        end_y = self.height
        self.pointing_device.drag(start_x, start_y, end_x, end_y)
        self.wait_select_single('IndicatorsMenu', fullyOpened=True)
        return self._get_indicator_page(indicator_name)
Exemple #3
0
    def test_tap(self):
        x, y = get_center_point(self.widget)
        self.device.tap(x, y)

        self.assertThat(
            self.button_status.text, Eventually(Equals("Touch Release")))
Exemple #4
0
    def test_get_center_point_logs_with_globalRect(self, mock_logger):
        obj = make_fake_object(globalRect=True)
        x, y = get_center_point(obj)

        mock_logger.debug.assert_called_once_with(
            "Moving to object's globalRect coordinates.")
Exemple #5
0
    def test_get_center_point_works_with_center_points(self):
        obj = make_fake_object(center=True)
        x, y = get_center_point(obj)

        self.assertEqual(123, x)
        self.assertEqual(345, y)
Exemple #6
0
    def test_get_center_point_works_with_globalRect(self):
        obj = make_fake_object(globalRect=True)
        x, y = get_center_point(obj)

        self.assertEqual(50, x)
        self.assertEqual(50, y)
Exemple #7
0
    def test_get_center_point_prefers_center_points(self):
        obj = make_fake_object(globalRect=False, center=True, xywh=True)
        x, y = get_center_point(obj)

        self.assertEqual(123, x)
        self.assertEqual(345, y)
Exemple #8
0
    def test_get_center_point_prefers_globalRect(self):
        obj = make_fake_object(globalRect=True, center=True, xywh=True)
        x, y = get_center_point(obj)

        self.assertEqual(50, x)
        self.assertEqual(50, y)
Exemple #9
0
    def test_get_center_point_works_with_xywh(self):
        obj = make_fake_object(xywh=True)
        x, y = get_center_point(obj)

        self.assertEqual(110, x)
        self.assertEqual(120, y)
Exemple #10
0
    def test_get_center_point_logs_with_center_points(self, mock_logger):
        obj = make_fake_object(center=True)
        x, y = get_center_point(obj)

        mock_logger.debug.assert_called_once_with(
            "Moving to object's center_x, center_y coordinates.")