Skip to content

Commit

Permalink
Fixed tests passing on removing DisableAccessibilityTest
Browse files Browse the repository at this point in the history
  • Loading branch information
vrajdesai78 committed Jan 13, 2022
1 parent 1566b0d commit fe3b0f8
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions testing/src/main/java/org/oppia/android/testing/OppiaTestRule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,23 @@ class OppiaTestRule : TestRule {
" $currentEnvironment"
)
}
currentPlatform == TestPlatform.ESPRESSO && isEnabled -> {
AccessibilityChecks.enable().apply {
// Suppressing failures for all views which matches with below conditions as we do not
// want to change the UI to pass these failures as it will change the expected behaviour
// for learner.
setSuppressingResultMatcher(
allOf(
matchesCheckNames(`is`("TouchTargetSizeViewCheck")),
matchesViews(withContentDescription("More options")),
matchesViews(withClassName(endsWith("OverflowMenuButton")))
)
)
}.setRunChecksFromRootView(true)
}
else -> throw AssertionError("Reached impossible state in test rule")
}
if (currentPlatform == TestPlatform.ESPRESSO && isEnabled) {
AccessibilityChecks.enable().apply {
// Suppressing failures for all views which matches with below conditions as we do not
// want to change the UI to pass these failures as it will change the expected behaviour
// for learner.
setSuppressingResultMatcher(
allOf(
matchesCheckNames(`is`("TouchTargetSizeViewCheck")),
matchesViews(withContentDescription("More options")),
matchesViews(withClassName(endsWith("OverflowMenuButton")))
)
)
}.setRunChecksFromRootView(true)
}
base?.evaluate()
}
}
}
Expand Down

0 comments on commit fe3b0f8

Please sign in to comment.