forked from Mirroring/Kore
Fixed test setup
* Reverted gradle plugin upgrade to prevent forcing users to upgrade to Android Studio 4 preview version. * Refactored TVShowsActivityTests into using the AndroidX libs. * Updated test setup to handle saving tab state in abstract list fragment.master
parent
5299e8e607
commit
c44a5f0612
|
@ -32,6 +32,7 @@ import org.xbmc.kore.R;
|
|||
import org.xbmc.kore.host.HostInfo;
|
||||
import org.xbmc.kore.host.HostManager;
|
||||
import org.xbmc.kore.provider.MediaProvider;
|
||||
import org.xbmc.kore.ui.AbstractTabsFragment;
|
||||
import org.xbmc.kore.ui.sections.hosts.HostFragmentManualConfiguration;
|
||||
import org.xbmc.kore.utils.LogUtils;
|
||||
|
||||
|
@ -81,10 +82,10 @@ public class Utils {
|
|||
}
|
||||
|
||||
public static void clearSharedPreferences(Context context) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
SharedPreferences.Editor editor = prefs.edit();
|
||||
editor.clear();
|
||||
editor.commit();
|
||||
PreferenceManager.getDefaultSharedPreferences(context)
|
||||
.edit().clear().commit();
|
||||
context.getSharedPreferences(AbstractTabsFragment.PREFERENCES_NAME, Context.MODE_PRIVATE)
|
||||
.edit().clear().commit();
|
||||
}
|
||||
|
||||
public static void setLearnedAboutDrawerPreference(Context context, boolean learned) {
|
||||
|
|
|
@ -17,25 +17,25 @@
|
|||
package org.xbmc.kore.tests.ui.tvshows;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.test.espresso.Espresso;
|
||||
import android.support.test.rule.ActivityTestRule;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.test.espresso.Espresso;
|
||||
import androidx.test.rule.ActivityTestRule;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.xbmc.kore.R;
|
||||
import org.xbmc.kore.host.HostInfo;
|
||||
import org.xbmc.kore.testhelpers.EspressoTestUtils;
|
||||
import org.xbmc.kore.tests.ui.AbstractTestClass;
|
||||
import org.xbmc.kore.ui.sections.video.TVShowsActivity;
|
||||
|
||||
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.matcher.ViewMatchers.withId;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withParent;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withText;
|
||||
import static org.hamcrest.Matchers.allOf;
|
||||
import static androidx.test.espresso.Espresso.onView;
|
||||
import static androidx.test.espresso.action.ViewActions.click;
|
||||
import static androidx.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static androidx.test.espresso.matcher.ViewMatchers.withId;
|
||||
import static androidx.test.espresso.matcher.ViewMatchers.withParent;
|
||||
import static androidx.test.espresso.matcher.ViewMatchers.withText;
|
||||
import static org.hamcrest.CoreMatchers.allOf;
|
||||
import static org.hamcrest.Matchers.instanceOf;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
|
|
@ -39,7 +39,7 @@ import butterknife.Unbinder;
|
|||
abstract public class AbstractTabsFragment extends AbstractFragment
|
||||
implements SharedElementTransition.SharedElement {
|
||||
private static final String TAG = LogUtils.makeLogTag(AbstractTabsFragment.class);
|
||||
private static final String PREFERENCES_NAME = "AbstractTabsFragmentPreferences";
|
||||
public static final String PREFERENCES_NAME = "AbstractTabsFragmentPreferences";
|
||||
private static final String PREFERENCE_PREFIX_LAST_TAB = "lastTab_";
|
||||
|
||||
@BindView(R.id.pager) ViewPager viewPager;
|
||||
|
|
|
@ -6,7 +6,7 @@ buildscript {
|
|||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.0.0-beta04'
|
||||
classpath 'com.android.tools.build:gradle:3.4.1'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
|
Loading…
Reference in New Issue