Fix an error of endtoend test.

This commit is contained in:
youtaol
2013-01-05 10:40:53 +08:00
parent d7b4eeb05b
commit e6b67d941e
@@ -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 = 5568;
private static final int ORIENTATION_PORTRAIT = 1;
private static final int ORIENTATION_LANDSCAPE = 0;
@@ -787,12 +787,14 @@ public class EndToEndTestUtils {
*/
public static TextView findTextView(String text) {
ArrayList<View> allViews = SOLO.getViews();
for (View view : allViews) {
if (view instanceof TextView) {
TextView textView = (TextView) view;
String textString = (String) textView.getText();
if (textView.isShown() && textString.endsWith(text)) {
return textView;
if (allViews != null) {
for (View view : allViews) {
if (view instanceof TextView) {
TextView textView = (TextView) view;
String textString = (String) textView.getText();
if (textView.isShown() && textString.endsWith(text)) {
return textView;
}
}
}
}