forked from upstream-mirrors/OpenTracks
Fix errors of e2e tests.
This commit is contained in:
@@ -259,6 +259,7 @@ public class EndToEndTestUtils {
|
||||
deleteAllTracks();
|
||||
resetAllSettings(activityMyTracks, false);
|
||||
|
||||
instrumentation.waitForIdleSync();
|
||||
// Check the status of real phone. For emulator, we would fix GPS signal.
|
||||
if(!isEmulator) {
|
||||
GoToMyLocationTest.findAndClickMyLocation(activityMyTracks);
|
||||
|
||||
@@ -349,10 +349,9 @@ public class GoogleUtils {
|
||||
for (String row : rowsTable) {
|
||||
String firstColumn = row.split(",")[0];
|
||||
String secondColumn = row.split(",")[1];
|
||||
// If the first column is all figure, it is the table id.
|
||||
String regularExpression = "^[0-9]*$";
|
||||
if (firstColumn.matches(regularExpression) && secondColumn.equals(title)) {
|
||||
sendFusionTableQuery("DROP TABLE " + row.split(",")[0], context);
|
||||
// The first column is the table id.
|
||||
if (secondColumn.equals(title)) {
|
||||
sendFusionTableQuery("DROP TABLE " + firstColumn, context);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
+11
-5
@@ -77,12 +77,17 @@ public class SendToGoogleTest extends ActivityInstrumentationTestCase2<TrackList
|
||||
String testActivity = "(TestActivity)";
|
||||
EndToEndTestUtils.activityType = testActivity;
|
||||
EndToEndTestUtils.createSimpleTrack(1, false);
|
||||
sendToGoogle();
|
||||
sendToGoogle();
|
||||
boolean result = sendToGoogle();
|
||||
result = result && sendToGoogle();
|
||||
|
||||
List<Entry> spreadsheetEntry = GoogleUtils.searchAllSpreadsheetByTitle(GoogleUtils.DOCUMENT_NAME_PREFIX + "-"
|
||||
+ EndToEndTestUtils.activityType, activityMyTracks);
|
||||
assertEquals(1, spreadsheetEntry.size());
|
||||
// Result is true mean has account bound with this device and send
|
||||
// successful.
|
||||
if (result) {
|
||||
List<Entry> spreadsheetEntry = GoogleUtils
|
||||
.searchAllSpreadsheetByTitle(GoogleUtils.DOCUMENT_NAME_PREFIX + "-"
|
||||
+ EndToEndTestUtils.activityType, activityMyTracks);
|
||||
assertEquals(1, spreadsheetEntry.size());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -154,6 +159,7 @@ public class SendToGoogleTest extends ActivityInstrumentationTestCase2<TrackList
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
EndToEndTestUtils.activityType = EndToEndTestUtils.DEFAULTACTIVITYTYPE;
|
||||
EndToEndTestUtils.SOLO.finishOpenedActivities();
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user