diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2015-06-18 13:19:44 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2015-06-18 13:19:44 +0200 |
commit | 0cfbe4ad06577715bfd9b16aa912a21cb9c64cbc (patch) | |
tree | 55e0fec27153eee44ad1865ee8f59a0557af41cb /OpenKeychain/src/androidTest/java/org | |
parent | 0cb868ff250e8d86a1a8f8ace79cc18e4cbc721e (diff) | |
parent | 2b26f293b8cb03a0b605e3a95365160f5c034329 (diff) | |
download | open-keychain-0cfbe4ad06577715bfd9b16aa912a21cb9c64cbc.tar.gz open-keychain-0cfbe4ad06577715bfd9b16aa912a21cb9c64cbc.tar.bz2 open-keychain-0cfbe4ad06577715bfd9b16aa912a21cb9c64cbc.zip |
Merge branch 'master' into v/multi-decrypt
Diffstat (limited to 'OpenKeychain/src/androidTest/java/org')
-rw-r--r-- | OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/CreateKeyActivityTest.java | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/CreateKeyActivityTest.java b/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/CreateKeyActivityTest.java index e81b312ac..049b389b5 100644 --- a/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/CreateKeyActivityTest.java +++ b/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/CreateKeyActivityTest.java @@ -17,17 +17,18 @@ package org.sufficientlysecure.keychain; -import android.support.test.InstrumentationRegistry; + +import android.content.Intent; +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.Before; +import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; -import org.sufficientlysecure.keychain.ui.CreateKeyActivity; +import org.sufficientlysecure.keychain.ui.MainActivity; import static android.support.test.espresso.Espresso.onView; import static android.support.test.espresso.action.ViewActions.click; @@ -47,25 +48,28 @@ import static org.sufficientlysecure.keychain.matcher.EditTextMatchers.withTrans @RunWith(AndroidJUnit4.class) @LargeTest -public class CreateKeyActivityTest extends ActivityInstrumentationTestCase2<CreateKeyActivity> { +public class CreateKeyActivityTest { 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"; - public CreateKeyActivityTest() { - super(CreateKeyActivity.class); - } - - @Before - public void setUp() throws Exception { - super.setUp(); - injectInstrumentation(InstrumentationRegistry.getInstrumentation()); - getActivity(); - } + @Rule + public final ActivityTestRule<MainActivity> mActivity + = new ActivityTestRule<MainActivity>(MainActivity.class) { + @Override + protected Intent getActivityIntent() { + Intent intent = super.getActivityIntent(); + intent.putExtra(MainActivity.EXTRA_SKIP_FIRST_TIME, true); + return intent; + } + }; public void testCreateMyKey() { + + mActivity.getActivity(); + // Clicks create my key onView(withId(R.id.create_key_create_key_button)) .perform(click()); |