diff --git a/app/src/androidTest/java/com/duckduckgo/espresso/privacy/RequestBlockingTest.kt b/app/src/androidTest/java/com/duckduckgo/espresso/privacy/RequestBlockingTest.kt index be2c5dc2fe76..ff2ffaa0453d 100644 --- a/app/src/androidTest/java/com/duckduckgo/espresso/privacy/RequestBlockingTest.kt +++ b/app/src/androidTest/java/com/duckduckgo/espresso/privacy/RequestBlockingTest.kt @@ -21,6 +21,7 @@ import androidx.test.core.app.* import androidx.test.espresso.Espresso.onView import androidx.test.espresso.IdlingRegistry import androidx.test.espresso.IdlingResource +import androidx.test.espresso.action.ViewActions import androidx.test.espresso.action.ViewActions.click import androidx.test.espresso.matcher.ViewMatchers.* import androidx.test.espresso.web.model.Atoms.script @@ -89,6 +90,9 @@ class RequestBlockingTest { onView(isRoot()).perform(waitForView(withId(R.id.privacyProtectionMenuItem))) onView(withId(R.id.privacyProtectionMenuItem)).perform(click()) + // handle the privacy protection toggle check screen showing + onView(isRoot()).perform(ViewActions.pressBack()) + val idlingResourceForScript: IdlingResource = WebViewIdlingResource(webView!!) IdlingRegistry.getInstance().register(idlingResourceForScript) diff --git a/app/src/androidTest/java/com/duckduckgo/espresso/privacy/SurrogatesTest.kt b/app/src/androidTest/java/com/duckduckgo/espresso/privacy/SurrogatesTest.kt index c1d326b73846..48fba524ec43 100644 --- a/app/src/androidTest/java/com/duckduckgo/espresso/privacy/SurrogatesTest.kt +++ b/app/src/androidTest/java/com/duckduckgo/espresso/privacy/SurrogatesTest.kt @@ -97,6 +97,9 @@ class SurrogatesTest { onView(isRoot()).perform(waitForView(withId(R.id.privacyProtectionMenuItem))) onView(withId(R.id.privacyProtectionMenuItem)).perform(ViewActions.click()) + // handle the privacy protection toggle check screen showing + onView(isRoot()).perform(ViewActions.pressBack()) + val idlingResourceForScript: IdlingResource = WebViewIdlingResource(webView!!) IdlingRegistry.getInstance().register(idlingResourceForScript)