Skip to content

feat: mark ActionHelpers interaction shortcuts as deprecated - #1333

Open
hoanle0126 wants to merge 1 commit into
appium:masterfrom
hoanle0126:feat/deprecate-action-helpers-671
Open

hoanle0126 wants to merge 1 commit into
appium:masterfrom
hoanle0126:feat/deprecate-action-helpers-671

Conversation

@hoanle0126

Copy link
Copy Markdown
Contributor

Description

Marks the interaction shortcut methods on ActionHelpers (scroll, drag_and_drop, tap, swipe, and flick) as deprecated via @deprecated (typing_extensions) and Sphinx .. deprecated:: docstrings, and expands the README section with examples of building W3C actions (ActionChains / ActionBuilder) and using driver-specific mobile: gesture commands.

Closes #671

Changes

  • Decorate scroll, drag_and_drop, tap, swipe, and flick with @deprecated so callers receive both static type-checker warnings and runtime DeprecationWarnings.
  • Document W3C ActionChains / ActionBuilder pointer setup and mobile: gesture execute_script usage in README.md.
  • Add unit tests in test/unit/webdriver/device/action_helpers_test.py verifying the deprecation warnings and W3C action payloads.

@@ -0,0 +1,81 @@
#!/usr/bin/env python

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary for the annotation

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed test/unit/webdriver/device/action_helpers_test.py in e0bcdde.

Comment thread README.md Outdated
Comment on lines +151 to +163
Or use native `mobile:` gesture commands via `driver.execute_script`:

```python
# iOS (XCUITest) scroll example
driver.execute_script('mobile: scroll', {'direction': 'down'})
# Android (UiAutomator2) scrollGesture example
driver.execute_script(
'mobile: scrollGesture',
{'left': 100, 'top': 100, 'width': 200, 'height': 400, 'direction': 'down', 'percent': 1.0},
)
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed. General recommendation is w3c actions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the mobile: example block in e0bcdde so the section focuses on W3C actions.

@hoanle0126
hoanle0126 force-pushed the feat/deprecate-action-helpers-671 branch from 86a2042 to e0bcdde Compare October 31, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mark deprecated in shortcuts

2 participants