Skip to content

Commit

Permalink
For mozilla-mobile#20814 fix flaky tabMediaControlButtonTest UI test
Browse files Browse the repository at this point in the history
  • Loading branch information
AndiAJ authored and mergify[bot] committed Oct 5, 2021
1 parent 6faafe4 commit 8a8bbd9
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,18 @@ class TabDrawerRobot {
}

fun verifyTabMediaControlButtonState(action: String) {
mDevice.waitNotNull(
findObject(
By
.res("$packageName:id/play_pause_button")
.desc(action)
),
waitingTime
)
mDevice.waitForIdle()

tabMediaControlButton().check(matches(withContentDescription(action)))
mDevice.findObject(
UiSelector()
.resourceId("$packageName:id/play_pause_button")
).waitForExists(waitingTime)

assertTrue(
mDevice.findObject(
UiSelector().descriptionContains(action)
).waitForExists(waitingTime)
)
}

fun clickTabMediaControlButton() = tabMediaControlButton().click()
Expand Down

0 comments on commit 8a8bbd9

Please sign in to comment.