Skip to content

Commit

Permalink
Fix privacy tests which are currently getting interrupted with the pr…
Browse files Browse the repository at this point in the history
…ivacy 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]>
  • Loading branch information
CDRussell and CDRussell authored Dec 11, 2024
1 parent c36dc4c commit 67690c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 67690c0

Please sign in to comment.