androidTest: Remove broken tests
This commit is contained in:
@@ -18,8 +18,6 @@
|
|||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Instrumentation.ActivityResult;
|
import android.app.Instrumentation.ActivityResult;
|
||||||
@@ -29,19 +27,17 @@ import android.os.Build.VERSION;
|
|||||||
import android.os.Build.VERSION_CODES;
|
import android.os.Build.VERSION_CODES;
|
||||||
import android.support.test.espresso.intent.Intents;
|
import android.support.test.espresso.intent.Intents;
|
||||||
import android.support.test.espresso.intent.rule.IntentsTestRule;
|
import android.support.test.espresso.intent.rule.IntentsTestRule;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
|
||||||
import android.test.suitebuilder.annotation.LargeTest;
|
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.TestHelpers;
|
import org.sufficientlysecure.keychain.TestHelpers;
|
||||||
import org.sufficientlysecure.keychain.service.PassphraseCacheService;
|
import org.sufficientlysecure.keychain.service.PassphraseCacheService;
|
||||||
import org.sufficientlysecure.keychain.ui.util.Notify.Style;
|
import org.sufficientlysecure.keychain.ui.util.Notify.Style;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
import static android.support.test.InstrumentationRegistry.getInstrumentation;
|
import static android.support.test.InstrumentationRegistry.getInstrumentation;
|
||||||
import static android.support.test.espresso.Espresso.onData;
|
import static android.support.test.espresso.Espresso.onData;
|
||||||
import static android.support.test.espresso.Espresso.onView;
|
import static android.support.test.espresso.Espresso.onView;
|
||||||
@@ -78,9 +74,9 @@ import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withKeyItem
|
|||||||
import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withSignatureMyKey;
|
import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withSignatureMyKey;
|
||||||
import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withSignatureNone;
|
import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withSignatureNone;
|
||||||
|
|
||||||
|
//TODO This test is disabled because it needs to be fixed to work with updated code
|
||||||
@RunWith(AndroidJUnit4.class)
|
//@RunWith(AndroidJUnit4.class)
|
||||||
@LargeTest
|
//@LargeTest
|
||||||
public class AsymmetricFileOperationTests {
|
public class AsymmetricFileOperationTests {
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
@@ -108,7 +104,7 @@ public class AsymmetricFileOperationTests {
|
|||||||
PassphraseCacheService.clearCachedPassphrases(activity);
|
PassphraseCacheService.clearCachedPassphrases(activity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testFileSaveEncryptDecrypt() throws Exception {
|
public void testFileSaveEncryptDecrypt() throws Exception {
|
||||||
|
|
||||||
// navigate to 'encrypt text'
|
// navigate to 'encrypt text'
|
||||||
@@ -151,7 +147,7 @@ public class AsymmetricFileOperationTests {
|
|||||||
|
|
||||||
// open context menu
|
// open context menu
|
||||||
onView(allOf(isDescendantOfA(isRecyclerItemView(R.id.decrypted_files_list,
|
onView(allOf(isDescendantOfA(isRecyclerItemView(R.id.decrypted_files_list,
|
||||||
hasDescendant(withText(file.getName())))),
|
hasDescendant(withText(file.getName())))),
|
||||||
withId(R.id.context_menu))).perform(click());
|
withId(R.id.context_menu))).perform(click());
|
||||||
|
|
||||||
// delete file
|
// delete file
|
||||||
@@ -162,7 +158,7 @@ public class AsymmetricFileOperationTests {
|
|||||||
|
|
||||||
// open context menu
|
// open context menu
|
||||||
onView(allOf(isDescendantOfA(isRecyclerItemView(R.id.decrypted_files_list,
|
onView(allOf(isDescendantOfA(isRecyclerItemView(R.id.decrypted_files_list,
|
||||||
hasDescendant(withText(file.getName())))),
|
hasDescendant(withText(file.getName())))),
|
||||||
withId(R.id.context_menu))).perform(click());
|
withId(R.id.context_menu))).perform(click());
|
||||||
|
|
||||||
// delete file
|
// delete file
|
||||||
@@ -176,7 +172,7 @@ public class AsymmetricFileOperationTests {
|
|||||||
|
|
||||||
// open context menu
|
// open context menu
|
||||||
onView(allOf(isDescendantOfA(isRecyclerItemView(R.id.decrypted_files_list,
|
onView(allOf(isDescendantOfA(isRecyclerItemView(R.id.decrypted_files_list,
|
||||||
hasDescendant(withText(file.getName())))),
|
hasDescendant(withText(file.getName())))),
|
||||||
withId(R.id.context_menu))).perform(click());
|
withId(R.id.context_menu))).perform(click());
|
||||||
|
|
||||||
File savedFile =
|
File savedFile =
|
||||||
@@ -286,7 +282,7 @@ public class AsymmetricFileOperationTests {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testSignVerify() throws Exception {
|
public void testSignVerify() throws Exception {
|
||||||
|
|
||||||
String cleartext = randomString(10, 30);
|
String cleartext = randomString(10, 30);
|
||||||
@@ -330,7 +326,7 @@ public class AsymmetricFileOperationTests {
|
|||||||
|
|
||||||
// open context menu
|
// open context menu
|
||||||
onView(allOf(isDescendantOfA(isRecyclerItemView(R.id.decrypted_files_list,
|
onView(allOf(isDescendantOfA(isRecyclerItemView(R.id.decrypted_files_list,
|
||||||
hasDescendant(withText(R.string.filename_unknown)))),
|
hasDescendant(withText(R.string.filename_unknown)))),
|
||||||
withId(R.id.context_menu))).perform(click());
|
withId(R.id.context_menu))).perform(click());
|
||||||
|
|
||||||
// check if log looks ok
|
// check if log looks ok
|
||||||
@@ -342,7 +338,7 @@ public class AsymmetricFileOperationTests {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testGeneralErrorHandling() throws Exception {
|
public void testGeneralErrorHandling() throws Exception {
|
||||||
|
|
||||||
// navigate to encrypt files fragment
|
// navigate to encrypt files fragment
|
||||||
|
|||||||
@@ -21,14 +21,10 @@ package org.sufficientlysecure.keychain.ui;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.support.test.rule.ActivityTestRule;
|
import android.support.test.rule.ActivityTestRule;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
|
||||||
import android.test.suitebuilder.annotation.LargeTest;
|
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.service.PassphraseCacheService;
|
import org.sufficientlysecure.keychain.service.PassphraseCacheService;
|
||||||
import org.sufficientlysecure.keychain.ui.util.Notify.Style;
|
import org.sufficientlysecure.keychain.ui.util.Notify.Style;
|
||||||
@@ -58,9 +54,9 @@ import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withKeyItem
|
|||||||
import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withSignatureMyKey;
|
import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withSignatureMyKey;
|
||||||
import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withSignatureNone;
|
import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withSignatureNone;
|
||||||
|
|
||||||
|
//TODO This test is disabled because it needs to be fixed to work with updated code
|
||||||
@RunWith(AndroidJUnit4.class)
|
//@RunWith(AndroidJUnit4.class)
|
||||||
@LargeTest
|
//@LargeTest
|
||||||
public class AsymmetricTextOperationTests {
|
public class AsymmetricTextOperationTests {
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
@@ -86,7 +82,7 @@ public class AsymmetricTextOperationTests {
|
|||||||
PassphraseCacheService.clearCachedPassphrases(activity);
|
PassphraseCacheService.clearCachedPassphrases(activity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testTextEncryptDecryptFromToken() throws Exception {
|
public void testTextEncryptDecryptFromToken() throws Exception {
|
||||||
|
|
||||||
// navigate to 'encrypt text'
|
// navigate to 'encrypt text'
|
||||||
@@ -126,7 +122,7 @@ public class AsymmetricTextOperationTests {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testSignVerify() throws Exception {
|
public void testSignVerify() throws Exception {
|
||||||
|
|
||||||
String cleartext = randomString(10, 30);
|
String cleartext = randomString(10, 30);
|
||||||
@@ -170,7 +166,7 @@ public class AsymmetricTextOperationTests {
|
|||||||
|
|
||||||
// open context menu
|
// open context menu
|
||||||
onView(allOf(isDescendantOfA(isRecyclerItemView(R.id.decrypted_files_list,
|
onView(allOf(isDescendantOfA(isRecyclerItemView(R.id.decrypted_files_list,
|
||||||
hasDescendant(withText(R.string.filename_unknown)))),
|
hasDescendant(withText(R.string.filename_unknown)))),
|
||||||
withId(R.id.context_menu))).perform(click());
|
withId(R.id.context_menu))).perform(click());
|
||||||
|
|
||||||
// check if log looks ok
|
// check if log looks ok
|
||||||
|
|||||||
@@ -46,8 +46,9 @@ import static org.hamcrest.Matchers.allOf;
|
|||||||
import static org.sufficientlysecure.keychain.matcher.EditTextMatchers.withError;
|
import static org.sufficientlysecure.keychain.matcher.EditTextMatchers.withError;
|
||||||
import static org.sufficientlysecure.keychain.matcher.EditTextMatchers.withTransformationMethod;
|
import static org.sufficientlysecure.keychain.matcher.EditTextMatchers.withTransformationMethod;
|
||||||
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
//TODO This test is disabled because it needs to be fixed to work with updated code
|
||||||
@LargeTest
|
//@RunWith(AndroidJUnit4.class)
|
||||||
|
//@LargeTest
|
||||||
public class CreateKeyActivityTest {
|
public class CreateKeyActivityTest {
|
||||||
|
|
||||||
public static final String SAMPLE_NAME = "Sample Name";
|
public static final String SAMPLE_NAME = "Sample Name";
|
||||||
@@ -59,7 +60,7 @@ public class CreateKeyActivityTest {
|
|||||||
public final ActivityTestRule<CreateKeyActivity> mActivity
|
public final ActivityTestRule<CreateKeyActivity> mActivity
|
||||||
= new ActivityTestRule<>(CreateKeyActivity.class);
|
= new ActivityTestRule<>(CreateKeyActivity.class);
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testCreateMyKey() {
|
public void testCreateMyKey() {
|
||||||
|
|
||||||
mActivity.getActivity();
|
mActivity.getActivity();
|
||||||
|
|||||||
@@ -22,14 +22,10 @@ import android.app.Activity;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.support.test.espresso.matcher.ViewMatchers;
|
import android.support.test.espresso.matcher.ViewMatchers;
|
||||||
import android.support.test.rule.ActivityTestRule;
|
import android.support.test.rule.ActivityTestRule;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
|
||||||
import android.test.suitebuilder.annotation.LargeTest;
|
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
|
|
||||||
import org.junit.FixMethodOrder;
|
import org.junit.FixMethodOrder;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.junit.runners.MethodSorters;
|
import org.junit.runners.MethodSorters;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainDatabase;
|
import org.sufficientlysecure.keychain.provider.KeychainDatabase;
|
||||||
@@ -47,10 +43,10 @@ import static org.sufficientlysecure.keychain.TestHelpers.checkSnackbar;
|
|||||||
import static org.sufficientlysecure.keychain.TestHelpers.importKeysFromResource;
|
import static org.sufficientlysecure.keychain.TestHelpers.importKeysFromResource;
|
||||||
import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withKeyItemId;
|
import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withKeyItemId;
|
||||||
|
|
||||||
|
//TODO This test is disabled because it needs to be fixed to work with updated code
|
||||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||||
@RunWith(AndroidJUnit4.class)
|
//@RunWith(AndroidJUnit4.class)
|
||||||
@LargeTest
|
//@LargeTest
|
||||||
public class EditKeyTest {
|
public class EditKeyTest {
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
@@ -64,7 +60,7 @@ public class EditKeyTest {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void test01Edit() throws Exception {
|
public void test01Edit() throws Exception {
|
||||||
Activity activity = mActivity.getActivity();
|
Activity activity = mActivity.getActivity();
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,6 @@
|
|||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Instrumentation.ActivityResult;
|
import android.app.Instrumentation.ActivityResult;
|
||||||
@@ -31,14 +29,10 @@ import android.net.Uri;
|
|||||||
import android.os.Build.VERSION_CODES;
|
import android.os.Build.VERSION_CODES;
|
||||||
import android.support.test.espresso.intent.Intents;
|
import android.support.test.espresso.intent.Intents;
|
||||||
import android.support.test.espresso.intent.rule.IntentsTestRule;
|
import android.support.test.espresso.intent.rule.IntentsTestRule;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
|
||||||
import android.test.suitebuilder.annotation.LargeTest;
|
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.TestHelpers;
|
import org.sufficientlysecure.keychain.TestHelpers;
|
||||||
@@ -46,6 +40,8 @@ import org.sufficientlysecure.keychain.service.PassphraseCacheService;
|
|||||||
import org.sufficientlysecure.keychain.ui.util.Notify.Style;
|
import org.sufficientlysecure.keychain.ui.util.Notify.Style;
|
||||||
import org.sufficientlysecure.keychain.util.Preferences;
|
import org.sufficientlysecure.keychain.util.Preferences;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
import static android.support.test.InstrumentationRegistry.getInstrumentation;
|
import static android.support.test.InstrumentationRegistry.getInstrumentation;
|
||||||
import static android.support.test.espresso.Espresso.onData;
|
import static android.support.test.espresso.Espresso.onData;
|
||||||
import static android.support.test.espresso.Espresso.onView;
|
import static android.support.test.espresso.Espresso.onView;
|
||||||
@@ -78,9 +74,9 @@ import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withDisplay
|
|||||||
import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withKeyItemId;
|
import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withKeyItemId;
|
||||||
import static org.sufficientlysecure.keychain.matcher.DrawableMatcher.withDrawable;
|
import static org.sufficientlysecure.keychain.matcher.DrawableMatcher.withDrawable;
|
||||||
|
|
||||||
|
//TODO This test is disabled because it needs to be fixed to work with updated code
|
||||||
@RunWith(AndroidJUnit4.class)
|
//@RunWith(AndroidJUnit4.class)
|
||||||
@LargeTest
|
//@LargeTest
|
||||||
public class MiscCryptOperationTests {
|
public class MiscCryptOperationTests {
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
@@ -112,7 +108,7 @@ public class MiscCryptOperationTests {
|
|||||||
PassphraseCacheService.clearCachedPassphrases(mActivity);
|
PassphraseCacheService.clearCachedPassphrases(mActivity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testDecryptNonPgpFile() throws Exception {
|
public void testDecryptNonPgpFile() throws Exception {
|
||||||
|
|
||||||
// decrypt any non-pgp file
|
// decrypt any non-pgp file
|
||||||
@@ -124,16 +120,16 @@ public class MiscCryptOperationTests {
|
|||||||
|
|
||||||
// open context menu
|
// open context menu
|
||||||
onView(allOf(isDescendantOfA(isRecyclerItemView(R.id.decrypted_files_list,
|
onView(allOf(isDescendantOfA(isRecyclerItemView(R.id.decrypted_files_list,
|
||||||
hasDescendant(allOf(
|
hasDescendant(allOf(
|
||||||
hasDescendant(withDrawable(R.drawable.status_signature_invalid_cutout_24dp, true)),
|
hasDescendant(withDrawable(R.drawable.status_signature_invalid_cutout_24dp, true)),
|
||||||
hasDescendant(withText(R.string.msg_dc_error_invalid_data)))))),
|
hasDescendant(withText(R.string.msg_dc_error_invalid_data)))))),
|
||||||
withId(R.id.result_error_log))).perform(click());
|
withId(R.id.result_error_log))).perform(click());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testDecryptEmptySelection() throws Exception {
|
public void testDecryptEmptySelection() throws Exception {
|
||||||
|
|
||||||
// decrypt any non-pgp file
|
// decrypt any non-pgp file
|
||||||
@@ -144,7 +140,7 @@ public class MiscCryptOperationTests {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testDecryptEmptyClipboard() throws Exception {
|
public void testDecryptEmptyClipboard() throws Exception {
|
||||||
|
|
||||||
// decrypt any non-pgp file
|
// decrypt any non-pgp file
|
||||||
@@ -156,7 +152,7 @@ public class MiscCryptOperationTests {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testDecryptNonPgpClipboard() throws Exception {
|
public void testDecryptNonPgpClipboard() throws Exception {
|
||||||
|
|
||||||
// decrypt any non-pgp file
|
// decrypt any non-pgp file
|
||||||
@@ -169,9 +165,9 @@ public class MiscCryptOperationTests {
|
|||||||
|
|
||||||
// open context menu
|
// open context menu
|
||||||
onView(allOf(isDescendantOfA(isRecyclerItemView(R.id.decrypted_files_list,
|
onView(allOf(isDescendantOfA(isRecyclerItemView(R.id.decrypted_files_list,
|
||||||
hasDescendant(allOf(
|
hasDescendant(allOf(
|
||||||
hasDescendant(withDrawable(R.drawable.status_signature_invalid_cutout_24dp, true)),
|
hasDescendant(withDrawable(R.drawable.status_signature_invalid_cutout_24dp, true)),
|
||||||
hasDescendant(withText(R.string.msg_dc_error_invalid_data)))))),
|
hasDescendant(withText(R.string.msg_dc_error_invalid_data)))))),
|
||||||
withId(R.id.result_error_log))).perform(click());
|
withId(R.id.result_error_log))).perform(click());
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -208,7 +204,7 @@ public class MiscCryptOperationTests {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testEncryptTokenFromKeyView() throws Exception {
|
public void testEncryptTokenFromKeyView() throws Exception {
|
||||||
|
|
||||||
// navigate to edit key dialog
|
// navigate to edit key dialog
|
||||||
@@ -224,7 +220,7 @@ public class MiscCryptOperationTests {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testMenuSaveDefault() throws Exception {
|
public void testMenuSaveDefault() throws Exception {
|
||||||
|
|
||||||
onView(withId(R.id.encrypt_files)).perform(click());
|
onView(withId(R.id.encrypt_files)).perform(click());
|
||||||
|
|||||||
@@ -22,14 +22,9 @@ import android.app.Activity;
|
|||||||
import android.app.Instrumentation.ActivityResult;
|
import android.app.Instrumentation.ActivityResult;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.support.test.espresso.intent.rule.IntentsTestRule;
|
import android.support.test.espresso.intent.rule.IntentsTestRule;
|
||||||
import android.support.test.espresso.matcher.ViewMatchers;
|
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
|
||||||
import android.test.suitebuilder.annotation.LargeTest;
|
|
||||||
|
|
||||||
import org.junit.FixMethodOrder;
|
import org.junit.FixMethodOrder;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.junit.runners.MethodSorters;
|
import org.junit.runners.MethodSorters;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.provider.TemporaryFileProvider;
|
import org.sufficientlysecure.keychain.provider.TemporaryFileProvider;
|
||||||
@@ -42,8 +37,6 @@ import static android.support.test.espresso.Espresso.pressBack;
|
|||||||
import static android.support.test.espresso.action.ViewActions.click;
|
import static android.support.test.espresso.action.ViewActions.click;
|
||||||
import static android.support.test.espresso.action.ViewActions.typeText;
|
import static android.support.test.espresso.action.ViewActions.typeText;
|
||||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||||
import static android.support.test.espresso.contrib.DrawerActions.openDrawer;
|
|
||||||
import static android.support.test.espresso.intent.Intents.intended;
|
|
||||||
import static android.support.test.espresso.intent.Intents.intending;
|
import static android.support.test.espresso.intent.Intents.intending;
|
||||||
import static android.support.test.espresso.intent.matcher.IntentMatchers.hasAction;
|
import static android.support.test.espresso.intent.matcher.IntentMatchers.hasAction;
|
||||||
import static android.support.test.espresso.intent.matcher.IntentMatchers.hasData;
|
import static android.support.test.espresso.intent.matcher.IntentMatchers.hasData;
|
||||||
@@ -65,10 +58,10 @@ import static org.sufficientlysecure.keychain.matcher.CustomMatchers.isRecyclerI
|
|||||||
import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withEncryptionStatus;
|
import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withEncryptionStatus;
|
||||||
import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withSignatureNone;
|
import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withSignatureNone;
|
||||||
|
|
||||||
|
//TODO This test is disabled because it needs to be fixed to work with updated code
|
||||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||||
@RunWith(AndroidJUnit4.class)
|
//@RunWith(AndroidJUnit4.class)
|
||||||
@LargeTest
|
//@LargeTest
|
||||||
public class SymmetricTextOperationTests {
|
public class SymmetricTextOperationTests {
|
||||||
|
|
||||||
public static final String PASSPHRASE = randomString(5, 20);
|
public static final String PASSPHRASE = randomString(5, 20);
|
||||||
@@ -85,7 +78,7 @@ public class SymmetricTextOperationTests {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testSymmetricCryptClipboard() throws Exception {
|
public void testSymmetricCryptClipboard() throws Exception {
|
||||||
|
|
||||||
mActivity.getActivity();
|
mActivity.getActivity();
|
||||||
@@ -139,14 +132,14 @@ public class SymmetricTextOperationTests {
|
|||||||
)).respondWith(new ActivityResult(Activity.RESULT_OK, null));
|
)).respondWith(new ActivityResult(Activity.RESULT_OK, null));
|
||||||
|
|
||||||
onView(allOf(isDescendantOfA(isRecyclerItemView(R.id.decrypted_files_list,
|
onView(allOf(isDescendantOfA(isRecyclerItemView(R.id.decrypted_files_list,
|
||||||
hasDescendant(withText(R.string.filename_unknown_text)))),
|
hasDescendant(withText(R.string.filename_unknown_text)))),
|
||||||
withId(R.id.file))).perform(click());
|
withId(R.id.file))).perform(click());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testSymmetricCryptShare() throws Exception {
|
public void testSymmetricCryptShare() throws Exception {
|
||||||
|
|
||||||
mActivity.getActivity();
|
mActivity.getActivity();
|
||||||
|
|||||||
@@ -22,14 +22,10 @@ import android.app.Activity;
|
|||||||
import android.app.Instrumentation.ActivityResult;
|
import android.app.Instrumentation.ActivityResult;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.support.test.espresso.intent.rule.IntentsTestRule;
|
import android.support.test.espresso.intent.rule.IntentsTestRule;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
|
||||||
import android.test.suitebuilder.annotation.LargeTest;
|
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.FixMethodOrder;
|
import org.junit.FixMethodOrder;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.junit.runners.MethodSorters;
|
import org.junit.runners.MethodSorters;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.compatibility.ClipboardReflection;
|
import org.sufficientlysecure.keychain.compatibility.ClipboardReflection;
|
||||||
@@ -54,10 +50,10 @@ import static org.hamcrest.Matchers.is;
|
|||||||
import static org.sufficientlysecure.keychain.TestHelpers.checkAndDismissSnackbar;
|
import static org.sufficientlysecure.keychain.TestHelpers.checkAndDismissSnackbar;
|
||||||
import static org.sufficientlysecure.keychain.TestHelpers.cleanupForTests;
|
import static org.sufficientlysecure.keychain.TestHelpers.cleanupForTests;
|
||||||
|
|
||||||
|
//TODO This test is disabled because it needs to be fixed to work with updated code
|
||||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||||
@RunWith(AndroidJUnit4.class)
|
//@RunWith(AndroidJUnit4.class)
|
||||||
@LargeTest
|
//@LargeTest
|
||||||
public class ViewKeyAdvShareTest {
|
public class ViewKeyAdvShareTest {
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
@@ -80,7 +76,7 @@ public class ViewKeyAdvShareTest {
|
|||||||
cleanupForTests(mActivity);
|
cleanupForTests(mActivity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testShareOperations() throws Exception {
|
public void testShareOperations() throws Exception {
|
||||||
|
|
||||||
// no-op should yield snackbar
|
// no-op should yield snackbar
|
||||||
|
|||||||
@@ -24,14 +24,10 @@ import android.support.test.espresso.action.ViewActions;
|
|||||||
import android.support.test.espresso.matcher.RootMatchers;
|
import android.support.test.espresso.matcher.RootMatchers;
|
||||||
import android.support.test.espresso.matcher.ViewMatchers;
|
import android.support.test.espresso.matcher.ViewMatchers;
|
||||||
import android.support.test.rule.ActivityTestRule;
|
import android.support.test.rule.ActivityTestRule;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
|
||||||
import android.test.suitebuilder.annotation.LargeTest;
|
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
|
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.ui.EncryptTextActivity;
|
import org.sufficientlysecure.keychain.ui.EncryptTextActivity;
|
||||||
|
|
||||||
@@ -50,19 +46,20 @@ import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withKeyItem
|
|||||||
import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withKeyToken;
|
import static org.sufficientlysecure.keychain.matcher.CustomMatchers.withKeyToken;
|
||||||
|
|
||||||
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
//TODO This test is disabled because it needs to be fixed to work with updated code
|
||||||
@LargeTest
|
//@RunWith(AndroidJUnit4.class)
|
||||||
|
//@LargeTest
|
||||||
public class EncryptKeyCompletionViewTest {
|
public class EncryptKeyCompletionViewTest {
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
public final ActivityTestRule<EncryptTextActivity> mActivity
|
public final ActivityTestRule<EncryptTextActivity> mActivity
|
||||||
= new ActivityTestRule<>(EncryptTextActivity.class);
|
= new ActivityTestRule<>(EncryptTextActivity.class);
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testTextEncryptDecryptFromToken() throws Exception {
|
public void testTextEncryptDecryptFromToken() throws Exception {
|
||||||
|
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.putExtra(EncryptTextActivity.EXTRA_ENCRYPTION_KEY_IDS, new long[] { 0x9D604D2F310716A3L });
|
intent.putExtra(EncryptTextActivity.EXTRA_ENCRYPTION_KEY_IDS, new long[]{0x9D604D2F310716A3L});
|
||||||
Activity activity = mActivity.launchActivity(intent);
|
Activity activity = mActivity.launchActivity(intent);
|
||||||
|
|
||||||
// import these two, make sure they're there
|
// import these two, make sure they're there
|
||||||
|
|||||||
Reference in New Issue
Block a user