Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into output_error
Browse files Browse the repository at this point in the history
  • Loading branch information
yschimke committed Nov 23, 2024
2 parents e60a066 + cb73af6 commit 8121a89
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ data class RoborazziATFAccessibilityChecker(
return
}

if (!canScreenshot()) {
roborazziErrorLog("Skipping accessibilityChecks on GraphicsMode.Mode.LEGACY")
return
}

if (Build.FINGERPRINT == "robolectric") {
// TODO remove this once ATF doesn't bail out
// https://github.com/google/Accessibility-Test-Framework-for-Android/blob/c65cab02b2a845c29c3da100d6adefd345a144e3/src/main/java/com/google/android/apps/common/testing/accessibility/framework/uielement/AccessibilityHierarchyAndroid.java#L667
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,5 +218,41 @@ class ComposeA11yTest {
)
)
}

@Test
@Config(sdk = [33])
fun wrongApi() {
composeTestRule.setContent {
// No failures because not API 34

Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
Box(
modifier = Modifier
.size(100.dp)
.background(Color.DarkGray)
) {
Text("Something hard to read", color = Color.DarkGray)
}
}
}
}

@Test
@GraphicsMode(GraphicsMode.Mode.LEGACY)
fun notNative() {
// No failures because legacy

composeTestRule.setContent {
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
Box(
modifier = Modifier
.size(100.dp)
.background(Color.DarkGray)
) {
Text("Something hard to read", color = Color.DarkGray)
}
}
}
}
}

0 comments on commit 8121a89

Please sign in to comment.