Skip to content

Commit

Permalink
Update dependencies (#2460)
Browse files Browse the repository at this point in the history
Update Compose BOM to 2024.11.00
Update Navigation to 2.8.4
Update Compose Material 3 to 1.0.0-alpha29
Update Compose to 1.5.0-alpha06
Update Paging Compose to 3.3.4
Update Robolectric to 4.14
Update Markdown renderer to 0.26.0

Update the Robolectric test target SDK to 35.

* Fix: Suppress a11y TouchTargetSizeCheck on the screen edge

Suppresses a TouchTargetSizeCheck accessibility error that occurs on the screen edge
, specifically when the year is off-screen initially in the DatePicker composable.

This change modifies the AccessibilityValidator configuration to ignore this specific error by adding a suppressing result matcher. Additionally, it enables screenshot capturing and saving during accessibility validation.
  • Loading branch information
yschimke authored Nov 16, 2024
1 parent 59118ca commit facd0c0
Show file tree
Hide file tree
Showing 1,045 changed files with 1,738 additions and 1,693 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,34 @@ import androidx.compose.ui.test.assertHasClickAction
import androidx.compose.ui.test.onNodeWithContentDescription
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import com.google.android.apps.common.testing.accessibility.framework.AccessibilityViewCheckResult
import com.google.android.apps.common.testing.accessibility.framework.checks.TouchTargetSizeCheck
import com.google.android.apps.common.testing.accessibility.framework.integrations.espresso.AccessibilityValidator
import com.google.android.horologist.screenshots.rng.WearLegacyA11yTest
import org.hamcrest.Description
import org.hamcrest.TypeSafeMatcher
import org.junit.Test
import java.time.LocalDate

class DatePickerA11yTest : WearLegacyA11yTest() {
override fun configureAccessibilityValidator(validator: AccessibilityValidator) {
super.configureAccessibilityValidator(validator)
validator.setSuppressingResultMatcher(
// Year is off screen initially
object : TypeSafeMatcher<AccessibilityViewCheckResult>() {
override fun matchesSafely(item: AccessibilityViewCheckResult): Boolean {
val isTouchTargetCheck =
item.accessibilityHierarchyCheck == TouchTargetSizeCheck::class.java
return (isTouchTargetCheck && item.element?.boundsInScreen?.right == 454)
}

override fun describeTo(description: Description) {
description.appendText("a TouchTargetSizeCheck on the screen edge")
}
},
)
}

@Test
fun screenshot() {
enableTouchExploration()
Expand All @@ -48,28 +71,19 @@ class DatePickerA11yTest : WearLegacyA11yTest() {
)
}

composeRule.onNodeWithContentDescription("Next")
.assertHasClickAction()
.performClick()
composeRule.onNodeWithContentDescription("Next").assertHasClickAction().performClick()

composeRule.onNodeWithText("Day")
.assertExists()
composeRule.onNodeWithText("Day").assertExists()
captureScreenshot("_1")

composeRule.onNodeWithContentDescription("Next")
.assertHasClickAction()
.performClick()
composeRule.onNodeWithContentDescription("Next").assertHasClickAction().performClick()

composeRule.onNodeWithText("Month")
.assertExists()
composeRule.onNodeWithText("Month").assertExists()
captureScreenshot("_2")

composeRule.onNodeWithContentDescription("Next")
.assertHasClickAction()
.performClick()
composeRule.onNodeWithContentDescription("Next").assertHasClickAction().performClick()

composeRule.onNodeWithText("Year")
.assertExists()
composeRule.onNodeWithText("Year").assertExists()
captureScreenshot("_3")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import androidx.compose.ui.test.onNodeWithContentDescription
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.performClick
import androidx.wear.compose.material.Text
import com.github.takahirom.roborazzi.RobolectricDeviceQualifiers
import com.google.common.truth.Truth.assertThat
import org.junit.Assert
import org.junit.Rule
Expand All @@ -39,8 +40,8 @@ import java.time.LocalDate

@RunWith(RobolectricTestRunner::class)
@Config(
sdk = [33],
qualifiers = "w227dp-h227dp-small-notlong-round-watch-xhdpi-keyshidden-nonav",
sdk = [35],
qualifiers = RobolectricDeviceQualifiers.WearOSLargeRound,
)
@GraphicsMode(GraphicsMode.Mode.NATIVE)
class DatePickerInteractionTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.github.takahirom.roborazzi.RobolectricDeviceQualifiers
import com.google.android.horologist.screenshots.rng.WearLegacyScreenTest
import org.junit.Test
import org.robolectric.annotation.Config

@Config(
sdk = [33],
qualifiers = "w227dp-h227dp-small-notlong-notround-watch-xhdpi-keyshidden-nonav",
sdk = [35],
qualifiers = RobolectricDeviceQualifiers.WearOSSquare,
)
class SquareSegmentedProgressIndicatorTest :
WearLegacyScreenTest() {
Expand Down
Loading

0 comments on commit facd0c0

Please sign in to comment.