Skip to content

Commit

Permalink
Decrease number of key events due to flakiness
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensousa committed Jun 19, 2024
1 parent 7eb8e7e commit aaf0827
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ class KeyEventsTest : RecyclerViewTest() {
launchGridFragment()
Espresso.onIdle()

KeyEvents.pressRight(times = 10)
assert(DpadRecyclerViewAssertions.isFocused(position = 10))
KeyEvents.pressRight(times = 8)
performActions(DpadRecyclerViewActions.waitForIdleScroll())

assert(DpadRecyclerViewAssertions.isFocused(position = 8))

KeyEvents.pressLeft(times = 8)
performActions(DpadRecyclerViewActions.waitForIdleScroll())
KeyEvents.pressLeft(times = 10)

assert(DpadRecyclerViewAssertions.isFocused(position = 0))
}

Expand All @@ -47,10 +50,13 @@ class KeyEventsTest : RecyclerViewTest() {
Espresso.onIdle()

KeyEvents.pressDown(times = 5)
performActions(DpadRecyclerViewActions.waitForIdleScroll())

assert(DpadRecyclerViewAssertions.isFocused(position = 5 * 5))

performActions(DpadRecyclerViewActions.waitForIdleScroll())
KeyEvents.pressUp(times = 5)
performActions(DpadRecyclerViewActions.waitForIdleScroll())

assert(DpadRecyclerViewAssertions.isFocused(position = 0))
}
}

0 comments on commit aaf0827

Please sign in to comment.