mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 03:02:15 -05:00
update instrumentation test to JUnit4
This commit is contained in:
parent
46e75a085e
commit
442aed8a2d
@ -143,9 +143,8 @@ android {
|
||||
// Reference them in .xml files.
|
||||
resValue "string", "account_type", "org.sufficientlysecure.keychain.debug.account"
|
||||
|
||||
// Disabled: only works for androidTest not test!
|
||||
// Enable code coverage (Jacoco)
|
||||
//testCoverageEnabled true
|
||||
testCoverageEnabled true
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,11 +17,16 @@
|
||||
|
||||
package org.sufficientlysecure.keychain;
|
||||
|
||||
import android.support.test.InstrumentationRegistry;
|
||||
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.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.sufficientlysecure.keychain.ui.CreateKeyActivity;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
@ -40,6 +45,7 @@ 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)
|
||||
@LargeTest
|
||||
public class CreateKeyActivityTest extends ActivityInstrumentationTestCase2<CreateKeyActivity> {
|
||||
|
||||
@ -52,12 +58,14 @@ public class CreateKeyActivityTest extends ActivityInstrumentationTestCase2<Crea
|
||||
super(CreateKeyActivity.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
injectInstrumentation(InstrumentationRegistry.getInstrumentation());
|
||||
getActivity();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateMyKey() {
|
||||
// Clicks create my key
|
||||
onView(withId(R.id.create_key_create_key_button))
|
||||
|
Loading…
Reference in New Issue
Block a user