Skip to content

New touch Actions can be very long to write, let's simplify swipes #61

@alvarolaserna

Description

@alvarolaserna

Right now to make a single swipe we need to write all this code:

        appium_driver.actions().w3c_actions = ActionBuilder(
            appium_driver.get_driver,
            mouse=PointerInput(interaction.POINTER_TOUCH, "touch"))

        actions = appium_driver.actions()
        actions.w3c_actions.pointer_action.move_to_location(x=500, y=10)
        actions.w3c_actions.pointer_action.pointer_down()
        actions.w3c_actions.pointer_action.pause(1)
        actions.w3c_actions.pointer_action.move_to_location(x=500, y=1000)
        actions.w3c_actions.pointer_action.release()
        actions.perform()

I propose to make a swipe method that works like this:

list_swipe = [{x1, y1}, {x2, y2}, {x3, y3}]
appium_driver.swipe(list_swipe)

This method will swipe going from P1 to P2 and to P3, and if the list is longer, then it will go to all those points.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions