Fixed ui tests

This commit is contained in:
daniel oeh 2014-07-06 13:49:02 +02:00
parent fb1fcb0600
commit f59623bb94
4 changed files with 10 additions and 3 deletions

View File

@ -29,7 +29,7 @@ dependencies {
compile 'com.nineoldandroids:library:2.4.0'
compile project(':submodules:dslv:library')
compile 'com.jayway.android.robotium:robotium-solo:5.1'
compile 'com.jayway.android.robotium:robotium-solo:5.2.1'
compile ("com.doomonafireball.betterpickers:library:1.5.2") {
exclude group: 'com.android.support', module: 'support-v4'
}

View File

@ -66,7 +66,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
public void testClickNavDrawer() throws Exception {
uiTestUtils.addLocalFeedData(false);
final View home = solo.getView(R.id.home);
final View home = solo.getView(UITestUtils.HOME_VIEW);
// all episodes
solo.waitForView(android.R.id.list);

View File

@ -78,7 +78,7 @@ public class PlaybackTest extends ActivityInstrumentationTestCase2<MainActivity>
private void startLocalPlaybackFromQueue() {
assertTrue(solo.waitForActivity(MainActivity.class));
solo.clickOnView(solo.getView(R.id.home));
solo.clickOnView(solo.getView(UITestUtils.HOME_VIEW));
solo.clickOnText(solo.getString(R.string.queue_label));
assertTrue(solo.waitForView(solo.getView(R.id.butSecondaryAction)));
solo.clickOnImageButton(0);

View File

@ -1,7 +1,11 @@
package instrumentationTest.de.test.antennapod.ui;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Build;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.feed.*;
import de.danoeh.antennapod.storage.DBWriter;
import de.danoeh.antennapod.storage.PodDBAdapter;
@ -24,6 +28,7 @@ import java.util.List;
* Utility methods for UI tests.
* Starts a web server that hosts feeds, episodes and images.
*/
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public class UITestUtils {
private static final String DATA_FOLDER = "test/UITestUtils";
@ -31,6 +36,8 @@ public class UITestUtils {
public static final int NUM_FEEDS = 5;
public static final int NUM_ITEMS_PER_FEED = 10;
public static final int HOME_VIEW = (Build.VERSION.SDK_INT >= 11) ? android.R.id.home : R.id.home;
private Context context;
private HTTPBin server = new HTTPBin();