Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialogs in screenshot testing golden image appear to be full width #635

Open
kartollikaa opened this issue Jan 21, 2025 · 2 comments
Open

Comments

@kartollikaa
Copy link

kartollikaa commented Jan 21, 2025

Hi!

I've encountered the problem with Roborazzi that AlertDIalog in compose @Previews is drawn in inappropriate way. Generally, the AlertDialog fits the whole width

How the preview in Android Studio looks like:

Image

What the Roborazzi generates:

Image

To capture, I used the following block

AndroidComposeTestRule.onRoot()
        .captureRoboImage(
            filePath = "$outputDirectory/$screenshotName.${provideRoborazziContext().imageExtension}",
            roborazziOptions = roborazziOptions,
        )

I've discovered the issue with Material 2 AlertDialog. I was hoping that Material 3 Dialog would work better, but still this thing happens

Please reach me if you recognise this problem or if I should add some missing information for you!

@kartollikaa kartollikaa changed the title Dialogs in screenshot testing golden image appear to be full width and clips the background around it Dialogs in screenshot testing golden image appear to be full width Jan 21, 2025
@takahirom
Copy link
Owner

Thanks! I wasn't aware of this issue. Since Roborazzi takes an image of each window and overlays them, I suspect this problem might be originating from Robolectric. I'll look into it further.

@kartollikaa
Copy link
Author

Thanks for the answer!
Looking forward to hear some news from you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants