Verified Commit 1d259bd5 authored by Torsten Grote's avatar Torsten Grote
Browse files

Screenshots for Sign-in improvements

Screenshots for #1249
parent de631419
......@@ -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");
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment