Issue
Requirement
We are required to conduct automated tests on a food delivery app which when launched it asks for permission to use the user's location and display a list of nearby restaurants.
Problem
When we run our tests on Bitrise the app fails to get the list of nearby restaurants because the CI server is in a different country.
Attempted Solutions
- Added "abd emu geo fix " to a script step in our Bitrise workflow right after creating and waiting for the emulator to launch
- Tried to specify the name of the emulator by "adb -s emulator-5554 emu geo fix "
- Tried "telnet localhost 5554" where the connection gets established then directly gets closed "connection closed by foreign host"
Investigations
- "abd emu geo fix " works fine locally
- "telnet localhost 5554" works fine locally
Notes
- We are using Android 9.0 (API 28) both locally and on Bitrise
- We are using JAVA 11 both locally and on Bitrise
- We are using a Pixel emulator both locally and on Bitrise
Hope somebody could help us out.
Solution
We had two solutions which are the following:
Add an isAutomation flag to the staging app so that when the flag is true the app always takes a static longitude and latitude and does not take the current location of the device.
Install a VPN on the server and specify the country we want, however, you should verify that the VPN has servers in the country you desire.
Eventually we went with the isAutomation flag workaround.
Answered By - S.Hasan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.