sergio-sastre / AndroidUiTestingUtils

A set of TestRules, ActivityScenarios and utils to facilitate UI and screenshot testing under given configurations: FontSizes, Locales...
MIT License
285 stars 14 forks source link

Cross-Library screenshot tests executed with Roborazzi do not render shadows for Dialogs ONLY #121

Open sergio-sastre opened 2 months ago

sergio-sastre commented 2 months ago

Describe the bug Even though we enable Hardware native graphics, Cross-Library screenshot tests executed with Roborazzi do not render shadows when screenshot testing dialogs. It works for Composables and Views though.

Additional context That happens because in the method snapshotDialog(), The RoborazziScreenshotTestRuleForViewuses drawToBitmap(), which uses Canvas (no elevation). The best fix for this would be to add an option in RoborazziConfig for the BitmapCaptureMethod, analogue to that of DropshotsConfig, ShotConfig and AndroidTestifyConfig, to choose whether to render with or without elevation