diff options
author | Jinhui Wang <jinhuiw@google.com> | 2017-04-18 16:42:22 -0700 |
---|---|---|
committer | Jinhui Wang <jinhuiw@google.com> | 2017-04-18 16:42:22 -0700 |
commit | 439d1a89a74bdc874099da9b276524ba7954bc80 (patch) | |
tree | 6d511a9ef0a112cecbb049d217eef76895c7b128 /libs/UiAutomatorLib/src/com/android/afwtest/uiautomator/pages/gms/EnterPasswordPage.java | |
parent | 0c0c8ee29cab487eef2fb92a9d8aea0c443a1734 (diff) | |
download | AfwTestHarness-439d1a89a74bdc874099da9b276524ba7954bc80.tar.gz |
Make test harness pass on large display
BUG: 37484156
Change-Id: I22b76863918e0ca16cae6fb0658e4cf45838036f
Diffstat (limited to 'libs/UiAutomatorLib/src/com/android/afwtest/uiautomator/pages/gms/EnterPasswordPage.java')
-rw-r--r-- | libs/UiAutomatorLib/src/com/android/afwtest/uiautomator/pages/gms/EnterPasswordPage.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/UiAutomatorLib/src/com/android/afwtest/uiautomator/pages/gms/EnterPasswordPage.java b/libs/UiAutomatorLib/src/com/android/afwtest/uiautomator/pages/gms/EnterPasswordPage.java index abebc0d..96e7dcd 100644 --- a/libs/UiAutomatorLib/src/com/android/afwtest/uiautomator/pages/gms/EnterPasswordPage.java +++ b/libs/UiAutomatorLib/src/com/android/afwtest/uiautomator/pages/gms/EnterPasswordPage.java @@ -18,7 +18,9 @@ package com.android.afwtest.uiautomator.pages.gms; import static com.android.afwtest.uiautomator.Constants.GMS_NEXT_BUTTON_SELECTOR; import static com.android.afwtest.uiautomator.Constants.GMS_PKG_NAME; +import static com.android.afwtest.uiautomator.Constants.GMS_TEXT_FIELD_SELECTOR; +import android.os.SystemClock; import android.support.test.uiautomator.By; import android.support.test.uiautomator.BySelector; import android.support.test.uiautomator.UiDevice; @@ -90,6 +92,14 @@ public final class EnterPasswordPage extends UiPage { */ @Override public void navigate() throws Exception { + WidgetUtils.waitAndClick(getUiDevice(), + GMS_TEXT_FIELD_SELECTOR, + TimeUnit.SECONDS.toMillis(5)); + // Clicking the text field will bring up the keyboard and change the view hierachy of + // current screen; textField may become stale. Try to find it again before simulating + // the keyboard events. + SystemClock.sleep(TimeUnit.SECONDS.toMillis(5)); + //Enter password by key event KeyCharacterMap map = KeyCharacterMap.load(KeyCharacterMap.VIRTUAL_KEYBOARD); KeyEvent[] events = map.getEvents(mPassword.toCharArray()); |