Replace footer with regular preference
Replaced the "Manage Storage" footer preference with a regular preference because the footer type is not meant to be a touch target. This should fix the bug with not being able to click on specific parts of the preference. Test: run settings espresso tests Bug: 34349518 Change-Id: I36ada2a6a537a68d9fcbe7e10773896225ecc6b2
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package com.android.settings.deviceinfo;
|
||||
|
||||
import android.support.test.espresso.intent.rule.IntentsTestRule;
|
||||
import android.support.test.filters.SmallTest;
|
||||
import android.support.test.runner.AndroidJUnitRunner;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.Settings.StorageDashboardActivity;
|
||||
import com.android.settings.deletionhelper.AutomaticStorageManagerSettings;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.action.ViewActions.click;
|
||||
import static android.support.test.espresso.intent.Intents.intended;
|
||||
import static android.support.test.espresso.intent.matcher.IntentMatchers.hasExtra;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withText;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
@SmallTest
|
||||
public class StorageDashboardFragmentEspressoTest {
|
||||
|
||||
public static final String EXTRA_KEY = ":settings:show_fragment";
|
||||
|
||||
@Rule
|
||||
public IntentsTestRule<StorageDashboardActivity> mActivityRule =
|
||||
new IntentsTestRule<>(StorageDashboardActivity.class, true, true);
|
||||
|
||||
@Test
|
||||
public void testStorageManagePreference_canClickTextView() throws InterruptedException {
|
||||
// Click on the actual textbox instead of just somewhere in the preference
|
||||
onView(withText(R.string.storage_menu_manage)).perform(click());
|
||||
|
||||
// Check that it worked by seeing if we switched screens
|
||||
intended(hasExtra(equalTo(EXTRA_KEY),
|
||||
containsString(AutomaticStorageManagerSettings.class.getName())));
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user