mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-31 02:01:16 +00:00
Update googlemaps workload to work against most recent version
* Updated google maps workload to work against apk version 10.19.1
This commit is contained in:
parent
e9839d52c4
commit
f3e7b14b28
@ -37,7 +37,7 @@ class GoogleMaps(ApkUiautoWorkload):
|
||||
should then be placed in the ``~/.workload_automation/dependencies/googlemaps`` directory on your
|
||||
local machine, creating this if it does not already exist.
|
||||
|
||||
Known working APK version: 9.72.2
|
||||
Known working APK version: 10.19.1
|
||||
'''
|
||||
package_names = ['com.google.android.apps.maps']
|
||||
|
||||
|
Binary file not shown.
@ -36,6 +36,9 @@ import org.junit.runner.RunWith;
|
||||
|
||||
import com.arm.wa.uiauto.BaseUiAutomation;
|
||||
|
||||
import static com.arm.wa.uiauto.BaseUiAutomation.Direction.DOWN;
|
||||
import static com.arm.wa.uiauto.BaseUiAutomation.Direction.UP;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class UiAutomation extends BaseUiAutomation {
|
||||
|
||||
@ -66,6 +69,17 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
dismissLocationTutorial();
|
||||
sleep(3);
|
||||
|
||||
/** On newer version the location info at bottom of screen interferes with swiping tests so remove by
|
||||
swiping down. Check if new version by seeing if view switcher is present **/
|
||||
UiObject viewSwitcher =
|
||||
mDevice.findObject(new UiSelector().className("android.widget.ViewSwitcher"));
|
||||
UiObject cambridgeTextView =
|
||||
mDevice.findObject(new UiSelector().textContains("Cambridge"));
|
||||
|
||||
if(!viewSwitcher.exists()) { // Version 10.19.1
|
||||
cambridgeTextView.dragTo(0,getDisplayHeight(), 40);
|
||||
}
|
||||
|
||||
// Pinch to zoom, scroll around
|
||||
UiObject mapContainer = mDevice.findObject(new UiSelector().resourceId(packageID + "mainmap_container"));
|
||||
uiDeviceSwipeDown(100);
|
||||
@ -79,6 +93,11 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
uiObjectVertPinchOut(mapContainer, 100, 50);
|
||||
sleep(3);
|
||||
|
||||
// On newer versions swipe the location info tab back up
|
||||
if(!viewSwitcher.exists()) { // Version 10.19.1
|
||||
cambridgeTextView.dragTo(0, getDisplayCentreHeight(), 40);
|
||||
}
|
||||
|
||||
// Get directions from Cambridge train station to Corpus Christi college
|
||||
getDirectionsFromLocation();
|
||||
search("Corpus Christi, Cambridge, England", "directions_startpoint_textbox");
|
||||
|
Loading…
x
Reference in New Issue
Block a user