Skip to content

AccessibilityRenderExtension doesn't work correctly with RenderingMode.SHRINK #1350

@VirtualParticle

Description

@VirtualParticle

Description
Using the AccessibilityRenderExtension is useful for analyzing accessibility information, but the information added to the side of the screenshot is cropped out when the SHRINK rendering mode is used.

Steps to Reproduce
Here is an example test:

class ExampleTest {

    @get:Rule
    val paparazzi = Paparazzi(
        renderingMode = RenderingMode.SHRINK,
        renderExtensions = setOf(AccessibilityRenderExtension()),
    )

    @Test
    fun exampleTest() {
        paparazzi.snapshot {
            Box(
                modifier = Modifier
                    .background(Color.White)
                    .padding(16.dp)
            ) {
                Text(text = "Hello, world!")
            }
        }
    }

}

Expected behavior
I would expect for the accessibility information on the side of the screenshot to be included in the cropped screenshot, that is to say that the crop would take into account the size of the accessibility information, even if it was taller than the actual content.

Additional information:

  • Paparazzi Version: 1.3.3
  • OS: MacOS
  • Compile SDK: 34
  • Gradle Version: 8.6
  • Android Gradle Plugin Version: 8.3.0

Screenshots
Screenshot using SHRINK:
image

Screenshot using NORMAL:
image

I've given fixing this a look and it seems like one of the challenges here is that the accessibility information is a canvas element which can't easily use things like WRAP_CONTENT.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions