mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
Revamp the Settings page (#1259)
* Revamp the Settings page * Update License Test
This commit is contained in:
parent
de673eb4ca
commit
bdd7a86cd5
4 changed files with 68 additions and 58 deletions
|
|
@ -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)
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue