From 3a061669b0f8ae288a4e8857bf33bd83ca2032e1 Mon Sep 17 00:00:00 2001 From: Jojo Narte Date: Sun, 15 Apr 2018 22:33:11 +0800 Subject: [PATCH 1/6] set up tests --- .../test/NavigateBackPressFromAboutTest.java | 80 +++++++++++++++++++ ...eBackPressFromBaseballCardDetailsTest.java | 62 ++++++++++++++ ...gateBackPressFromBaseballCardListTest.java | 59 ++++++++++++++ ...eBackPressFromBaseballFilterCardsTest.java | 62 ++++++++++++++ .../common/activity/BaseballCardList.java | 13 +++ .../android/common/activity/MainActivity.java | 13 +-- 6 files changed, 284 insertions(+), 5 deletions(-) create mode 100644 android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromAboutTest.java create mode 100644 android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardDetailsTest.java create mode 100644 android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardListTest.java create mode 100644 android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballFilterCardsTest.java diff --git a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromAboutTest.java b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromAboutTest.java new file mode 100644 index 000000000..6bb6ef32b --- /dev/null +++ b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromAboutTest.java @@ -0,0 +1,80 @@ +/* + * This file is part of BBCT for Android. + * + * Copyright 2018 codeguru + * + * BBCT for Android is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BBCT for Android is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package bbct.android.common.navigation.test; + +import android.support.test.espresso.Espresso; +import android.support.test.rule.ActivityTestRule; +import android.support.test.runner.AndroidJUnit4; + +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import bbct.android.common.R; +import bbct.android.lite.provider.LiteActivity; + +import static android.support.test.InstrumentationRegistry.getInstrumentation; +import static android.support.test.espresso.Espresso.onView; +import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +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.isDisplayed; +import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription; +import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static org.hamcrest.Matchers.allOf; + +@RunWith(AndroidJUnit4.class) +public class NavigateBackPressFromAboutTest { + @Rule + public ActivityTestRule activityActivityTestRule = new ActivityTestRule(LiteActivity.class); + + @Before + public void setUp() throws Exception { + activityActivityTestRule.getActivity() + .getSupportFragmentManager().beginTransaction(); + } + + @Test + public void testNavigateToAboutFragment() { + openActionBarOverflowOrOptionsMenu(getInstrumentation().getTargetContext()); + + String aboutTitle = getInstrumentation().getTargetContext().getString(R.string.about_title); + Espresso.pressBack(); + + String expectedTitle = getInstrumentation().getTargetContext().getString(R.string.bbct_title, aboutTitle); + onView(withText(expectedTitle)).check(matches(isDisplayed())); + } + + @Test + public void testNavigateBack() { + String initialTitle = (String) activityActivityTestRule.getActivity().getTitle(); + openActionBarOverflowOrOptionsMenu(getInstrumentation().getTargetContext()); + + String aboutTitle = getInstrumentation().getTargetContext().getString(R.string.about_title); + + onView(allOf(withText(aboutTitle), isDisplayed())).perform(click()); + String expectedTitle = getInstrumentation().getTargetContext().getString(R.string.bbct_title, aboutTitle); + onView(withText(expectedTitle)).check(matches(isDisplayed())); + + Espresso.closeSoftKeyboard(); + Espresso.pressBack(); + onView(withText(initialTitle)).check(matches(isDisplayed())); + } +} \ No newline at end of file diff --git a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardDetailsTest.java b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardDetailsTest.java new file mode 100644 index 000000000..cb3fec531 --- /dev/null +++ b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardDetailsTest.java @@ -0,0 +1,62 @@ +/* + * This file is part of BBCT for Android. + * + * Copyright 2018 codeguru + * + * BBCT for Android is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BBCT for Android is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package bbct.android.common.navigation.test; + +import android.support.test.espresso.Espresso; +import android.support.test.rule.ActivityTestRule; +import android.support.test.runner.AndroidJUnit4; + +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import bbct.android.common.R; +import bbct.android.lite.provider.LiteActivity; + +import static android.support.test.InstrumentationRegistry.getInstrumentation; +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.isDisplayed; +import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription; +import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static org.hamcrest.Matchers.allOf; + +@RunWith(AndroidJUnit4.class) +public class NavigateBackPressFromBaseballCardDetailsTest { + @Rule + public ActivityTestRule activityActivityTestRule = new ActivityTestRule(LiteActivity.class); + + @Before + public void setUp() throws Exception { + activityActivityTestRule.getActivity() + .getSupportFragmentManager().beginTransaction(); + } + + @Test + public void testDefaultNavigateUpWithNoData() { + String cardDetailsTitle = getInstrumentation().getTargetContext().getString(R.string.card_details_title); + String expectedTitle = getInstrumentation().getTargetContext().getString(R.string.bbct_title, cardDetailsTitle); + Espresso.closeSoftKeyboard(); + onView(withText(expectedTitle)).check(matches(isDisplayed())); + Espresso.pressBack(); + onView(withText(R.string.app_name)).check(matches(isDisplayed())); + } +} \ No newline at end of file diff --git a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardListTest.java b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardListTest.java new file mode 100644 index 000000000..e0bc9057e --- /dev/null +++ b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardListTest.java @@ -0,0 +1,59 @@ +/* + * This file is part of BBCT for Android. + * + * Copyright 2018 codeguru + * + * BBCT for Android is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BBCT for Android is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package bbct.android.common.navigation.test; + +import android.support.test.espresso.Espresso; +import android.support.test.rule.ActivityTestRule; +import android.support.test.runner.AndroidJUnit4; + +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + + +import bbct.android.common.R; +import bbct.android.lite.provider.LiteActivity; + +import static android.support.test.InstrumentationRegistry.getInstrumentation; +import static android.support.test.espresso.Espresso.onView; +import static android.support.test.espresso.assertion.ViewAssertions.matches; +import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; +import static android.support.test.espresso.matcher.ViewMatchers.withText; + +@RunWith(AndroidJUnit4.class) +public class NavigateBackPressFromBaseballCardListTest { + @Rule + public ActivityTestRule activityActivityTestRule = new ActivityTestRule(LiteActivity.class); + + + @Before + public void setUp() throws Exception { + activityActivityTestRule.getActivity() + .getSupportFragmentManager().beginTransaction(); + } + + @Test + public void testBackPress() { + String expectedTitle = getInstrumentation().getTargetContext().getString(R.string.app_name); + Espresso.closeSoftKeyboard(); + Espresso.pressBack(); + onView(withText(expectedTitle)).check(matches(isDisplayed())); + } +} \ No newline at end of file diff --git a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballFilterCardsTest.java b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballFilterCardsTest.java new file mode 100644 index 000000000..a80321614 --- /dev/null +++ b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballFilterCardsTest.java @@ -0,0 +1,62 @@ +/* + * This file is part of BBCT for Android. + * + * Copyright 2018 codeguru + * + * BBCT for Android is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * BBCT for Android is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package bbct.android.common.navigation.test; + +import android.support.test.espresso.Espresso; +import android.support.test.rule.ActivityTestRule; +import android.support.test.runner.AndroidJUnit4; + +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import bbct.android.common.R; +import bbct.android.lite.provider.LiteActivity; + +import static android.support.test.InstrumentationRegistry.getInstrumentation; +import static android.support.test.espresso.Espresso.onView; +import static android.support.test.espresso.action.ViewActions.click; +import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; +import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription; +import static android.support.test.espresso.matcher.ViewMatchers.withText; +import static org.hamcrest.Matchers.allOf; + +@RunWith(AndroidJUnit4.class) +public class NavigateBackPressFromBaseballFilterCardsTest { + @Rule + public ActivityTestRule activityActivityTestRule = new ActivityTestRule(LiteActivity.class); + + @Before + public void setUp() throws Exception { + activityActivityTestRule.getActivity() + .getSupportFragmentManager().beginTransaction(); + } + + @Test + public void testNavigateUp() { + + String expectedTitle = getInstrumentation().getTargetContext().getString(R.string.app_name); + Espresso.pressBack(); + onView(allOf(withContentDescription(R.string.filter_cards_title), isDisplayed())).perform(click()); + Espresso.pressBack(); + onView(allOf(withText(expectedTitle), isDisplayed())); + + } +} \ No newline at end of file diff --git a/android/src/main/java/bbct/android/common/activity/BaseballCardList.java b/android/src/main/java/bbct/android/common/activity/BaseballCardList.java index ce7e136b9..f9fe13fe5 100644 --- a/android/src/main/java/bbct/android/common/activity/BaseballCardList.java +++ b/android/src/main/java/bbct/android/common/activity/BaseballCardList.java @@ -24,6 +24,8 @@ import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.ListFragment; +import android.support.v7.app.ActionBar; +import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; @@ -106,6 +108,17 @@ public void onCreate(Bundle savedInstanceState) { this.setHasOptionsMenu(true); } + @Override + public void onResume() { + super.onResume(); + getActivity().setTitle(R.string.app_name); + + ActionBar actionBar = ((AppCompatActivity)getActivity()).getSupportActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(false); + } + } + @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { diff --git a/android/src/main/java/bbct/android/common/activity/MainActivity.java b/android/src/main/java/bbct/android/common/activity/MainActivity.java index 931cab021..31df3646a 100644 --- a/android/src/main/java/bbct/android/common/activity/MainActivity.java +++ b/android/src/main/java/bbct/android/common/activity/MainActivity.java @@ -69,13 +69,16 @@ public void onCreate(Bundle savedInstanceState) { BaseballCardContract.PROJECTION, null, null, null); FragmentTransaction ft = this.getSupportFragmentManager().beginTransaction(); + ft.add(R.id.fragment_holder, new BaseballCardList(), FragmentTags.CARD_LIST) + .addToBackStack(null) + .commit(); + if (cursor == null || cursor.getCount() == 0) { - ft.add(R.id.fragment_holder, new BaseballCardDetails(), FragmentTags.EDIT_CARD); - } else { - ft.add(R.id.fragment_holder, new BaseballCardList(), FragmentTags.CARD_LIST); - cursor.close(); + this.getSupportFragmentManager().beginTransaction() + .replace(R.id.fragment_holder, new BaseballCardDetails(), FragmentTags.EDIT_CARD) + .addToBackStack(FragmentTags.EDIT_CARD).commit(); } - ft.commit(); + cursor.close(); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { From 0838b9f6f881e8773517ad906e6530a3fbeabd2a Mon Sep 17 00:00:00 2001 From: Jojo Narte Date: Mon, 23 Apr 2018 22:00:17 +0800 Subject: [PATCH 2/6] fix back press issues --- .../test/NavigateBackPressFromAboutTest.java | 20 ++++++++++--------- ...eBackPressFromBaseballCardDetailsTest.java | 13 ++++++++++++ ...gateBackPressFromBaseballCardListTest.java | 14 +++++++++++++ ...eBackPressFromBaseballFilterCardsTest.java | 16 ++++++++++++++- .../common/activity/BaseballCardList.java | 5 ----- 5 files changed, 53 insertions(+), 15 deletions(-) diff --git a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromAboutTest.java b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromAboutTest.java index 6bb6ef32b..23f6ed770 100644 --- a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromAboutTest.java +++ b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromAboutTest.java @@ -19,6 +19,7 @@ package bbct.android.common.navigation.test; import android.support.test.espresso.Espresso; +import android.support.test.espresso.NoMatchingViewException; import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; @@ -51,19 +52,20 @@ public void setUp() throws Exception { .getSupportFragmentManager().beginTransaction(); } - @Test - public void testNavigateToAboutFragment() { - openActionBarOverflowOrOptionsMenu(getInstrumentation().getTargetContext()); - - String aboutTitle = getInstrumentation().getTargetContext().getString(R.string.about_title); - Espresso.pressBack(); - - String expectedTitle = getInstrumentation().getTargetContext().getString(R.string.bbct_title, aboutTitle); - onView(withText(expectedTitle)).check(matches(isDisplayed())); + private void skipSurvey() { + try { + onView(withText(R.string.survey1)).check(matches(isDisplayed())); + onView(withText(R.string.later)) + .check(matches(isDisplayed())) + .perform(click()); + } catch (NoMatchingViewException e) { + //view not displayed logic + } } @Test public void testNavigateBack() { + skipSurvey(); String initialTitle = (String) activityActivityTestRule.getActivity().getTitle(); openActionBarOverflowOrOptionsMenu(getInstrumentation().getTargetContext()); diff --git a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardDetailsTest.java b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardDetailsTest.java index cb3fec531..cad5f036b 100644 --- a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardDetailsTest.java +++ b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardDetailsTest.java @@ -19,6 +19,7 @@ package bbct.android.common.navigation.test; import android.support.test.espresso.Espresso; +import android.support.test.espresso.NoMatchingViewException; import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; @@ -50,8 +51,20 @@ public void setUp() throws Exception { .getSupportFragmentManager().beginTransaction(); } + private void skipSurvey() { + try { + onView(withText(R.string.survey1)).check(matches(isDisplayed())); + onView(withText(R.string.later)) + .check(matches(isDisplayed())) + .perform(click()); + } catch (NoMatchingViewException e) { + //view not displayed logic + } + } + @Test public void testDefaultNavigateUpWithNoData() { + skipSurvey(); String cardDetailsTitle = getInstrumentation().getTargetContext().getString(R.string.card_details_title); String expectedTitle = getInstrumentation().getTargetContext().getString(R.string.bbct_title, cardDetailsTitle); Espresso.closeSoftKeyboard(); diff --git a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardListTest.java b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardListTest.java index e0bc9057e..cbed0836d 100644 --- a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardListTest.java +++ b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardListTest.java @@ -19,6 +19,7 @@ package bbct.android.common.navigation.test; import android.support.test.espresso.Espresso; +import android.support.test.espresso.NoMatchingViewException; import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; @@ -33,6 +34,7 @@ import static android.support.test.InstrumentationRegistry.getInstrumentation; 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.isDisplayed; import static android.support.test.espresso.matcher.ViewMatchers.withText; @@ -49,8 +51,20 @@ public void setUp() throws Exception { .getSupportFragmentManager().beginTransaction(); } + private void skipSurvey() { + try { + onView(withText(R.string.survey1)).check(matches(isDisplayed())); + onView(withText(R.string.later)) + .check(matches(isDisplayed())) + .perform(click()); + } catch (NoMatchingViewException e) { + //view not displayed logic + } + } + @Test public void testBackPress() { + skipSurvey(); String expectedTitle = getInstrumentation().getTargetContext().getString(R.string.app_name); Espresso.closeSoftKeyboard(); Espresso.pressBack(); diff --git a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballFilterCardsTest.java b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballFilterCardsTest.java index a80321614..97dbb014d 100644 --- a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballFilterCardsTest.java +++ b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballFilterCardsTest.java @@ -19,6 +19,7 @@ package bbct.android.common.navigation.test; import android.support.test.espresso.Espresso; +import android.support.test.espresso.NoMatchingViewException; import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; @@ -33,6 +34,7 @@ import static android.support.test.InstrumentationRegistry.getInstrumentation; 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.isDisplayed; import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription; import static android.support.test.espresso.matcher.ViewMatchers.withText; @@ -49,10 +51,22 @@ public void setUp() throws Exception { .getSupportFragmentManager().beginTransaction(); } + private void skipSurvey() { + try { + onView(withText(R.string.survey1)).check(matches(isDisplayed())); + onView(withText(R.string.later)) + .check(matches(isDisplayed())) + .perform(click()); + } catch (NoMatchingViewException e) { + //view not displayed logic + } + } + @Test public void testNavigateUp() { - + skipSurvey(); String expectedTitle = getInstrumentation().getTargetContext().getString(R.string.app_name); + Espresso.closeSoftKeyboard(); Espresso.pressBack(); onView(allOf(withContentDescription(R.string.filter_cards_title), isDisplayed())).perform(click()); Espresso.pressBack(); diff --git a/android/src/main/java/bbct/android/common/activity/BaseballCardList.java b/android/src/main/java/bbct/android/common/activity/BaseballCardList.java index f9fe13fe5..9b75fd0d8 100644 --- a/android/src/main/java/bbct/android/common/activity/BaseballCardList.java +++ b/android/src/main/java/bbct/android/common/activity/BaseballCardList.java @@ -112,11 +112,6 @@ public void onCreate(Bundle savedInstanceState) { public void onResume() { super.onResume(); getActivity().setTitle(R.string.app_name); - - ActionBar actionBar = ((AppCompatActivity)getActivity()).getSupportActionBar(); - if (actionBar != null) { - actionBar.setDisplayHomeAsUpEnabled(false); - } } @Override From 9c82268647b16f7806820bbe240a7a9ee64d92ae Mon Sep 17 00:00:00 2001 From: jojonarte Date: Mon, 27 Aug 2018 22:41:04 +0800 Subject: [PATCH 3/6] new static util method to close soft keyboard before pressing back --- .../java/bbct/android/common/test/BBCTTestUtil.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/android/src/androidTest/java/bbct/android/common/test/BBCTTestUtil.java b/android/src/androidTest/java/bbct/android/common/test/BBCTTestUtil.java index 1c8c84e7e..b2ed836fe 100644 --- a/android/src/androidTest/java/bbct/android/common/test/BBCTTestUtil.java +++ b/android/src/androidTest/java/bbct/android/common/test/BBCTTestUtil.java @@ -22,6 +22,7 @@ import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.support.test.InstrumentationRegistry; +import android.support.test.espresso.Espresso; import android.support.test.espresso.ViewInteraction; import android.support.test.uiautomator.UiDevice; import android.util.Log; @@ -70,6 +71,11 @@ final public class BBCTTestUtil { private BBCTTestUtil() { } + public static void hideKeyboardAndPressBack() { + Espresso.closeSoftKeyboard(); + Espresso.pressBack(); + } + public static void assertListViewContainsItems(List expectedItems) { for (BaseballCard card : expectedItems) { onData(allOf(instanceOf(BaseballCard.class), is(card))) From b5a75e29ba4e936eb10cb09643d2693d487eb525 Mon Sep 17 00:00:00 2001 From: jojonarte Date: Mon, 27 Aug 2018 22:41:33 +0800 Subject: [PATCH 4/6] updated back press tests to generic constructor --- .../test/NavigateBackPressFromAboutTest.java | 59 +++++++++---------- ...eBackPressFromBaseballCardDetailsTest.java | 33 ++++------- ...gateBackPressFromBaseballCardListTest.java | 34 +++++------ ...eBackPressFromBaseballFilterCardsTest.java | 37 +++++------- 4 files changed, 70 insertions(+), 93 deletions(-) diff --git a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromAboutTest.java b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromAboutTest.java index 23f6ed770..439fab2cb 100644 --- a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromAboutTest.java +++ b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromAboutTest.java @@ -18,8 +18,7 @@ */ package bbct.android.common.navigation.test; -import android.support.test.espresso.Espresso; -import android.support.test.espresso.NoMatchingViewException; +import android.content.Context; import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; @@ -29,54 +28,54 @@ import org.junit.runner.RunWith; import bbct.android.common.R; -import bbct.android.lite.provider.LiteActivity; +import bbct.android.common.activity.MainActivity; +import bbct.android.common.test.BBCTTestUtil; import static android.support.test.InstrumentationRegistry.getInstrumentation; import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; +import static android.support.test.espresso.Espresso + .openActionBarOverflowOrOptionsMenu; 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.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription; import static android.support.test.espresso.matcher.ViewMatchers.withText; import static org.hamcrest.Matchers.allOf; @RunWith(AndroidJUnit4.class) -public class NavigateBackPressFromAboutTest { +public class NavigateBackPressFromAboutTest { @Rule - public ActivityTestRule activityActivityTestRule = new ActivityTestRule(LiteActivity.class); + public ActivityTestRule activityActivityTestRule = null; + private Context context = null; - @Before - public void setUp() throws Exception { - activityActivityTestRule.getActivity() - .getSupportFragmentManager().beginTransaction(); + public NavigateBackPressFromAboutTest(Class activityClass) { + this.activityActivityTestRule = new ActivityTestRule<>(activityClass); } - private void skipSurvey() { - try { - onView(withText(R.string.survey1)).check(matches(isDisplayed())); - onView(withText(R.string.later)) - .check(matches(isDisplayed())) - .perform(click()); - } catch (NoMatchingViewException e) { - //view not displayed logic - } + + @Before + public void setUp() throws Exception { + context = getInstrumentation().getTargetContext(); } @Test public void testNavigateBack() { - skipSurvey(); - String initialTitle = (String) activityActivityTestRule.getActivity().getTitle(); - openActionBarOverflowOrOptionsMenu(getInstrumentation().getTargetContext()); + String expectedTitle = context.getString(R.string.app_name); + + navigateToAboutViaContextMenu(); - String aboutTitle = getInstrumentation().getTargetContext().getString(R.string.about_title); + BBCTTestUtil.hideKeyboardAndPressBack(); + onView(withText(expectedTitle)) + .check(matches(isDisplayed())); + } - onView(allOf(withText(aboutTitle), isDisplayed())).perform(click()); - String expectedTitle = getInstrumentation().getTargetContext().getString(R.string.bbct_title, aboutTitle); - onView(withText(expectedTitle)).check(matches(isDisplayed())); + private void navigateToAboutViaContextMenu() { + openActionBarOverflowOrOptionsMenu(context); + String aboutTitle = context.getString(R.string.about_title); + String expectedTitle = context.getString(R.string.app_name, aboutTitle); - Espresso.closeSoftKeyboard(); - Espresso.pressBack(); - onView(withText(initialTitle)).check(matches(isDisplayed())); + onView(allOf(withText(aboutTitle), isDisplayed())) + .perform(click()); + onView(withText(expectedTitle)) + .check(matches(isDisplayed())); } } \ No newline at end of file diff --git a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardDetailsTest.java b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardDetailsTest.java index cad5f036b..406dda292 100644 --- a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardDetailsTest.java +++ b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardDetailsTest.java @@ -29,6 +29,8 @@ import org.junit.runner.RunWith; import bbct.android.common.R; +import bbct.android.common.activity.MainActivity; +import bbct.android.common.test.BBCTTestUtil; import bbct.android.lite.provider.LiteActivity; import static android.support.test.InstrumentationRegistry.getInstrumentation; @@ -41,35 +43,22 @@ import static org.hamcrest.Matchers.allOf; @RunWith(AndroidJUnit4.class) -public class NavigateBackPressFromBaseballCardDetailsTest { +public class NavigateBackPressFromBaseballCardDetailsTest { @Rule - public ActivityTestRule activityActivityTestRule = new ActivityTestRule(LiteActivity.class); + public ActivityTestRule activityActivityTestRule = null; - @Before - public void setUp() throws Exception { - activityActivityTestRule.getActivity() - .getSupportFragmentManager().beginTransaction(); - } - - private void skipSurvey() { - try { - onView(withText(R.string.survey1)).check(matches(isDisplayed())); - onView(withText(R.string.later)) - .check(matches(isDisplayed())) - .perform(click()); - } catch (NoMatchingViewException e) { - //view not displayed logic - } + public NavigateBackPressFromBaseballCardDetailsTest(Class activityClass) { + this.activityActivityTestRule = new ActivityTestRule<>(activityClass); } @Test public void testDefaultNavigateUpWithNoData() { - skipSurvey(); String cardDetailsTitle = getInstrumentation().getTargetContext().getString(R.string.card_details_title); String expectedTitle = getInstrumentation().getTargetContext().getString(R.string.bbct_title, cardDetailsTitle); - Espresso.closeSoftKeyboard(); - onView(withText(expectedTitle)).check(matches(isDisplayed())); - Espresso.pressBack(); - onView(withText(R.string.app_name)).check(matches(isDisplayed())); + onView(withText(expectedTitle)) + .check(matches(isDisplayed())); + BBCTTestUtil.hideKeyboardAndPressBack(); + onView(withText(R.string.app_name)) + .check(matches(isDisplayed())); } } \ No newline at end of file diff --git a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardListTest.java b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardListTest.java index cbed0836d..525794e22 100644 --- a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardListTest.java +++ b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardListTest.java @@ -18,6 +18,7 @@ */ package bbct.android.common.navigation.test; +import android.content.Context; import android.support.test.espresso.Espresso; import android.support.test.espresso.NoMatchingViewException; import android.support.test.rule.ActivityTestRule; @@ -30,6 +31,8 @@ import bbct.android.common.R; +import bbct.android.common.activity.MainActivity; +import bbct.android.common.test.BBCTTestUtil; import bbct.android.lite.provider.LiteActivity; import static android.support.test.InstrumentationRegistry.getInstrumentation; @@ -40,34 +43,25 @@ import static android.support.test.espresso.matcher.ViewMatchers.withText; @RunWith(AndroidJUnit4.class) -public class NavigateBackPressFromBaseballCardListTest { +public class NavigateBackPressFromBaseballCardListTest { @Rule - public ActivityTestRule activityActivityTestRule = new ActivityTestRule(LiteActivity.class); + public ActivityTestRule activityActivityTestRule = null; + private Context context = null; + public NavigateBackPressFromBaseballCardListTest(Class activityClass) { + this.activityActivityTestRule = new ActivityTestRule<>(activityClass); + } @Before public void setUp() throws Exception { - activityActivityTestRule.getActivity() - .getSupportFragmentManager().beginTransaction(); - } - - private void skipSurvey() { - try { - onView(withText(R.string.survey1)).check(matches(isDisplayed())); - onView(withText(R.string.later)) - .check(matches(isDisplayed())) - .perform(click()); - } catch (NoMatchingViewException e) { - //view not displayed logic - } + context = getInstrumentation().getTargetContext(); } @Test public void testBackPress() { - skipSurvey(); - String expectedTitle = getInstrumentation().getTargetContext().getString(R.string.app_name); - Espresso.closeSoftKeyboard(); - Espresso.pressBack(); - onView(withText(expectedTitle)).check(matches(isDisplayed())); + String expectedTitle = context.getString(R.string.app_name); + BBCTTestUtil.hideKeyboardAndPressBack(); + onView(withText(expectedTitle)) + .check(matches(isDisplayed())); } } \ No newline at end of file diff --git a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballFilterCardsTest.java b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballFilterCardsTest.java index 97dbb014d..a854e6e41 100644 --- a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballFilterCardsTest.java +++ b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballFilterCardsTest.java @@ -18,6 +18,7 @@ */ package bbct.android.common.navigation.test; +import android.content.Context; import android.support.test.espresso.Espresso; import android.support.test.espresso.NoMatchingViewException; import android.support.test.rule.ActivityTestRule; @@ -29,6 +30,8 @@ import org.junit.runner.RunWith; import bbct.android.common.R; +import bbct.android.common.activity.MainActivity; +import bbct.android.common.test.BBCTTestUtil; import bbct.android.lite.provider.LiteActivity; import static android.support.test.InstrumentationRegistry.getInstrumentation; @@ -41,35 +44,27 @@ import static org.hamcrest.Matchers.allOf; @RunWith(AndroidJUnit4.class) -public class NavigateBackPressFromBaseballFilterCardsTest { +public class NavigateBackPressFromBaseballFilterCardsTest { @Rule - public ActivityTestRule activityActivityTestRule = new ActivityTestRule(LiteActivity.class); + public ActivityTestRule activityActivityTestRule = null; + private Context context = null; - @Before - public void setUp() throws Exception { - activityActivityTestRule.getActivity() - .getSupportFragmentManager().beginTransaction(); + public NavigateBackPressFromBaseballFilterCardsTest(Class activityClass) { + this.activityActivityTestRule = new ActivityTestRule<>(activityClass); } - private void skipSurvey() { - try { - onView(withText(R.string.survey1)).check(matches(isDisplayed())); - onView(withText(R.string.later)) - .check(matches(isDisplayed())) - .perform(click()); - } catch (NoMatchingViewException e) { - //view not displayed logic - } + @Before + public void setUp() throws Exception { + context = getInstrumentation().getTargetContext(); } @Test public void testNavigateUp() { - skipSurvey(); - String expectedTitle = getInstrumentation().getTargetContext().getString(R.string.app_name); - Espresso.closeSoftKeyboard(); - Espresso.pressBack(); - onView(allOf(withContentDescription(R.string.filter_cards_title), isDisplayed())).perform(click()); - Espresso.pressBack(); + String expectedTitle = context.getString(R.string.app_name); + BBCTTestUtil.hideKeyboardAndPressBack(); + onView(allOf(withContentDescription(R.string.filter_cards_title), isDisplayed())) + .perform(click()); + BBCTTestUtil.hideKeyboardAndPressBack(); onView(allOf(withText(expectedTitle), isDisplayed())); } From 6139b10d127f78e6727d72f0a11f7fed08106668 Mon Sep 17 00:00:00 2001 From: jojonarte Date: Mon, 27 Aug 2018 22:46:27 +0800 Subject: [PATCH 5/6] LiteActivity backpress tests --- .../LiteActivityNavigateBackPressFromAboutTest.java | 11 +++++++++++ ...avigateBackPressFromBaseballCardDetailsTest.java | 13 +++++++++++++ ...tyNavigateBackPressFromBaseballCardListTest.java | 13 +++++++++++++ ...avigateBackPressFromBaseballFilterCardsTest.java | 13 +++++++++++++ 4 files changed, 50 insertions(+) create mode 100644 android/src/androidTestLite/java/bbct/android/lite/activity/test/LiteActivityNavigateBackPressFromAboutTest.java create mode 100644 android/src/androidTestLite/java/bbct/android/lite/activity/test/LiteActivityNavigateBackPressFromBaseballCardDetailsTest.java create mode 100644 android/src/androidTestLite/java/bbct/android/lite/activity/test/LiteActivityNavigateBackPressFromBaseballCardListTest.java create mode 100644 android/src/androidTestLite/java/bbct/android/lite/activity/test/LiteActivityNavigateBackPressFromBaseballFilterCardsTest.java diff --git a/android/src/androidTestLite/java/bbct/android/lite/activity/test/LiteActivityNavigateBackPressFromAboutTest.java b/android/src/androidTestLite/java/bbct/android/lite/activity/test/LiteActivityNavigateBackPressFromAboutTest.java new file mode 100644 index 000000000..d24301d06 --- /dev/null +++ b/android/src/androidTestLite/java/bbct/android/lite/activity/test/LiteActivityNavigateBackPressFromAboutTest.java @@ -0,0 +1,11 @@ +package bbct.android.lite.activity.test; + +import bbct.android.common.navigation.test.NavigateBackPressFromAboutTest; +import bbct.android.lite.provider.LiteActivity; + +public class LiteActivityNavigateBackPressFromAboutTest + extends NavigateBackPressFromAboutTest { + public LiteActivityNavigateBackPressFromAboutTest() { + super(LiteActivity.class); + } +} diff --git a/android/src/androidTestLite/java/bbct/android/lite/activity/test/LiteActivityNavigateBackPressFromBaseballCardDetailsTest.java b/android/src/androidTestLite/java/bbct/android/lite/activity/test/LiteActivityNavigateBackPressFromBaseballCardDetailsTest.java new file mode 100644 index 000000000..5df7281a8 --- /dev/null +++ b/android/src/androidTestLite/java/bbct/android/lite/activity/test/LiteActivityNavigateBackPressFromBaseballCardDetailsTest.java @@ -0,0 +1,13 @@ +package bbct.android.lite.activity.test; + +import bbct.android.common.navigation.test.NavigateBackPressFromBaseballCardDetailsTest; + + +import bbct.android.lite.provider.LiteActivity; + +public class LiteActivityNavigateBackPressFromBaseballCardDetailsTest + extends NavigateBackPressFromBaseballCardDetailsTest { + public LiteActivityNavigateBackPressFromBaseballCardDetailsTest() { + super(LiteActivity.class); + } +} diff --git a/android/src/androidTestLite/java/bbct/android/lite/activity/test/LiteActivityNavigateBackPressFromBaseballCardListTest.java b/android/src/androidTestLite/java/bbct/android/lite/activity/test/LiteActivityNavigateBackPressFromBaseballCardListTest.java new file mode 100644 index 000000000..f956c71c8 --- /dev/null +++ b/android/src/androidTestLite/java/bbct/android/lite/activity/test/LiteActivityNavigateBackPressFromBaseballCardListTest.java @@ -0,0 +1,13 @@ +package bbct.android.lite.activity.test; + +import bbct.android.common.navigation.test.NavigateBackPressFromBaseballCardListTest; + + +import bbct.android.lite.provider.LiteActivity; + +public class LiteActivityNavigateBackPressFromBaseballCardListTest + extends NavigateBackPressFromBaseballCardListTest { + public LiteActivityNavigateBackPressFromBaseballCardListTest() { + super(LiteActivity.class); + } +} diff --git a/android/src/androidTestLite/java/bbct/android/lite/activity/test/LiteActivityNavigateBackPressFromBaseballFilterCardsTest.java b/android/src/androidTestLite/java/bbct/android/lite/activity/test/LiteActivityNavigateBackPressFromBaseballFilterCardsTest.java new file mode 100644 index 000000000..f48f65b33 --- /dev/null +++ b/android/src/androidTestLite/java/bbct/android/lite/activity/test/LiteActivityNavigateBackPressFromBaseballFilterCardsTest.java @@ -0,0 +1,13 @@ +package bbct.android.lite.activity.test; + +import bbct.android.common.navigation.test.NavigateBackPressFromBaseballFilterCardsTest; + + +import bbct.android.lite.provider.LiteActivity; + +public class LiteActivityNavigateBackPressFromBaseballFilterCardsTest + extends NavigateBackPressFromBaseballFilterCardsTest { + public LiteActivityNavigateBackPressFromBaseballFilterCardsTest() { + super(LiteActivity.class); + } +} From 78b4f9076a97cb0b3eebc49aded52f1944daab3e Mon Sep 17 00:00:00 2001 From: jojonarte Date: Mon, 27 Aug 2018 22:53:37 +0800 Subject: [PATCH 6/6] MainActivity backpress tests --- .../NavigateBackPressFromBaseballCardDetailsTest.java | 7 ------- .../NavigateBackPressFromBaseballCardListTest.java | 5 ----- .../NavigateBackPressFromBaseballFilterCardsTest.java | 7 ++----- .../MainActivityNavigateBackPressFromAboutTest.java | 11 +++++++++++ ...yNavigateBackPressFromBaseballCardDetailsTest.java | 11 +++++++++++ ...vityNavigateBackPressFromBaseballCardListTest.java | 11 +++++++++++ ...yNavigateBackPressFromBaseballFilterCardsTest.java | 11 +++++++++++ 7 files changed, 46 insertions(+), 17 deletions(-) create mode 100644 android/src/androidTestPremium/java/bbct/android/premium/activity/test/MainActivityNavigateBackPressFromAboutTest.java create mode 100644 android/src/androidTestPremium/java/bbct/android/premium/activity/test/MainActivityNavigateBackPressFromBaseballCardDetailsTest.java create mode 100644 android/src/androidTestPremium/java/bbct/android/premium/activity/test/MainActivityNavigateBackPressFromBaseballCardListTest.java create mode 100644 android/src/androidTestPremium/java/bbct/android/premium/activity/test/MainActivityNavigateBackPressFromBaseballFilterCardsTest.java diff --git a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardDetailsTest.java b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardDetailsTest.java index 406dda292..acbfb1b32 100644 --- a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardDetailsTest.java +++ b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardDetailsTest.java @@ -18,12 +18,9 @@ */ package bbct.android.common.navigation.test; -import android.support.test.espresso.Espresso; -import android.support.test.espresso.NoMatchingViewException; import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; -import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -31,16 +28,12 @@ import bbct.android.common.R; import bbct.android.common.activity.MainActivity; import bbct.android.common.test.BBCTTestUtil; -import bbct.android.lite.provider.LiteActivity; import static android.support.test.InstrumentationRegistry.getInstrumentation; 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.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription; import static android.support.test.espresso.matcher.ViewMatchers.withText; -import static org.hamcrest.Matchers.allOf; @RunWith(AndroidJUnit4.class) public class NavigateBackPressFromBaseballCardDetailsTest { diff --git a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardListTest.java b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardListTest.java index 525794e22..ec4e493f1 100644 --- a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardListTest.java +++ b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballCardListTest.java @@ -19,8 +19,6 @@ package bbct.android.common.navigation.test; import android.content.Context; -import android.support.test.espresso.Espresso; -import android.support.test.espresso.NoMatchingViewException; import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; @@ -29,15 +27,12 @@ import org.junit.Test; import org.junit.runner.RunWith; - import bbct.android.common.R; import bbct.android.common.activity.MainActivity; import bbct.android.common.test.BBCTTestUtil; -import bbct.android.lite.provider.LiteActivity; import static android.support.test.InstrumentationRegistry.getInstrumentation; 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.isDisplayed; import static android.support.test.espresso.matcher.ViewMatchers.withText; diff --git a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballFilterCardsTest.java b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballFilterCardsTest.java index a854e6e41..8fdd6dee8 100644 --- a/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballFilterCardsTest.java +++ b/android/src/androidTest/java/bbct/android/common/navigation/test/NavigateBackPressFromBaseballFilterCardsTest.java @@ -19,8 +19,6 @@ package bbct.android.common.navigation.test; import android.content.Context; -import android.support.test.espresso.Espresso; -import android.support.test.espresso.NoMatchingViewException; import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; @@ -32,14 +30,13 @@ import bbct.android.common.R; import bbct.android.common.activity.MainActivity; import bbct.android.common.test.BBCTTestUtil; -import bbct.android.lite.provider.LiteActivity; import static android.support.test.InstrumentationRegistry.getInstrumentation; 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.isDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription; +import static android.support.test.espresso.matcher.ViewMatchers + .withContentDescription; import static android.support.test.espresso.matcher.ViewMatchers.withText; import static org.hamcrest.Matchers.allOf; diff --git a/android/src/androidTestPremium/java/bbct/android/premium/activity/test/MainActivityNavigateBackPressFromAboutTest.java b/android/src/androidTestPremium/java/bbct/android/premium/activity/test/MainActivityNavigateBackPressFromAboutTest.java new file mode 100644 index 000000000..ea0c5f9b0 --- /dev/null +++ b/android/src/androidTestPremium/java/bbct/android/premium/activity/test/MainActivityNavigateBackPressFromAboutTest.java @@ -0,0 +1,11 @@ +package bbct.android.premium.activity.test; + +import bbct.android.common.activity.MainActivity; +import bbct.android.common.navigation.test.NavigateBackPressFromAboutTest; + +public class MainActivityNavigateBackPressFromAboutTest + extends NavigateBackPressFromAboutTest { + public MainActivityNavigateBackPressFromAboutTest() { + super(MainActivity.class); + } +} diff --git a/android/src/androidTestPremium/java/bbct/android/premium/activity/test/MainActivityNavigateBackPressFromBaseballCardDetailsTest.java b/android/src/androidTestPremium/java/bbct/android/premium/activity/test/MainActivityNavigateBackPressFromBaseballCardDetailsTest.java new file mode 100644 index 000000000..a0446f740 --- /dev/null +++ b/android/src/androidTestPremium/java/bbct/android/premium/activity/test/MainActivityNavigateBackPressFromBaseballCardDetailsTest.java @@ -0,0 +1,11 @@ +package bbct.android.premium.activity.test; + +import bbct.android.common.activity.MainActivity; +import bbct.android.common.navigation.test.NavigateBackPressFromBaseballCardDetailsTest; + +public class MainActivityNavigateBackPressFromBaseballCardDetailsTest + extends NavigateBackPressFromBaseballCardDetailsTest { + public MainActivityNavigateBackPressFromBaseballCardDetailsTest() { + super(MainActivity.class); + } +} diff --git a/android/src/androidTestPremium/java/bbct/android/premium/activity/test/MainActivityNavigateBackPressFromBaseballCardListTest.java b/android/src/androidTestPremium/java/bbct/android/premium/activity/test/MainActivityNavigateBackPressFromBaseballCardListTest.java new file mode 100644 index 000000000..0005fb969 --- /dev/null +++ b/android/src/androidTestPremium/java/bbct/android/premium/activity/test/MainActivityNavigateBackPressFromBaseballCardListTest.java @@ -0,0 +1,11 @@ +package bbct.android.premium.activity.test; + +import bbct.android.common.activity.MainActivity; +import bbct.android.common.navigation.test.NavigateBackPressFromBaseballCardListTest; + +public class MainActivityNavigateBackPressFromBaseballCardListTest + extends NavigateBackPressFromBaseballCardListTest { + public MainActivityNavigateBackPressFromBaseballCardListTest() { + super(MainActivity.class); + } +} diff --git a/android/src/androidTestPremium/java/bbct/android/premium/activity/test/MainActivityNavigateBackPressFromBaseballFilterCardsTest.java b/android/src/androidTestPremium/java/bbct/android/premium/activity/test/MainActivityNavigateBackPressFromBaseballFilterCardsTest.java new file mode 100644 index 000000000..0ed7aa5ba --- /dev/null +++ b/android/src/androidTestPremium/java/bbct/android/premium/activity/test/MainActivityNavigateBackPressFromBaseballFilterCardsTest.java @@ -0,0 +1,11 @@ +package bbct.android.premium.activity.test; + +import bbct.android.common.activity.MainActivity; +import bbct.android.common.navigation.test.NavigateBackPressFromBaseballFilterCardsTest; + +public class MainActivityNavigateBackPressFromBaseballFilterCardsTest + extends NavigateBackPressFromBaseballFilterCardsTest { + public MainActivityNavigateBackPressFromBaseballFilterCardsTest() { + super(MainActivity.class); + } +}