From a93cccc4bc6efc921335a4ba8843a906bbbe7623 Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Thu, 21 Mar 2024 16:40:50 +0100 Subject: [PATCH] Updated tests --- .../ui/MainActivityWebsitesTest.java | 7 ----- .../ui/resultdetails/WebsitesTest.java | 30 +++++++++---------- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/app/src/androidTest/java/org/openobservatory/ooniprobe/ui/MainActivityWebsitesTest.java b/app/src/androidTest/java/org/openobservatory/ooniprobe/ui/MainActivityWebsitesTest.java index 5ca95b641..a45b9d810 100644 --- a/app/src/androidTest/java/org/openobservatory/ooniprobe/ui/MainActivityWebsitesTest.java +++ b/app/src/androidTest/java/org/openobservatory/ooniprobe/ui/MainActivityWebsitesTest.java @@ -142,13 +142,6 @@ public void lunchCustomWebsiteIntentTest() { new Instrumentation.ActivityResult(Activity.RESULT_OK, emptyIntent); intending(anyIntent()).respondWith(result); - - onView(withId(R.id.runButton)).perform(click()); - // TODO(aanorbel): resolve issue. Running activity no longer available. - // ```intended(hasComponent(hasClassName(RunningActivity.class.getName())));``` - // progress display is dismissed before its availability is checked - // ```onView(withId(R.id.progress_layout)).check(matches(isDisplayed()));``` - Intents.release(); } diff --git a/app/src/androidTest/java/org/openobservatory/ooniprobe/ui/resultdetails/WebsitesTest.java b/app/src/androidTest/java/org/openobservatory/ooniprobe/ui/resultdetails/WebsitesTest.java index aad166fb6..fa8ebb1bc 100644 --- a/app/src/androidTest/java/org/openobservatory/ooniprobe/ui/resultdetails/WebsitesTest.java +++ b/app/src/androidTest/java/org/openobservatory/ooniprobe/ui/resultdetails/WebsitesTest.java @@ -1,5 +1,19 @@ package org.openobservatory.ooniprobe.ui.resultdetails; +import static androidx.test.espresso.Espresso.onData; +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.contrib.RecyclerViewActions.scrollToPosition; +import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isRoot; +import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; +import static org.hamcrest.Matchers.anything; +import static org.hamcrest.Matchers.containsString; +import static org.openobservatory.ooniprobe.ui.utils.RecyclerViewMatcher.withRecyclerView; +import static org.openobservatory.ooniprobe.ui.utils.ViewMatchers.waitPartialText; + import androidx.test.ext.junit.runners.AndroidJUnit4; import com.schibsted.spain.barista.rule.flaky.AllowFlaky; @@ -14,26 +28,10 @@ import org.openobservatory.ooniprobe.factory.ResultFactory; import org.openobservatory.ooniprobe.model.database.Measurement; import org.openobservatory.ooniprobe.model.database.Result; -import org.openobservatory.ooniprobe.test.suite.WebsitesSuite; import java.util.List; import java.util.concurrent.TimeUnit; -import static androidx.test.espresso.Espresso.onData; -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.contrib.RecyclerViewActions.actionOnItemAtPosition; -import static androidx.test.espresso.contrib.RecyclerViewActions.scrollToPosition; -import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; -import static androidx.test.espresso.matcher.ViewMatchers.isRoot; -import static androidx.test.espresso.matcher.ViewMatchers.withId; -import static androidx.test.espresso.matcher.ViewMatchers.withText; -import static org.hamcrest.Matchers.anything; -import static org.hamcrest.Matchers.containsString; -import static org.openobservatory.ooniprobe.ui.utils.RecyclerViewMatcher.withRecyclerView; -import static org.openobservatory.ooniprobe.ui.utils.ViewMatchers.waitPartialText; - @RunWith(AndroidJUnit4.class) public class WebsitesTest extends MeasurementAbstractTest {