mozilla-mobile / prox

[INACTIVE] A search and discovery app for the "here & now". We're experimenting with ideas on mobile that can better surface content from the open web.
https://wiki.mozilla.org/New_Mobile_Experience
Mozilla Public License 2.0
22 stars 12 forks source link

Implement a way to load mock location data #176

Open nojunpark opened 7 years ago

nojunpark commented 7 years ago

For ProxUITests to run effectively, there should be a way to enter mock location data for the simulated GPS location. Because XCUITests are completely black box, it would be difficult to use anything inside the Prox UIApplication's API to enter data. If somehow a profile data can be loaded while running the UI tests that feeds the location data, or somehow redirect the Yelp api call to the local server instance with the mock data, it would be ideal

Probably worth investigating during / after Hawaii.

fluffyemily commented 7 years ago

No-Jun. In the repository there is a .gpx file called hilton_location.gpx. If you edit the scheme ProxUITests, under Run -> Options -> Allow Location Simulation, select the hilton_location.gpx file. This will ensure that every run of the app will default the simulator location to the Hilton Waikaloa.

On 15 November 2016 at 20:29, No-Jun Park notifications@github.com wrote:

For ProxUITests to run effectively, there should be a way to enter mock location data for the simulated GPS location. Because XCUITests are completely black box, it would be difficult to use anything inside the Prox UIApplication's API to enter data. If somehow a profile data can be loaded while running the UI tests that feeds the location data, or somehow redirect the Yelp api call to the local server instance with the mock data, it would be ideal

Probably worth investigating during / after Hawaii.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mozilla-mobile/prox/issues/176, or mute the thread https://github.com/notifications/unsubscribe-auth/AMB1uGnoqnNzuS-nB3U46smNKSLgp0uaks5q-hY1gaJpZM4Ky_FW .

nojunpark commented 7 years ago

Ah, it was in the scheme, thanks Emily! I saw the gpx file, but then again https://github.com/mozilla-mobile/prox/blob/master/Prox/Prox/PlaceCarousel/PlaceCarouselViewController.swift#L121 seems to put hilton as hardcoded location as well, so I was confused.

Reading my original text, I think I was a bit unclear. For ui testing, we need to:

So now only thing we need to make sure is the downloaded yelp/tripadvisor data is somehow predictable. I'm thinking either we can feed the recorded data, or have the test run also download the Yelp info for the fixed coordinate and compare it with what the app displays. Whatever the easiest would work for us I think, and probably it's not something we need to do before the hawaii demo, but at least keep in mind about it. If there's flaw in my reasoning please let me know!