Last modified: 2014-10-19 17:44:06 UTC
If7a0d4e873fcecbe12a972a7b9e21a8d1b35c9be introduced a test for nearby on mobile but this will not always work as it uses the users current location and there may or may not be articles near that user. Ideally we should create a dummy article with a known location and hard code the browser location so that it always reports a given location to take this element of uncertainty out of tests.
As Jon pointed out to me, Chrome has an "Override Geolocation" under Settings/Overrides. So we just need to figure out how to get WebDriver tests to implement the same sort of override, and then we can set values for which we know matching content exists in our test environments.
Looks like there is a Chrome method for overriding geolocation: https://developers.google.com/chrome-developer-tools/docs/protocol/tot/page#command-setGeolocationOverride
Format for using a JSON response to override Firefox's geo.wifi.uri setting: https://developers.google.com/maps/documentation/business/geolocation/#responses
Info on settings up a user prefs file for the Firefox app to consume when it launches: http://kb.mozillazine.org/User.js_file
Change 103512 had a related patch set uploaded by Jhall: [QA] WIP Spoof physical geolocation for browser tests https://gerrit.wikimedia.org/r/103512
Changing bug status since task in still WIP.
Change 103512 abandoned by Jhall: [QA] WIP Spoof physical geolocation for browser tests Reason: Needs to be re-worked. https://gerrit.wikimedia.org/r/103512
The same as bug 57333?
Interesting blog post with code examples in C# Faking Geolocation in Selenium WebDriver with Firefox http://watirmelon.com/2014/09/18/faking-geolocation-in-selenium-webdriver-with-firefox/