From e1d2a09207e53fa8c26d161f89e797612b093f94 Mon Sep 17 00:00:00 2001 From: youtaol Date: Sat, 8 Jun 2013 18:03:01 +0800 Subject: [PATCH] Change SendToGoogleTest to ExportSingleTrackTest. Fix strings change issues. --- .../endtoendtest/common/DeleteTest.java | 8 +- .../common/ExportAllAndImportAllTest.java | 8 +- ...leTest.java => ExportSingleTrackTest.java} | 96 ++++++++----------- 3 files changed, 46 insertions(+), 66 deletions(-) rename MyTracksTest_E2E/src/com/google/android/apps/mytracks/endtoendtest/common/{SendToGoogleTest.java => ExportSingleTrackTest.java} (66%) diff --git a/MyTracksTest_E2E/src/com/google/android/apps/mytracks/endtoendtest/common/DeleteTest.java b/MyTracksTest_E2E/src/com/google/android/apps/mytracks/endtoendtest/common/DeleteTest.java index 31f512a9a..e1ae72cb1 100644 --- a/MyTracksTest_E2E/src/com/google/android/apps/mytracks/endtoendtest/common/DeleteTest.java +++ b/MyTracksTest_E2E/src/com/google/android/apps/mytracks/endtoendtest/common/DeleteTest.java @@ -72,15 +72,13 @@ public class DeleteTest extends ActivityInstrumentationTestCase2 { +public class ExportSingleTrackTest extends ActivityInstrumentationTestCase2 { private Instrumentation instrumentation; private TrackListActivity activityMyTracks; - public SendToGoogleTest() { + public ExportSingleTrackTest() { super(TrackListActivity.class); } @@ -62,7 +45,7 @@ public class SendToGoogleTest extends ActivityInstrumentationTestCase2 checkBoxs = EndToEndTestUtils.SOLO.getCurrentCheckBoxes(); - for (int i = 0; i < checkBoxs.size(); i++) { - if (!checkBoxs.get(i).isChecked()) { - EndToEndTestUtils.SOLO.clickOnView(checkBoxs.get(i)); - instrumentation.waitForIdleSync(); - } - } - if (checkBoxs.size() < 4) { - EndToEndTestUtils.SOLO.scrollDown(); - checkBoxs = EndToEndTestUtils.SOLO.getCurrentCheckBoxes(); + EndToEndTestUtils.SOLO.clickOnText(exportDestination); - // Choose all Google service. - for (int i = 0; i < checkBoxs.size(); i++) { - if (!checkBoxs.get(i).isChecked()) { - EndToEndTestUtils.SOLO.clickOnCheckBox(i); - } - } - } instrumentation.waitForIdleSync(); - EndToEndTestUtils.getButtonOnScreen(activityMyTracks.getString(R.string.menu_export), - true, true); + EndToEndTestUtils.getButtonOnScreen(activityMyTracks.getString(R.string.menu_export), true, + true); instrumentation.waitForIdleSync(); if (!GoogleUtils.isAccountAvailable()) { return false; } - // Following check the process of "Send to Google". + // Following check the process of "Send to Google", the second condition is + // in case the export has done. assertTrue(EndToEndTestUtils.SOLO.waitForText(activityMyTracks - .getString(R.string.generic_progress_title))); + .getString(R.string.generic_progress_title)) + || EndToEndTestUtils.SOLO.waitForText(activityMyTracks + .getString(R.string.generic_success_title))); // Waiting the send is finish. Should double check it for the progress // dialog may disappear and display again while switch to next send(There @@ -178,9 +155,14 @@ public class SendToGoogleTest extends ActivityInstrumentationTestCase2