Skip to content

Commit

Permalink
Handle flaky Espresso test
Browse files Browse the repository at this point in the history
  • Loading branch information
amberin committed May 11, 2024
1 parent dc1759e commit c802300
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.test.core.app.ActivityScenario
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withText
import com.orgzly.R
Expand Down Expand Up @@ -92,6 +93,8 @@ class ShareActivityTest : OrgzlyTest() {

onView(withId(R.id.location_button)).perform(scroll(), click())
onView(withText("book-two")).perform(click())
SystemClock.sleep(100)
onView(isRoot()).perform(waitId(R.id.location_button, 5000))
onView(withId(R.id.location_button)).check(matches(withText("book-two")))

scenario.onActivity { activity ->
Expand Down

0 comments on commit c802300

Please sign in to comment.