mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
@@ -3,6 +3,7 @@ package org.briarproject.briar.android.settings;
|
||||
import android.content.Intent;
|
||||
import android.support.test.espresso.contrib.DrawerActions;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.Gravity;
|
||||
|
||||
import org.briarproject.briar.R;
|
||||
@@ -17,9 +18,15 @@ import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.action.ViewActions.click;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.contrib.DrawerMatchers.isClosed;
|
||||
import static android.support.test.espresso.contrib.RecyclerViewActions.scrollToPosition;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isEnabled;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withChild;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withClassName;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withText;
|
||||
import static org.briarproject.briar.android.test.ViewActions.waitUntilMatches;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class SettingsActivityScreenshotTest extends ScreenshotTest {
|
||||
@@ -67,4 +74,26 @@ public class SettingsActivityScreenshotTest extends ScreenshotTest {
|
||||
screenshot("manual_dark_theme_nav_drawer");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void appLock() {
|
||||
// scroll down
|
||||
onView(withClassName(is(RecyclerView.class.getName())))
|
||||
.perform(scrollToPosition(13));
|
||||
|
||||
// wait for settings to get loaded and enabled
|
||||
onView(withText(R.string.tor_mobile_data_title))
|
||||
.perform(waitUntilMatches(isEnabled()));
|
||||
|
||||
// ensure app lock is displayed and enabled
|
||||
onView(withText(R.string.pref_lock_title))
|
||||
.check(matches(isDisplayed()))
|
||||
.check(matches(isEnabled()))
|
||||
.perform(click());
|
||||
onView(withChild(withText(R.string.pref_lock_timeout_title)))
|
||||
.check(matches(isDisplayed()))
|
||||
.check(matches(isEnabled()));
|
||||
|
||||
screenshot("manual_app_lock");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user