aboutsummaryrefslogtreecommitdiff
path: root/libs/UiAutomatorLib/src/com/android/afwtest/uiautomator/pages/gms/EnterPasswordPage.java
diff options
context:
space:
mode:
authorJinhui Wang <jinhuiw@google.com>2017-04-19 17:26:44 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-04-19 17:26:44 +0000
commitb766bcc50dda4f32db2e3518c8aee2a20a135fdc (patch)
tree2c308d6de5c1514906ca7b78ccc0e7cc8afe6b30 /libs/UiAutomatorLib/src/com/android/afwtest/uiautomator/pages/gms/EnterPasswordPage.java
parentec9548b6f9273d03119efd8025ae169224b23e63 (diff)
parent439d1a89a74bdc874099da9b276524ba7954bc80 (diff)
downloadAfwTestHarness-b766bcc50dda4f32db2e3518c8aee2a20a135fdc.tar.gz
Merge "Make test harness pass on large display" into nyc-dev
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.java10
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());