appium / python-client

Python language bindings for Appium
Apache License 2.0
1.63k stars 556 forks source link

MultiAction.add() Incorrect Docstring #956

Closed Ferny44 closed 3 months ago

Ferny44 commented 4 months ago

The problem

In appium/webdriver/common/multi_action.py:

MultiAction.add method docstring states that it returns self instance. The method's type hint states that it returns none.

    def add(self, *touch_actions: 'TouchAction') -> None:
        """Add TouchAction objects to the MultiAction, to be performed later.

        Args:
            touch_actions: one or more TouchAction objects describing a chain of actions to be performed by one finger

        Usage:
            | a1 = TouchAction(driver)
            | a1.press(el1).move_to(el2).release()
            | a2 = TouchAction(driver)
            | a2.press(el2).move_to(el1).release()
            | MultiAction(driver).add(a1, a2)

        Returns:
            `MultiAction`: Self instance
        """
        for touch_action in touch_actions:
            if self._touch_actions is None:
                self._touch_actions = []

            self._touch_actions.append(copy.copy(touch_action))

Environment

KazuCocoa commented 4 months ago

It would be appreciated to create a PR if you don't mind. These classes will be removed as the deprecation, btw.

KazuCocoa commented 3 months ago

3.2.0 has the update