Пример #1
0
    def _flick_to_image(self, direction):
        action = Actions(self.marionette)

        current_image = self.marionette.find_element(*self._current_image_locator)
        current_image_move_x = current_image.size["width"] / 2
        current_image_mid_x = current_image.size["width"] / 2
        current_image_mid_y = current_image.size["height"] / 2

        if direction == "next":
            action.flick(
                current_image,
                current_image_mid_x,
                current_image_mid_y,
                current_image_mid_x - current_image_move_x,
                current_image_mid_y,
            )
        else:
            action.flick(
                current_image,
                current_image_mid_x,
                current_image_mid_y,
                current_image_mid_x + current_image_move_x,
                current_image_mid_y,
            )

        action.perform()
        self.wait_for_element_displayed(*self._current_image_locator)
Пример #2
0
 def _flick_to_image(self, direction):
     image = self.marionette.find_element(*self._current_image_locator)
     action = Actions(self.marionette)
     x_start = (image.size["width"] / 100) * (direction == "next" and 90 or 10)
     x_end = (image.size["width"] / 100) * (direction == "next" and 10 or 90)
     y_start = image.size["height"] / 4
     y_end = image.size["height"] / 4
     action.flick(image, x_start, y_start, x_end, y_end, 200).perform()
     Wait(self.marionette).until(lambda m: abs(image.location["x"]) >= image.size["width"])
Пример #3
0
 def _flick_to_image(self, direction):
     image = self.marionette.find_element(*self._current_image_locator)
     action = Actions(self.marionette)
     x_start = (image.size['width'] / 100) * (direction == 'next' and 90 or 10)
     x_end = (image.size['width'] / 100) * (direction == 'next' and 10 or 90)
     y_start = image.size['height'] / 4
     y_end = image.size['height'] / 4
     action.flick(image, x_start, y_start, x_end, y_end, 200).perform()
     Wait(self.marionette).until(
         lambda m: abs(image.location['x']) >= image.size['width'])
Пример #4
0
    def _flick_to_image(self, direction):
        action = Actions(self.marionette)

        current_image = self.marionette.find_element(*self._current_image_locator)
        current_image_move_x = current_image.size['width'] / 2
        current_image_mid_x = current_image.size['width'] / 2
        current_image_mid_y = current_image.size['height'] / 2

        if direction == 'next':
            action.flick(current_image, current_image_mid_x, current_image_mid_y, current_image_mid_x - current_image_move_x, current_image_mid_y)
        else:
            action.flick(current_image, current_image_mid_x, current_image_mid_y, current_image_mid_x + current_image_move_x, current_image_mid_y)

        action.perform()
        self.wait_for_element_displayed(*self._current_image_locator)
Пример #5
0
Файл: app.py Проект: Sob40/gaia
    def _flick_to_month(self, direction):
        """Flick current monthly calendar to next or previous month.

        @param direction: flick to next month if direction='next', else flick to previous month
        """
        action = Actions(self.marionette)

        current_monthly_calendar = self.marionette.find_element(*self._current_monthly_calendar_locator)
        flick_origin_x = current_monthly_calendar.size['width'] // 2
        flick_origin_y = current_monthly_calendar.size['height'] // 2
        flick_destination_x = 0 if direction == 'next' else 2 * flick_origin_x

        action.flick(current_monthly_calendar, flick_origin_x, flick_origin_y,
                     flick_destination_x, flick_origin_y)
        action.perform()
Пример #6
0
Файл: app.py Проект: 6a68/gaia
    def _flick_to_month(self, direction):
        """Flick current monthly calendar to next or previous month.

        @param direction: flick to next month if direction='next', else flick to previous month
        """
        action = Actions(self.marionette)

        month = self.marionette.find_element(
            *self._current_monthly_calendar_locator)
        month_year = self.current_month_year

        x_start = (month.size['width'] / 100) * (direction == 'next' and 90 or 10)
        x_end = (month.size['width'] / 100) * (direction == 'next' and 10 or 90)
        y_start = month.size['height'] / 4
        y_end = month.size['height'] / 4

        action.flick(month, x_start, y_start, x_end, y_end, 200).perform()

        Wait(self.marionette).until(lambda m: self.current_month_year != month_year)
Пример #7
0
    def _flick_to_month(self, direction):
        """Flick current monthly calendar to next or previous month.

        @param direction: flick to next month if direction='next', else flick to previous month
        """
        action = Actions(self.marionette)

        month = self.marionette.find_element(
            *self._current_monthly_calendar_locator)
        month_year = self.current_month_year

        x_start = (month.size['width'] / 100) * (direction == 'next' and 90 or 10)
        x_end = (month.size['width'] / 100) * (direction == 'next' and 10 or 90)
        y_start = month.size['height'] / 4
        y_end = month.size['height'] / 4

        action.flick(month, x_start, y_start, x_end, y_end, 200).perform()

        Wait(self.marionette).until(lambda m: self.current_month_year != month_year)
Пример #8
0
    def test_edge_gestures(self):
        '''
        Test swiping between apps with edge gestures
        As this is non-default (ie pref set) Gaia behaviour I have eschewed app objects
        '''

        # Swipe to the left on the displayed frame
        displayed_frame = self.apps.displayed_app.frame
        action = Actions(self.marionette)
        action.flick(displayed_frame, 0, 100, -200, 0, 50).perform()

        self.wait_for_condition(lambda m: self.apps.displayed_app.name == self._apps_under_test[0])

        # Swipe to the right
        displayed_frame = self.apps.displayed_app.frame
        action = Actions(self.marionette)
        action.flick(displayed_frame, displayed_frame.size['width'], 100, 200, 0, 50).perform()

        self.wait_for_condition(lambda m: self.apps.displayed_app.name == self._apps_under_test[1])
Пример #9
0
    def test_edge_gestures(self):
        '''
        Test swiping between apps with edge gestures
        As this is non-default (ie pref set) Gaia behaviour I have eschewed app objects
        '''

        # Swipe to the left on the displayed frame
        displayed_frame = self.apps.displayed_app.frame
        action = Actions(self.marionette)
        action.flick(displayed_frame, 0, 100, -200, 0, 50).perform()

        self.wait_for_condition(
            lambda m: self.apps.displayed_app.name == self._apps_under_test[0])

        # Swipe to the right
        displayed_frame = self.apps.displayed_app.frame
        action = Actions(self.marionette)
        action.flick(displayed_frame, displayed_frame.size['width'], 100, 200,
                     0, 50).perform()

        self.wait_for_condition(
            lambda m: self.apps.displayed_app.name == self._apps_under_test[1])