aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Bonnici <marc.bonnici@arm.com>2018-12-19 13:12:28 +0000
committerMarc Bonnici <marc.bonnici@arm.com>2018-12-21 14:26:55 +0000
commitba4004db5f77066d356a88c5ee47e71a38a5ae09 (patch)
tree9222221398a3cc8fcf6483f9db40c3b25a7c8d91
parent87ac9c6ab3da7362bab192999c645b54ad1eba3b (diff)
workloads/googlemaps: Fix for alternative layouts.
Add additional check for text based directions button as id can be missing on some devices and allow for skipping the view steps stage for large screen devices which do not require this step.
-rw-r--r--wa/workloads/googlemaps/com.arm.wa.uiauto.googlemaps.apkbin265530 -> 264876 bytes
-rw-r--r--wa/workloads/googlemaps/uiauto/app/src/main/java/com/arm/wa/uiauto/UiAutomation.java7
2 files changed, 6 insertions, 1 deletions
diff --git a/wa/workloads/googlemaps/com.arm.wa.uiauto.googlemaps.apk b/wa/workloads/googlemaps/com.arm.wa.uiauto.googlemaps.apk
index ccf52ef1..16f92f3b 100644
--- a/wa/workloads/googlemaps/com.arm.wa.uiauto.googlemaps.apk
+++ b/wa/workloads/googlemaps/com.arm.wa.uiauto.googlemaps.apk
Binary files 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 2397775e..c1cc5aa7 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
@@ -126,6 +126,9 @@ public class UiAutomation extends BaseUiAutomation {
public void getDirectionsFromLocation() throws Exception {
UiObject directions = mDevice.findObject(new UiSelector().resourceId(packageID + "placepage_directions_button"));
+ if (!directions.exists()){
+ directions = mDevice.findObject(new UiSelector().textContains("DIRECTIONS"));
+ }
directions.clickAndWaitForNewWindow(uiAutoTimeout);
}
@@ -140,7 +143,9 @@ public class UiAutomation extends BaseUiAutomation {
public void viewRouteSteps() throws Exception {
UiObject steps = mDevice.findObject(new UiSelector().textContains("STEPS & MORE")
.className("android.widget.TextView"));
- steps.clickAndWaitForNewWindow(uiAutoTimeout);
+ if (steps.exists()){
+ steps.clickAndWaitForNewWindow(uiAutoTimeout);
+ }
}
public void previewRoute() throws Exception {