diff --git a/wa/workloads/googlemaps/__init__.py b/wa/workloads/googlemaps/__init__.py index bd8af5ad..91c5349f 100644 --- a/wa/workloads/googlemaps/__init__.py +++ b/wa/workloads/googlemaps/__init__.py @@ -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'] diff --git a/wa/workloads/googlemaps/com.arm.wa.uiauto.googlemaps.apk b/wa/workloads/googlemaps/com.arm.wa.uiauto.googlemaps.apk index 06fca5cc..9d5e00ae 100644 Binary files a/wa/workloads/googlemaps/com.arm.wa.uiauto.googlemaps.apk and b/wa/workloads/googlemaps/com.arm.wa.uiauto.googlemaps.apk differ diff --git a/wa/workloads/googlemaps/uiauto/app/src/main/java/com/arm/wa/uiauto/UiAutomation.java b/wa/workloads/googlemaps/uiauto/app/src/main/java/com/arm/wa/uiauto/UiAutomation.java index c1cc5aa7..d9ab3515 100644 --- a/wa/workloads/googlemaps/uiauto/app/src/main/java/com/arm/wa/uiauto/UiAutomation.java +++ b/wa/workloads/googlemaps/uiauto/app/src/main/java/com/arm/wa/uiauto/UiAutomation.java @@ -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");