From ff836c41e90deeb735f5b7b9c9e88872b9cb68fe Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Sat, 5 Apr 2014 20:30:31 +0200 Subject: Update Robotium library Also, reenable the test. It will be disabled again if it does not work reliably on the continuous integration server. --- tests/libs/docs/robotium-solo-3.6-javadoc.jar | Bin 42583 -> 0 bytes tests/libs/docs/robotium-solo-5.1-javadoc.jar | Bin 0 -> 82789 bytes tests/libs/robotium-solo-3.6.jar | Bin 59067 -> 0 bytes tests/libs/robotium-solo-3.6.jar.properties | 1 - tests/libs/robotium-solo-5.1.jar | Bin 0 -> 112036 bytes tests/libs/robotium-solo-5.1.jar.properties | 1 + .../geocaching/files/SimpleDirChooserUITest.java | 33 ++++++++++++--------- 7 files changed, 20 insertions(+), 15 deletions(-) delete mode 100644 tests/libs/docs/robotium-solo-3.6-javadoc.jar create mode 100644 tests/libs/docs/robotium-solo-5.1-javadoc.jar delete mode 100644 tests/libs/robotium-solo-3.6.jar delete mode 100644 tests/libs/robotium-solo-3.6.jar.properties create mode 100644 tests/libs/robotium-solo-5.1.jar create mode 100644 tests/libs/robotium-solo-5.1.jar.properties diff --git a/tests/libs/docs/robotium-solo-3.6-javadoc.jar b/tests/libs/docs/robotium-solo-3.6-javadoc.jar deleted file mode 100644 index db4e75b..0000000 Binary files a/tests/libs/docs/robotium-solo-3.6-javadoc.jar and /dev/null differ diff --git a/tests/libs/docs/robotium-solo-5.1-javadoc.jar b/tests/libs/docs/robotium-solo-5.1-javadoc.jar new file mode 100644 index 0000000..92ebff2 Binary files /dev/null and b/tests/libs/docs/robotium-solo-5.1-javadoc.jar differ diff --git a/tests/libs/robotium-solo-3.6.jar b/tests/libs/robotium-solo-3.6.jar deleted file mode 100644 index 4280906..0000000 Binary files a/tests/libs/robotium-solo-3.6.jar and /dev/null differ diff --git a/tests/libs/robotium-solo-3.6.jar.properties b/tests/libs/robotium-solo-3.6.jar.properties deleted file mode 100644 index 10e60fa..0000000 --- a/tests/libs/robotium-solo-3.6.jar.properties +++ /dev/null @@ -1 +0,0 @@ -doc=./docs/robotium-solo-3.6-javadoc.jar \ No newline at end of file diff --git a/tests/libs/robotium-solo-5.1.jar b/tests/libs/robotium-solo-5.1.jar new file mode 100644 index 0000000..1931dd9 Binary files /dev/null and b/tests/libs/robotium-solo-5.1.jar differ diff --git a/tests/libs/robotium-solo-5.1.jar.properties b/tests/libs/robotium-solo-5.1.jar.properties new file mode 100644 index 0000000..9df11e1 --- /dev/null +++ b/tests/libs/robotium-solo-5.1.jar.properties @@ -0,0 +1 @@ +doc=./docs/robotium-solo-5.1-javadoc.jar \ No newline at end of file diff --git a/tests/src/cgeo/geocaching/files/SimpleDirChooserUITest.java b/tests/src/cgeo/geocaching/files/SimpleDirChooserUITest.java index 05b4ee1..985733a 100644 --- a/tests/src/cgeo/geocaching/files/SimpleDirChooserUITest.java +++ b/tests/src/cgeo/geocaching/files/SimpleDirChooserUITest.java @@ -1,18 +1,18 @@ package cgeo.geocaching.files; -import com.jayway.android.robotium.solo.Solo; +import cgeo.geocaching.Intents; + +import com.robotium.solo.Solo; import android.annotation.TargetApi; +import android.content.Intent; import android.os.Build; import android.test.ActivityInstrumentationTestCase2; -import android.test.suitebuilder.annotation.Suppress; import android.widget.CheckBox; import java.util.ArrayList; @TargetApi(Build.VERSION_CODES.FROYO) -@Suppress() -/* This test breaks the continuous integration server, do not run it for now. */ public class SimpleDirChooserUITest extends ActivityInstrumentationTestCase2 { private Solo solo; @@ -24,9 +24,14 @@ public class SimpleDirChooserUITest extends ActivityInstrumentationTestCase2 getCurrentCheckBoxes() { + return solo.getCurrentViews(CheckBox.class); + } + public void testSingleSelection() throws InterruptedException { // normally our activity should be ready, but we already had Jenkins report no checkboxes right here at the beginning solo.waitForActivity(solo.getCurrentActivity().getClass().getSimpleName(), 2000); @@ -37,11 +42,11 @@ public class SimpleDirChooserUITest extends ActivityInstrumentationTestCase2 boxes = solo.getCurrentCheckBoxes(); + final ArrayList boxes = getCurrentCheckBoxes(); assertNotNull("Could not get checkboxes", boxes); assertTrue("There are no checkboxes", boxes.size() > 1); - for (CheckBox checkBox : boxes) { - if (checkBox.isChecked()) { + int checked = 0; + for (int i = 0; i < boxes.size(); i++) { + if (solo.isCheckBoxChecked(i)) { checked++; } } -- cgit v1.1