From 8f367b7210dc2883b91f8ef1538ce86013fc096a Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Sat, 13 Jun 2015 21:50:57 +0200 Subject: fix instrumentation test(s) --- .../keychain/CreateKeyActivityTest.java | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'OpenKeychain/src/androidTest') diff --git a/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/CreateKeyActivityTest.java b/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/CreateKeyActivityTest.java index c3741fdef..a20b61cf3 100644 --- a/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/CreateKeyActivityTest.java +++ b/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/CreateKeyActivityTest.java @@ -17,14 +17,11 @@ package org.sufficientlysecure.keychain; -import android.support.test.rule.ActivityTestRule; -import android.support.test.runner.AndroidJUnit4; +import android.test.ActivityInstrumentationTestCase2; +import android.test.suitebuilder.annotation.LargeTest; import android.text.method.HideReturnsTransformationMethod; import android.text.method.PasswordTransformationMethod; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; import org.sufficientlysecure.keychain.ui.CreateKeyActivity; import static android.support.test.espresso.Espresso.onView; @@ -43,18 +40,24 @@ import static org.hamcrest.Matchers.allOf; import static org.sufficientlysecure.keychain.matcher.EditTextMatchers.withError; import static org.sufficientlysecure.keychain.matcher.EditTextMatchers.withTransformationMethod; -@RunWith(AndroidJUnit4.class) -public class CreateKeyActivityTest { +@LargeTest +public class CreateKeyActivityTest extends ActivityInstrumentationTestCase2 { public static final String SAMPLE_NAME = "Sample Name"; public static final String SAMPLE_EMAIL = "sample_email@gmail.com"; public static final String SAMPLE_ADDITIONAL_EMAIL = "sample_additional_email@gmail.com"; public static final String SAMPLE_PASSWORD = "sample_password"; - @Rule - public ActivityTestRule mActivityRule = new ActivityTestRule<>(CreateKeyActivity.class); + public CreateKeyActivityTest() { + super(CreateKeyActivity.class); + } + + @Override + public void setUp() throws Exception { + super.setUp(); + getActivity(); + } - @Test public void testCreateMyKey() { // Clicks create my key onView(withId(R.id.create_key_create_key_button)) -- cgit v1.2.3