Combine save and send to google into export.

This commit is contained in:
Jimmy Shih
2013-06-04 15:32:19 -07:00
parent 5a5b1431eb
commit f89c6696b3
32 changed files with 467 additions and 475 deletions
@@ -22,9 +22,6 @@ import com.google.android.maps.mytracks.R;
import android.app.Instrumentation;
import android.test.ActivityInstrumentationTestCase2;
import android.view.KeyEvent;
import android.widget.CheckBox;
import java.util.ArrayList;
/**
* Tests creating a track with markers, and editing and sending send a track.
@@ -48,41 +45,6 @@ public class CreateTrackTest extends ActivityInstrumentationTestCase2<TrackListA
EndToEndTestUtils.setupForAllTest(instrumentation, activityMyTracks);
}
/**
* Does not check any service and try to send to google.
*/
public void testCreateAndSendTrack_notSend() {
EndToEndTestUtils.createTrackIfEmpty(1, false);
instrumentation.waitForIdleSync();
EndToEndTestUtils.findMenuItem(activityMyTracks.getString(R.string.menu_export), true);
EndToEndTestUtils.SOLO.waitForText(activityMyTracks.getString(R.string.send_google_title));
EndToEndTestUtils.rotateCurrentActivity();
instrumentation.waitForIdleSync();
ArrayList<CheckBox> checkBoxs = EndToEndTestUtils.SOLO.getCurrentCheckBoxes();
for (int i = 0; i < checkBoxs.size(); i++) {
if (checkBoxs.get(i).isChecked()) {
EndToEndTestUtils.SOLO.clickOnCheckBox(i);
}
}
if (checkBoxs.size() < 3) {
EndToEndTestUtils.SOLO.scrollDown();
checkBoxs = EndToEndTestUtils.SOLO.getCurrentCheckBoxes();
for (int i = 0; i < checkBoxs.size(); i++) {
if (checkBoxs.get(i).isChecked()) {
EndToEndTestUtils.SOLO.clickOnCheckBox(i);
}
}
}
instrumentation.waitForIdleSync();
EndToEndTestUtils.SOLO.clickOnText(activityMyTracks.getString(R.string.send_google_send_now));
assertTrue(EndToEndTestUtils.SOLO.waitForText(activityMyTracks
.getString(R.string.send_google_no_service_selected)));
// Stop here for do not really send.
}
/**
* Tests editing a track.
*/
@@ -133,7 +133,7 @@ public class SendToGoogleTest extends ActivityInstrumentationTestCase2<TrackList
*/
private boolean sendToGoogle() {
EndToEndTestUtils.findMenuItem(activityMyTracks.getString(R.string.menu_export), true);
EndToEndTestUtils.SOLO.waitForText(activityMyTracks.getString(R.string.send_google_title));
EndToEndTestUtils.SOLO.waitForText(activityMyTracks.getString(R.string.export_dialog_title));
instrumentation.waitForIdleSync();
ArrayList<CheckBox> checkBoxs = EndToEndTestUtils.SOLO.getCurrentCheckBoxes();
for (int i = 0; i < checkBoxs.size(); i++) {
@@ -155,7 +155,7 @@ public class SendToGoogleTest extends ActivityInstrumentationTestCase2<TrackList
}
}
instrumentation.waitForIdleSync();
EndToEndTestUtils.getButtonOnScreen(activityMyTracks.getString(R.string.send_google_send_now),
EndToEndTestUtils.getButtonOnScreen(activityMyTracks.getString(R.string.menu_export),
true, true);
instrumentation.waitForIdleSync();