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

LinearProgressIndicator stalls Roborazzi @Preview tests #550

Open
as6o opened this issue Nov 11, 2024 · 1 comment
Open

LinearProgressIndicator stalls Roborazzi @Preview tests #550

as6o opened this issue Nov 11, 2024 · 1 comment

Comments

@as6o
Copy link

as6o commented Nov 11, 2024

When Roborazzi processes a @Preview (using the Compose Preview support) containing an indeterminate LinearProgressIndicator (during recordRoborazziDebug, verifyRoborazziDebug, etc.) it stalls for a good 4 minutes or more (whereas all other @Preview-based tests are quick). We assume that the delay has to do with the ProgressIndicator animation so we are skipping those @previews using a custom ComposePreviewTester for now. However, is there a strategy for dealing with such tests that contain animations?

@takahirom
Copy link
Owner

takahirom commented Nov 11, 2024

Thanks.
One thing I can recommend is adding the DelayedPreview annotation. With this annotation, you can set mainClock.autoAdvance = false and then use mainClock.advanceTimeBy(delay). This should help the test finish quickly.
The information is in Japanese, but you can refer to the code.

https://github.com/DeNA/android-modern-architecture-test-handson/blob/main/docs/handson/VisualRegressionTest_Preview_ComposablePreviewScanner.md#composepreviewtester%E3%81%AE%E5%AE%9F%E8%A3%85

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