Skip to content

Commit

Permalink
Merge branch 'master' into chore/bump_gradle_to_latest_everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekpacia authored Jan 29, 2025
2 parents f385b6b + e465db0 commit ab17fab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/patrol/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Bump Gradle version in the example app so it's possible to build them on the
latest JDK 23 (#2503)
- Fix `$.native.tap()` not working with `Selector` having `instance` set. (#2501)

## 3.14.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,24 @@ class AutomatorServer(private val automation: Automator) : NativeAutomatorServer

override fun tap(request: TapRequest) {
if (request.selector != null) {
// Remove instance before creating bySelector, as it's not supported
var selector2 = request.selector.copy(instance = null)
val bySelector = selector2.toBySelector()

automation.tap(
uiSelector = request.selector.toUiSelector(),
bySelector = request.selector.toBySelector(),
bySelector = bySelector,
index = request.selector.instance?.toInt() ?: 0,
timeout = request.timeoutMillis
)
} else if (request.androidSelector != null) {
// Remove instance before creating bySelector, as it's not supported
var androidSelector2 = request.androidSelector.copy(instance = null)
val bySelector = androidSelector2.toBySelector()

automation.tap(
uiSelector = request.androidSelector.toUiSelector(),
bySelector = request.androidSelector.toBySelector(),
bySelector = bySelector,
index = request.androidSelector.instance?.toInt() ?: 0,
timeout = request.timeoutMillis
)
Expand Down

0 comments on commit ab17fab

Please sign in to comment.