-
Notifications
You must be signed in to change notification settings - Fork 296
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
Open deep link with launch arguments #2192
Comments
Research notesHow does Maestro launch apps?Maestro launches the Android app by calling Trace
How does Maestro open links?Maestro opens links on Android by starting an activity with a view action and the URL; and on iOS by running Trace
How could Maestro be updated?For Android, the driver could be updated to launch an activity with a view action and the URL. Unfortunately, for iOS, there's no interface to open a deep link AND provide launch arguments. As a result, the proposal would not work. How does Detox implement this?On Android, Detox starts an activity with the URL. On iOS, the URL is passed to the app via a launch argument called Trace
WorkaroundFor my use case of setting some app state with launch arguments, it is possible to work around the issue by launching the app with the launch arguments followed by waiting for animations to end (a proxy for the state being applied), stopping the app then opening the deep link. Example flow configuration below: - launchApp:
clearState: true
arguments:
key: value
- waitForAnimationToEnd:
timeout: 5000
- stopApp
- openLink:
link: scheme://path/to/screen Open to hearing some thoughts before closing the issue. |
Nice workaround! Is the |
@Fishbowler: I haven't tested if An aside: I'm actually no longer loading app state via launch arguments. I've decided to move to writing data to the iOS app's data container and the Android emulator's filesystem instead. It better represents how the app would actually behave but it has a bit more complexity since a custom script is required. |
Use case
It is currently possible to launch the app with launch arguments using the
launchApp
command:And open a deep link using the
openLink
command:However, as far as I can tell, it's not possible to do both.
I am currently exploring migrating from Detox which does offer such an API (device.launchApp):
An example use case for this is using launch arguments to put the app in a certain state and testing a flow performs as expected when started from a deep link.
Proposal
The
launchApp
command could be updated to include aurl
field that accepts a URL to the screen.Anything else?
No response
The text was updated successfully, but these errors were encountered: