Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expanded swipe to support from: -> to: #2117

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

NorseGaud
Copy link

@NorseGaud NorseGaud commented Oct 29, 2024

Proposed changes

In #1203, we realized all I needed to do was expand swipe a bit to support swiping on a picker wheel. Here is an example video showing how it works.

maestro-swipe++.mov

(we're writing a test suite for https://memlane.app)

This change adds to: for from: definitions, allowing users to be a bit more precise (move a wheel picker by 1) since direction is far too much of a swipe for my needs.

Testing

See video. Can devs recommend where we should add tests for this?

Documentation

mobile-dev-inc/maestro-docs#97

You can swipe from element id to the point using relative | absolute coordinates.
@Fishbowler
Copy link
Contributor

Thanks @NorseGaud! This looks really handy!
Any chance of some tests for the new capabilities?

You could certainly do an integration test, and perhaps some of the maths is unit testable? I don't know if there's a suitable place for an e2e test (i.e. I don't know if there's a suitable element to swipe on to see an effect to test against). Lemme know if you need a hand!

@NorseGaud
Copy link
Author

Hey @Fishbowler I found the docs for testing. I spent a few hours trying to get an IntegrationTest, but failed to do so. it seems like override fun swipe(start: Point, end: Point, durationMs: Long) { conflicts with an override I add for from: to:

e: file:///Users/norsegaud/maestro/maestro-test/src/main/kotlin/maestro/test/drivers/FakeDriver.kt:177:5 Conflicting overloads: public open fun swipe(start: Point, end: Point, durationMs: Long): Unit defined in maestro.test.drivers.FakeDriver, public open fun swipe(elementPoint: Point, to: Point, durationMs: Long): Unit defined in maestro.test.drivers.FakeDriver

Can you recommend the approach I can take for this? Also, apologies but my developer wrote all of this new code and I can't afford to have him write tests too. I'm just not good enough at Kotlin to understand how to get this test written :(

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.

3 participants