From 87fa74bb585e78f6051fb8f0cde134944832ced1 Mon Sep 17 00:00:00 2001 From: youtaol Date: Wed, 5 Dec 2012 17:15:20 +0800 Subject: [PATCH] Fix an error about testGPSMenu. Add a method waitTextToDisappear in EndToEndTestUtils. --- .../mytracks/endtoendtest/EndToEndTestUtils.java | 12 +++++++++++- .../mytracks/endtoendtest/MenuItemsTest.java | 16 ++++++++++------ .../endtoendtest/others/BigTestUtils.java | 4 ++-- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/MyTracksTest/src/com/google/android/apps/mytracks/endtoendtest/EndToEndTestUtils.java b/MyTracksTest/src/com/google/android/apps/mytracks/endtoendtest/EndToEndTestUtils.java index 1d5c34464..864e0d32d 100644 --- a/MyTracksTest/src/com/google/android/apps/mytracks/endtoendtest/EndToEndTestUtils.java +++ b/MyTracksTest/src/com/google/android/apps/mytracks/endtoendtest/EndToEndTestUtils.java @@ -56,7 +56,7 @@ public class EndToEndTestUtils { private static final String ANDROID_LOCAL_IP = "10.0.2.2"; // usually 5554. - public static int emulatorPort = 5554; + public static int emulatorPort = 5558; private static final int ORIENTATION_PORTRAIT = 1; private static final int ORIENTATION_LANDSCAPE = 0; @@ -965,5 +965,15 @@ public class EndToEndTestUtils { } SOLO.goBack(); } + + /** + * Waits a text to disappear. + */ + public static void waitTextToDisappear(String text) { + // The first wait should longer than following waits. + SOLO.waitForText(text, 1, SHORT_WAIT_TIME); + while (SOLO.waitForText(text, 1, 200)) {} + return; + } } \ No newline at end of file diff --git a/MyTracksTest/src/com/google/android/apps/mytracks/endtoendtest/MenuItemsTest.java b/MyTracksTest/src/com/google/android/apps/mytracks/endtoendtest/MenuItemsTest.java index 1c303a552..6fa645958 100644 --- a/MyTracksTest/src/com/google/android/apps/mytracks/endtoendtest/MenuItemsTest.java +++ b/MyTracksTest/src/com/google/android/apps/mytracks/endtoendtest/MenuItemsTest.java @@ -190,19 +190,23 @@ public class MenuItemsTest extends ActivityInstrumentationTestCase2