Skip to content

Commit 67690c0

Browse files
authored
Fix privacy tests which are currently getting interrupted with the privacy toggle check screen (#5379)
Task/Issue URL: https://app.asana.com/0/488551667048375/1208945103446235/f ### Description Fixes the tests which are failing due to a new screen being presented when privacy protections are disabled. The fix is simply backing out of those screens as part of the test scripts. ### Steps to test this PR - [x] Ensure privacy tests succeeded: https://github.com/duckduckgo/Android/actions/runs/12275448579 Co-authored-by: Craig Russell <[email protected]>
1 parent c36dc4c commit 67690c0

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

app/src/androidTest/java/com/duckduckgo/espresso/privacy/RequestBlockingTest.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import androidx.test.core.app.*
2121
import androidx.test.espresso.Espresso.onView
2222
import androidx.test.espresso.IdlingRegistry
2323
import androidx.test.espresso.IdlingResource
24+
import androidx.test.espresso.action.ViewActions
2425
import androidx.test.espresso.action.ViewActions.click
2526
import androidx.test.espresso.matcher.ViewMatchers.*
2627
import androidx.test.espresso.web.model.Atoms.script
@@ -89,6 +90,9 @@ class RequestBlockingTest {
8990
onView(isRoot()).perform(waitForView(withId(R.id.privacyProtectionMenuItem)))
9091
onView(withId(R.id.privacyProtectionMenuItem)).perform(click())
9192

93+
// handle the privacy protection toggle check screen showing
94+
onView(isRoot()).perform(ViewActions.pressBack())
95+
9296
val idlingResourceForScript: IdlingResource = WebViewIdlingResource(webView!!)
9397
IdlingRegistry.getInstance().register(idlingResourceForScript)
9498

app/src/androidTest/java/com/duckduckgo/espresso/privacy/SurrogatesTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ class SurrogatesTest {
9797
onView(isRoot()).perform(waitForView(withId(R.id.privacyProtectionMenuItem)))
9898
onView(withId(R.id.privacyProtectionMenuItem)).perform(ViewActions.click())
9999

100+
// handle the privacy protection toggle check screen showing
101+
onView(isRoot()).perform(ViewActions.pressBack())
102+
100103
val idlingResourceForScript: IdlingResource = WebViewIdlingResource(webView!!)
101104
IdlingRegistry.getInstance().register(idlingResourceForScript)
102105

0 commit comments

Comments
 (0)