Skip to content

1.8.0-alpha-5

Compare
Choose a tag to compare
@takahirom takahirom released this 06 Nov 01:10
· 1005 commits to main since this release
fe7448d

New Feature

Introducing the experimental roboOutputName() function: Streamline the customization of Roborazzi image file names. This utility is especially effective in parameterized tests, allowing for dynamic file naming based on test parameters. For an example of its usage, see the snippet below, which demonstrates generating screenshots before and after UI interactions.

@Test
fun launchScreen() {
  // Generates a file named "org.your.pkg.TestClassName.launchScreen_before.png"
  onView(ViewMatchers.isRoot()).captureRoboImage("${roboOutputName()}_before.png")
  // Replace with specific actions, e.g., onView(xxx).performClick()
  
  // Generates a file named "org.your.pkg.TestClassName.launchScreen_after.png"
  onView(ViewMatchers.isRoot()).captureRoboImage("${roboOutputName()}_after.png")
}

Tailor your file naming convention in gradle.properties for even more control, such as omitting the package name.
Set roborazzi.record.namingStrategy=testClassAndMethod for a streamlined naming pattern.
Learn more: Roborazzi Documentation

What's Changed

  • Add a document about experimental output parameter by @takahirom in #195
  • Migrate Robolectric to gradle version catalog by @takahirom in #196
  • Add default parameter for CompareOptions.resultValidator by @takahirom in #203
  • Enhance Flexibility with Custom File Naming in Roborazzi via roboOutputName() Function by @takahirom in #205 . Thank you, @saket, for sharing your insights on this matter!

Full Changelog: 1.8.0-alpha-4...1.8.0-alpha-5