Skip to content

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

@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 :(

@Fishbowler Fishbowler added the v1.40.0 Release 1.40.0 label Dec 5, 2024
@c-goettert
Copy link

This looks like an awesome and really helpful PR. Does anyone know when this will be released?

@NorseGaud
Copy link
Author

Hi @c-goettert the only thing left is to add the proper tests that the maestro team wants. Unfortunately I don't have any more money for this project to have my dev do it, since we're unblocked in our fork of the code, so I can't do it. Maybe you could help?

@BinaryJava
Copy link

BinaryJava commented Mar 13, 2025

This is exactly what I needed as the RIGHT direction didn't travel far enough to get the result I wanted.

I was also wondering, is it possible to due a starting point inside the id of an element, I have a large element that I wish to start swiping from the top left corner, but by default it starts from the middle.

@c-goettert
Copy link

I think that this feature is very valuable and useful for many cases, it would be a pity if this work was not getting merged. Unfortunately, I am not very deeply involved in the project myself and will probably not be able to provide any tests in the near future.

@NorseGaud
Copy link
Author

Hi @Fishbowler , any updates on when we could expect this to be added?

@NorseGaud
Copy link
Author

Helloooooo! Bump! @Fishbowler , please let me know what's left for getting this merged in.

@NorseGaud
Copy link
Author

OK, @Fishbowler I've got the tests passing: mobile-dev-inc/demo_app#6

override val waitToSettleTimeoutMs: Int? = null,
) : YamlSwipe

data class YamlRelativeCoordinateSwipeElement(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add this case in YamlCommandReaderTest?

Copy link
Author

Choose a reason for hiding this comment

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

I don't know what that means. Can you clarify?

@amanjeetsingh150
Copy link
Collaborator

Just realized E2E tests are failing, can you help checking what might be wrong there?

@NorseGaud
Copy link
Author

Just realized E2E tests are failing, can you help checking what might be wrong there?

Who are you asking? If me, I don't see any of the tests that fail related to my changes. Which ones?

@Fishbowler
Copy link
Contributor

I think it's a flake. I've re-run them to find out.

@Fishbowler
Copy link
Contributor

Fishbowler commented Jun 30, 2025

OK, @Fishbowler I've got the tests passing: mobile-dev-inc/demo_app#6

I know it's a bit mad, but the tests that prove Maestro but rely on Demo App go into Maestro, in /e2e/workspaces/demo_app.

It's all a little atypical, building an app to have 'something' under test, so that you can prove that your test framework actually tests.

@NorseGaud
Copy link
Author

OK, @Fishbowler I've got the tests passing: mobile-dev-inc/demo_app#6

I know it's a bit mad, but the tests that prove Maestro but rely on Demo App go into Maestro, in /e2e/workspaces/demo_app.

It's all a little atypical, building an app to have 'something' under test, so that you can prove that your test framework actually tests.

I don't understand what your point is

@Fishbowler
Copy link
Contributor

I retract my point.
It was about where tests go, but I see you've done a different approach for both repos, and is consistent.

@NorseGaud
Copy link
Author

I'm still super confused. 😅 I added the e2e tests as you mentioned. What is the different approach I did?

@BinaryJava
Copy link

With the E2E tests implemented, is this PR ready to merge?

@c-goettert
Copy link

Any updates on this?

@afiller
Copy link

afiller commented Sep 22, 2025

We would also be super excited to check this out. It would be very helpful for our real device testing.

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

Labels

v1.40.0 Release 1.40.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants