Change some code to make test stable. Add a method in EndToEndTestUtils to hide soft keyboard when input text in edit text. Add method deleteAllTracks() in EndToEndTestUtils. Add 4 fields for different wait time in EndToEndTestUtils. Change method showMoreMenuItem to showMenuItem in EndToEndTestUtils.

This commit is contained in:
youtaol
2012-07-23 17:56:54 +08:00
parent 9d7fbf4956
commit 47ba1cbf4b
3 changed files with 131 additions and 68 deletions
@@ -280,13 +280,12 @@ public class SettingTest extends ActivityInstrumentationTestCase2<TrackListActiv
// Changes the setting of default activity.
EndToEndTestUtils.SOLO.clickOnText(activityMyTracks
.getString(R.string.settings_recording_default_activity));
EndToEndTestUtils.hideSoftKeyBoard(EndToEndTestUtils.SOLO.getEditText(0),
activityMyTracks.getApplicationContext());
EndToEndTestUtils.SOLO.enterText(0, EndToEndTestUtils.DEFAULTACTIVITY);
if(!EndToEndTestUtils.isEmulator) {
// Close soft keyboard.
EndToEndTestUtils.SOLO.goBack();
}
EndToEndTestUtils.getButtonOnScreen(activityMyTracks.getString(R.string.generic_ok), true, true);
EndToEndTestUtils
.getButtonOnScreen(activityMyTracks.getString(R.string.generic_ok), true, true);
EndToEndTestUtils.SOLO.goBack();
EndToEndTestUtils.SOLO.goBack();
@@ -298,7 +297,6 @@ public class SettingTest extends ActivityInstrumentationTestCase2<TrackListActiv
R.string.track_name_format).split(" ")[0]));
assertTrue(EndToEndTestUtils.SOLO.searchText(EndToEndTestUtils.DEFAULTACTIVITY));
EndToEndTestUtils.SOLO.clickOnText(activityMyTracks.getString(R.string.generic_save));
}
@Override