-
- All Implemented Interfaces:
-
org.junit.rules.TestRule
@Deprecated(message = Use RNG and roborazzi directly) public final class ScreenshotTestRule implements TestRule
A TestRule that allows you to run screenshot tests of your composable components.
This rule requires robolectric, so the test suite should run with RobolectricTestRunner. See ScreenshotBaseTest for a basic configuration.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classScreenshotTestRule.ScreenshotTestRuleParamspublic enumScreenshotTestRule.RecordModepublic enumScreenshotTestRule.ClipModepublic classScreenshotTestRule.Companion
-
Constructor Summary
Constructors Constructor Description ScreenshotTestRule(ScreenshotTestRule.ScreenshotTestRuleParams params)
-
Method Summary
Modifier and Type Method Description Statementapply(Statement base, Description description)final UnitsetContent(Boolean isComponent, Function1<Function0<Unit>, Unit> componentDefaultContent, Boolean takeScreenshot, Boolean roundScreen, Function0<Unit> timeText, Function0<Unit> positionIndicator, FakeImageLoader fakeImageLoader, Function0<Unit> composable)final Unitinteract(Function1<ComposeTestRule, Unit> block)final UnittakeScreenshot()-
-
Constructor Detail
-
ScreenshotTestRule
ScreenshotTestRule(ScreenshotTestRule.ScreenshotTestRuleParams params)
-
-
Method Detail
-
apply
Statement apply(Statement base, Description description)
-
setContent
final Unit setContent(Boolean isComponent, Function1<Function0<Unit>, Unit> componentDefaultContent, Boolean takeScreenshot, Boolean roundScreen, Function0<Unit> timeText, Function0<Unit> positionIndicator, FakeImageLoader fakeImageLoader, Function0<Unit> composable)
-
takeScreenshot
final Unit takeScreenshot()
-
-
-
-