mobile-dev-inc / maestro

Painless Mobile UI Automation
https://maestro.mobile.dev/
Apache License 2.0
5.72k stars 263 forks source link

[Feature Request] [Android] extend openLink to better support navigation #874

Open ghost opened 1 year ago

ghost commented 1 year ago

I have checked out the latest feature in cli 1.24.0 in openLink supporting deeplinks. Thank you greatly appreciated! This can save a lot of time when running tests to not wait for "click" input.

It would be great if we better support also internal navigation patterns on android/iOS and not only external. On Android activities can be launched if they have the exported flag set.

Currently it is not supported to navigate directly to an activity/fragment with openLink. Possibly there is a workaround today to achieve this via scripts, but I think it is a great addition. Maybe even a different api like navigateTo since it is more clear that it applies more to internal navigation as opposed to openLink. Orthogonal concepts to navigation exist also on iOS.

On the command line this should be achievable for Android like this for activities: am start -n yourpackagename/.activityname For fragments and jetpack navigation concepts I do not know the script command yet.

kdani41 commented 1 year ago

This feature will be really useful. @axelniklasson Is there any workaround to currently fire adb commands via maestro?

axelniklasson commented 1 year ago

@kdani41 Not at the moment unfortunately as Maestro is a blackbox testing framework emulating user interactions, which is why we for example don't support firing raw idb commands. It would also be helpful to know what you're looking to solve in terms of testing with this use case, especially since users won't be able to do this? Thanks!

kdani41 commented 1 year ago

I'm trying emulate fingerprint login via adb command.

axelniklasson commented 1 year ago

@kdani41 thanks for the context -- this is being tracked in https://github.com/mobile-dev-inc/maestro/issues/282 so let's move the discussion there, thanks!