1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-05 18:31:12 +01:00

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.
This commit is contained in:
Marc Bonnici 2018-12-19 13:12:28 +00:00
parent 87ac9c6ab3
commit ba4004db5f
2 changed files with 6 additions and 1 deletions

View File

@ -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 {