-
Notifications
You must be signed in to change notification settings - Fork 5
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
BottomSheetDialogFragment not included in screenshots? #87
Comments
@amanzan Thank you for the bug report. Testify isn't currently able to capture the bottom sheet fragment on top of another fragment/activity since its internal capture mechanism is based on the view hierarchy. Basically, the bottom sheet isn't in the same view hierarchy, so it's not getting captured. Supporting this case would be a nice addition to the next version of Testify and so I've tagged this to the 1.2 milestone. As a workaround for testing bottom sheet fragments, I recommend that you write your test so that you focus on testing the contents of the fragment in isolation, instead of actually as being rendered in a bottom sheet. You can do this by loading the Fragment directly into a host activity and using Testify to capture that, or you can try using |
Copied from @amanzan Shopify/android-testify#243 (comment) @DanielJette would it be possible to extend somehow ScreenshotRule, so that there's a new assertSame function which accepts currentBitmap as parameter? This way, I could take a screenshot of the entire screen and pass it |
Hi @amanzan I have a work-in-progress branch here https://github.com/Shopify/android-testify/compare/227-extensible that demonstrates one way that Testify can allow for custom capture methods. |
Copied from @amanzan Shopify/android-testify#243 (comment) Cool, looking forward to it 👌 Thanks! |
Copied from @jennatauro Hi @DanielJette would this issue also be applicable to
I wasn't sure if this was due to a timing issue with when the screenshot is taken or if it's because the dropdown is rendered in a different view hierarchy. |
@jennatauro I added a Here is the Layout Inspector output: It appears that the Dropdown is rendered in a different layer than the rest of the composition. I suspect this is likely implemented via a new Window by the compose renderer and this Window is not being captured. You can find my changes to the Sample here Shopify/android-testify#262 As of yet, I don't know how to resolve this issue, but it might be possible to direct Testify to capture the popup Window. Due to the limitations of Testify, it is not likely possible to capture the entire screen without also capturing the System UI. There is an issue requesting full-screen capture here. |
Copied from @amanzan Hi @DanielJette, I see there is a 1.2.0-beta1 version available. Would this be possible to do in that version then? If so, would you mind guiding me how to approach it? |
@amanzan Unfortunately the 1.2.0-beta1 version has not been published and there are no plans to publish this version to the Shopify repository. Future updates will be published under the The full-screen functionality you are looking for will be published in the We're still working through a lot of details regarding the move to the new repository, so stay tuned for updates. I would anticipate this library being published in Q3 2022. |
Testify now supports capturing the entire screen, including Dialogs, Menus and Bottom Sheets, through the user of the FullscreenCapture method. To capture Dialogs. Menus and Bottom Sheets with Testify:
For more information, see the example here. |
Describe the bug
Trying to record the baseline screenshots for an app with a BottomSheetDialogFragment opened. The screenshot doesn't include the BottomSheetDialogFragment, only the everything that is behind it
This issue relates to:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The opened BottomSheetDialogFragment should be included in the screenshot
Screenshots
App with BottomSheetDialogFragment opened (disregard bottom nav menu):
Recorded baseline screenshot:
Desktop (please complete the following information):
Target Android Device (please complete the following information):
cc @amanzan ported from Shopify/android-testify#243
The text was updated successfully, but these errors were encountered: