Revamp the Settings page (#1259)

* Revamp the Settings page

* Update License Test
This commit is contained in:
Madhur Gupta 2018-03-11 00:56:05 +05:30 committed by Vivek Maskara
parent de673eb4ca
commit bdd7a86cd5
4 changed files with 68 additions and 58 deletions

View file

@ -5,6 +5,7 @@ import android.preference.PreferenceManager;
import android.support.test.espresso.Espresso;
import android.support.test.espresso.action.ViewActions;
import android.support.test.espresso.assertion.ViewAssertions;
import android.support.test.espresso.matcher.PreferenceMatchers;
import android.support.test.espresso.matcher.ViewMatchers;
import android.support.test.filters.LargeTest;
import android.support.test.rule.ActivityTestRule;
@ -61,7 +62,7 @@ public class SettingsActivityTest {
@Test
public void oneLicenseIsChecked() {
// click "License" (the first item)
Espresso.onData(Matchers.anything())
Espresso.onData(PreferenceMatchers.withKey("defaultLicense"))
.inAdapterView(ViewMatchers.withId(android.R.id.list))
.atPosition(0)
.perform(ViewActions.click());
@ -74,7 +75,7 @@ public class SettingsActivityTest {
@Test
public void afterClickingCcby4ItWillStay() {
// click "License" (the first item)
Espresso.onData(Matchers.anything())
Espresso.onData(PreferenceMatchers.withKey("defaultLicense"))
.inAdapterView(ViewMatchers.withId(android.R.id.list))
.atPosition(0)
.perform(ViewActions.click());
@ -85,7 +86,7 @@ public class SettingsActivityTest {
).perform(ViewActions.click());
// click "License" (the first item)
Espresso.onData(Matchers.anything())
Espresso.onData(PreferenceMatchers.withKey("defaultLicense"))
.inAdapterView(ViewMatchers.withId(android.R.id.list))
.atPosition(0)
.perform(ViewActions.click());
@ -96,4 +97,4 @@ public class SettingsActivityTest {
ViewMatchers.withText(R.string.license_name_cc_by_four)
));
}
}
}