diff --git a/src/androidTest/java/de/blau/android/gpx/GpxUploadTest.java b/src/androidTest/java/de/blau/android/gpx/GpxUploadTest.java index 17a16056f2..ec79963f4e 100644 --- a/src/androidTest/java/de/blau/android/gpx/GpxUploadTest.java +++ b/src/androidTest/java/de/blau/android/gpx/GpxUploadTest.java @@ -1,9 +1,11 @@ package de.blau.android.gpx; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; @@ -137,10 +139,30 @@ public void uploadGpx() { assertTrue(TestUtils.clickText(device, false, main.getString(R.string.Done), true, false)); UiObject2 menuButton = TestUtils.getLayerButton(device, GPX_FILE, LayerDialogTest.MENU_BUTTON); menuButton.click(); + assertTrue(TestUtils.clickText(device, false, main.getString(R.string.menu_information), true, false)); + assertTrue(TestUtils.findText(device, false, "112", 500, true)); + assertTrue(TestUtils.findText(device, false, "79", 500, true)); + assertTrue(TestUtils.clickText(device, false, main.getString(R.string.Done), true, false)); + assertTrue(TestUtils.clickText(device, false, main.getString(R.string.Done), true, false)); + menuButton = TestUtils.getLayerButton(device, GPX_FILE, LayerDialogTest.MENU_BUTTON); + menuButton.click(); assertTrue(TestUtils.clickText(device, false, main.getString(R.string.menu_gps_upload), true, false)); + mockServer.enqueue("userdetails"); mockServer.enqueue("200"); assertTrue(TestUtils.clickResource(device, false, "android:id/button1", true)); assertTrue(TestUtils.textGone(device, "Uploading", 5000)); + + try { + mockServer.takeRequest(); + String upload = mockServer.takeRequest().getUtf8Body(); + int gpxStart = upload.indexOf("