aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/androidTest
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2015-06-14 18:09:14 +0200
committerVincent Breitmoser <valodim@mugenguild.com>2015-06-17 18:52:20 +0200
commitfe4659f8d6ef5b0520ba391deb050f64f878aeed (patch)
treed57c152778b2687962b3e38555d75e9373ad6fe5 /OpenKeychain/src/androidTest
parent34c72520482aa03586d20a9edb4491b49d75b236 (diff)
downloadopen-keychain-fe4659f8d6ef5b0520ba391deb050f64f878aeed.tar.gz
open-keychain-fe4659f8d6ef5b0520ba391deb050f64f878aeed.tar.bz2
open-keychain-fe4659f8d6ef5b0520ba391deb050f64f878aeed.zip
instrument: add helper for snackbar check (2)
Diffstat (limited to 'OpenKeychain/src/androidTest')
-rw-r--r--OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/actions/CheckHelpers.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/actions/CheckHelpers.java b/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/actions/CheckHelpers.java
new file mode 100644
index 000000000..a950ceeaa
--- /dev/null
+++ b/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/actions/CheckHelpers.java
@@ -0,0 +1,31 @@
+package org.sufficientlysecure.keychain.actions;
+
+
+import android.support.annotation.StringRes;
+
+import org.hamcrest.CoreMatchers;
+import org.sufficientlysecure.keychain.ui.util.Notify.Style;
+
+import static android.support.test.espresso.Espresso.onView;
+import static android.support.test.espresso.assertion.ViewAssertions.matches;
+import static android.support.test.espresso.matcher.ViewMatchers.hasDescendant;
+import static android.support.test.espresso.matcher.ViewMatchers.withClassName;
+import static android.support.test.espresso.matcher.ViewMatchers.withText;
+import static org.sufficientlysecure.keychain.actions.CustomMatchers.withSnackbarLineColor;
+
+
+abstract public class CheckHelpers {
+
+ public static void checkSnackbar(Style style, @StringRes Integer text) {
+
+ onView(withClassName(CoreMatchers.endsWith("Snackbar")))
+ .check(matches(withSnackbarLineColor(style.mLineColor)));
+
+ if (text != null) {
+ onView(withClassName(CoreMatchers.endsWith("Snackbar")))
+ .check(matches(hasDescendant(withText(text))));
+ }
+
+ }
+
+}