Skip to content

fix: send mobile scroll distance only for direction strategy#2741

Merged
KazuCocoa merged 2 commits intoappium:masterfrom
krayc425:master
Mar 1, 2026
Merged

fix: send mobile scroll distance only for direction strategy#2741
KazuCocoa merged 2 commits intoappium:masterfrom
krayc425:master

Conversation

@krayc425
Copy link
Contributor

@krayc425 krayc425 commented Mar 1, 2026

Summary

Align mobile: scroll distance handling with WDA strategy behavior and document the parameter.

WDA Behavior Reference

handleScroll in WDA evaluates strategies in this order: name -> direction -> predicateString -> toVisible.
distance is only read inside the direction branch (defaulting to 1.0).

NSString *const direction = request.arguments[@"direction"];
  if (direction) {
    NSString *const distanceString = request.arguments[@"distance"] ?: @"1.0";
    ...

What Changed

  • Updated mobileScroll to only include distance in the payload when the direction strategy is selected.
  • Added distance to mobile: scroll execute-method docs with strategy caveat.
  • Added unit tests to verify:
    • distance is sent when direction is used.
    • distance is ignored when a non-direction strategy (e.g. name) is used.

@krayc425 krayc425 marked this pull request as ready for review March 1, 2026 11:45
@KazuCocoa KazuCocoa merged commit ddcf4bc into appium:master Mar 1, 2026
15 checks passed
github-actions bot pushed a commit that referenced this pull request Mar 1, 2026
## [10.24.2](v10.24.1...v10.24.2) (2026-03-01)

### Bug Fixes

* send mobile scroll distance only for direction strategy ([#2741](#2741)) ([ddcf4bc](ddcf4bc))
@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2026

🎉 This PR is included in version 10.24.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants