mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-12-18 05:12:16 -05:00
instrument: add helper for snackbar check (2)
This commit is contained in:
parent
34c7252048
commit
fe4659f8d6
@ -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))));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user