mobile-dev-inc / maestro

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

[v1.32.0] `launchApp` command affecting iOS simulator's ability to retrieve current location #1458

Open ricardopereira opened 1 year ago

ricardopereira commented 1 year ago

I've been experiencing an issue with the launchApp command in Maestro UI Tests tool, which leads to a malfunction in the iOS simulator's ability to obtain its current location.

Steps to reproduce:

  1. Manually set a custom location in the iOS Simulator using the path: iOS Simulator > Features > Location > Custom location.
  2. Launch an app, like Apple Maps, and verify the correct location is shown.
  3. Use the Maestro flow with the following commands:
    - launchApp:
    clearState: false
    clearKeychain: false
    permissions:
      location: inuse
      usertracking: allow
      notifications: allow
  4. Launch the same app (or another one) and observe that the simulator fails to retrieve the current location.

Additional observations:

Simulator Screenshot - iPhone 14 Pro - 2023-09-14 at 12 53 53

I tried both manually setting the location and using the setLocation command from Maestro (setLocation reference), but the issue persisted.

It seems that there might be an underlying issue with how the launchApp command or possibly the idb-companion interacts with the simulator's location services.

Expected behavior launchApp command not interfering with the ability to retrieve current location in the iOS simulator and, in consequence, be able to set different locations while running tests.

Environment information (please complete the following information):

Bugreport output

Attachments

Thank you for looking into this ❤️

MHB2011 commented 1 year ago

I have a similar problem in my react native app. I use IOS simulator with maestro.

Inside the app i use @react-native-community/geolocation to retrive user location with getCurrentPosition method.

It always returns me an error saying "Unable to retrieve location.".

I have checked that user granted permission before asking for location.

Also tried setting the location using setLocation, and this doesn't seem to work properly

ibrahimtelman commented 1 year ago

I have the same issue with the Flutter application. When I tried to run the app I could give the permission but could not retrieve any location data.

Maestro Cli 1.33.1 Xcode 15 iOS 16.4

rafaelsoncineduobox commented 12 months ago

Same issue here, any solution?

theromeapp commented 2 months ago

+1 Still having this issue on my react native app - any solutions?

ricardopereira commented 2 months ago

No 😞 I'm still having trouble setting different locations while running Maestro.