diff --git a/app/src/androidTest/java/com/a1/nextlocation/LocationDetailFragment.java b/app/src/androidTest/java/com/a1/nextlocation/LocationDetailFragment.java deleted file mode 100644 index 3942ba0..0000000 --- a/app/src/androidTest/java/com/a1/nextlocation/LocationDetailFragment.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.a1.nextlocation; - -import androidx.test.rule.ActivityTestRule; - -import com.a1.nextlocation.fragments.CouponFragment; - -import org.junit.Rule; -import org.junit.Test; - -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.isDisplayed; -import static androidx.test.espresso.matcher.ViewMatchers.withId; - -public class LocationDetailFragment { - @Rule - public ActivityTestRule mActivityTestRule = new ActivityTestRule<>(MainActivity.class); - - @Test - public void clickBackButton() throws Exception{ - //Here we click the back button and then we check if the locationFragment is shown - mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new com.a1.nextlocation.fragments.LocationDetailFragment()).commit(); - onView(withId(R.id.detail_location_back_button)).perform(click()); - onView(withId(R.id.locationFragment)).check(matches(isDisplayed())); - } -} diff --git a/app/src/androidTest/java/com/a1/nextlocation/RouteFragmentTest.java b/app/src/androidTest/java/com/a1/nextlocation/RouteFragmentTest.java index c42c59f..1712c76 100644 --- a/app/src/androidTest/java/com/a1/nextlocation/RouteFragmentTest.java +++ b/app/src/androidTest/java/com/a1/nextlocation/RouteFragmentTest.java @@ -27,13 +27,4 @@ public class RouteFragmentTest { onView(withId(R.id.homeFragment)).check(matches(isDisplayed())); } - - @Test - public void clickDetailButton() throws Exception{ - //Here we click an item in the recyclerview and then check if the routeDetailFragment is called - mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new RouteFragment()).commit(); - onView(withId(R.id.route_recyclerview)).perform(RecyclerViewActions.actionOnItemAtPosition(0, click())); - onView(withId(R.id.routeDetailFragment)).check(matches(isDisplayed())); - - } }