Releases: takahirom/roborazzi
idea-1.7.0
Thanks to @sanao1006's contribution, we now have multi-line name support for file names in the Roborazzi IntelliJ Plugin.
robo_video.mov
https://plugins.jetbrains.com/plugin/24561-roborazzi
What's Changed
- Show screenshot filename multiple lines by @sanao1006 in #470
Full Changelog: 1.26.0...idea-1.7.0
1.26.0
Bugfix for iOS Compose Roborazzi
The iOS Compose Roborazzi has broken. The reason is that GitHub's macos-latest has switched to an ARM-based CPU, and our tests have been running X64Test. We couldn't check the status of iOS Roborazzi. We have fixed this bug that prevented us from writing the test result JSON. Special thanks to @eyedol for the prompt fix!
What's Changed
- [IntelliJ IDEA Plugin] Don't crop dropdown task run button by @eyedol in #455
- [Sample / Tests]Update dependency androidx.compose.runtime:runtime to v1.6.8 by @renovate in #343
- Set a classDiscriminator to avoid polymorphic serializer error by @eyedol in #464
Full Changelog: 1.25.0...1.26.0
1.25.0
New Experimental Gradle Task: clear
The Roborazzi Gradle Plugin saves image caches in build/intermediates/roborazzi
. When users remove images in build/outputs/roborazzi
and rerun the tests, it doesn't work as expected. To address this, we've added a Gradle task clearRoborazziDebug
to remove all images.
I'm gathering feedback about this task in #452. Please let me know if this causes any issues in your workflow. I'm aware that there are many different ways to use Roborazzi, and I'd like to improve your project workflow.
What's Changed
- [IDE Plugin] Hide dropdown border if no gradle tasks exists by @eyedol in #451 Thank you for your contribution!
- [Feature] Add clear roborazzi task by @takahirom in #453
Full Changelog: 1.24.0...1.25.0
1.24.0
New feature: Support for includePrivatePreviews in Compose Preview Support
Compose Preview Support, initially released in version 1.22.0, now includes the includePrivatePreviews
option. This feature allows you to include private previews in your Compose Preview Support setup. You can enable this by setting includePrivatePreviews
in roborazzi.generateComposePreviewRobolectricTests.includePrivatePreviews
. Thank you for submitting this feature request, @yuchan2215 !
New feature: JUnit rule support in ComposePreviewTester
We've enhanced ComposePreviewTester to support JUnit rules. Previously, ComposePreviewTester lacked lifecycle hooks, which made certain scenarios challenging to handle. Now, you can pass your own Test rules, including your Compose Test Rule, and use them in tests. For a sample implementation, check out this integration test.
Breaking changes for users of the ComposePreviewTester
interface
As we continue to improve Compose Preview Support, we've made some changes to the ComposePreviewTester
interface. These changes introduce a breaking change for current users.
ComposePreviewTester is an interface for modifying the behavior of Compose Preview Support. Previously, the API was prone to breaking changes with each new option added. We've addressed this issue by introducing a new options()
function. However, this necessitates a change in how you use the interface.
Old interface:
fun previews(vararg packages: String): List<ComposablePreview<T>>
New interface (Packages can now be accessed via options().scanOptions.packages
):
fun previews(): List<ComposablePreview<T>>
Acknowledgments
We'd like to extend our sincere thanks to @yschimke and @sergio-sastre for their valuable design reviews and insightful feedback, which greatly contributed to the improvements in this release.
What's Changed
- [Idea Plugin] Improve performance of idea plugin by @takahirom in #439
- [Idea Plugin] Prepare for release of IntelliJ IDEA plugin by @takahirom in #442
- [Idea Plugin] Tweak idea plugin UI by @takahirom in #443
- [Feature, Breaking Changes] Support includePrivatePreviews of ComposablePreviewScanner by @takahirom in #445
- [Docs] Add mention to the sample in Compose Preview Support document by @takahirom in #448
- [Docs] Fix URL of the README link by @takahirom in #449
Full Changelog: 1.23.0...1.24.0
Roborazzi IntelliJ idea plugin 1.4.0
Thanks to @eyedol's contribution, we now have a feature that allows us to run Roborazzi Gradle tasks from the Roborazzi IntelliJ Plugin. This is more intuitive for beginners and enables us to set up the Roborazzi Plugin as a required plugin.
run.Roborazzi.Gradle.tasks.from.the.Roborazzi.IntelliJ.Plugin2.mov
https://plugins.jetbrains.com/plugin/24561-roborazzi
What's Changed
- Generate Roborazzi images via its IntelliJ Plugin by @eyedol in #429
- Adjust some idea plugin behaviors by @takahirom in #431
- Improve performance of idea plugin by @takahirom in #439
- Prepare for release of IntelliJ IDEA plugin by @takahirom in #442
Full Changelog: idea-1.3.0...idea-1.4.0
1.23.0
Breaking Changes to roborazzi.generateComposePreviewRobolectricTests.customTestQualifiedClassName
Gradle Extension
We released roborazzi.generateComposePreviewRobolectricTests.customTestQualifiedClassName
in the previous release 1.22.0
, allowing customization of preview test behavior. We have since discovered that the interface of RobolectricPreviewTest cannot adapt to Compose Multiplatform Preview because RobolectricPreviewTest uses AndroidPreviewInfo
from ComposablePreviewScanner, which represents Android Compose Preview. To address this, we have added a generic parameter to handle the annotation and renamed RobolectricPreviewTest to ComposePreviewTester.
The Gradle extension property has been renamed:
roborazzi.generateComposePreviewRobolectricTests.customTestQualifiedClassName
-> roborazzi.generateComposePreviewRobolectricTests.testerQualifiedClassName
Old interface:
interface RobolectricPreviewTest {
fun previews(vararg packages: String): List<ComposablePreview<AndroidPreviewInfo>>
fun test(
preview: ComposablePreview<AndroidPreviewInfo>,
)
}
New interface:
interface ComposePreviewTester<T : Any> {
fun previews(vararg packages: String): List<ComposablePreview<T>>
fun test(
preview: ComposablePreview<T>,
)
}
What's Changed
- Rename ComposePreviewRobolectricTest to ComposePreviewTester to support custom Preview annotation tests in Experimental Compose Preview Support by @takahirom in #438
- [Idea Plugin]Adjust some idea plugin behaviors by @takahirom in #431 We haven't released this feature yet. Stay tuned!
Full Changelog: 1.22.2...1.23.0
1.22.2
Notice
RobolectricPreviewTest and roborazzi.generateComposePreviewRobolectricTests.customTestQualifiedClassName are used for customizing Experimental Compose Preview Support. However, the name and class signature of RobolectricPreviewTest will be changed in a future release(not in 1.22.2) to support the Compose Multiplatform Preview Annotation.
Bug fixes
We didn't have integration tests for Experimental Compose Preview Support, so we added them. In KMP projects, we used to check only testImplementation
(androidUnitTest.dependencies.implementation is used for KMP Android Unit tests), and the verification for generateComposePreviewRobolectricTests{} was failing. Therefore, we have added integration tests and fixed the behavior for KMP projects.
What's Changed
- Refactor Roborazzi integration tests to support multiple modules by @takahirom in #434
- Fix warning of RoborazziPreviewParameterizedTests by @takahirom in #436
- Fix GenerateRobolectricComposePreviewTests to support KMP by @takahirom in #435
Full Changelog: 1.22.1...1.22.2
1.22.1
Bug fixes
We've released Experimental Compose Preview Support in 1.22.0. In this release, we are going to include a bug fix for it.
The strategy of generateComposePreviewRobolectricTests{}
is not to modify settings automatically, but to verify that the user settings are correct. This allows our settings to be the single source of truth. However, the assertion had some bugs, so I fixed them.
What's Changed
- [Roborazzi Idea Plugin] Generate Roborazzi images via its IntelliJ Plugin by @eyedol in #429 (We will address this topic in a future release)
- [Bug fixes] Fix assertions in Automated Test Generation for Experimental Compose Preview Support by @takahirom in #432
Full Changelog: 1.22.0...1.22.1
1.22.0
Experimental Compose Preview Support 🚀
We're excited to announce the experimental release of Compose Preview Support for Roborazzi, a powerful new feature that streamlines the process of generating screenshot tests for Jetpack Compose Previews.
Key Features
- Automated Test Generation: Automatically generate screenshot tests for Composable Previews using the ComposablePreviewScanner library
- Manual Integration Support: For those who prefer more control, we've added helper functions to manually integrate Compose Preview screenshot tests.
How to Use
To enable Compose Preview screenshot test generation, add the following to your build.gradle.kts
:
roborazzi {
generateComposePreviewRobolectricTests {
enable = true
}
}
After configuration, run the recordRoborazziDebug
task to generate screenshots using the newly created tests.
Customization Options
Customize your setup with options like:
- Specifying package names to scan
- Defining a custom test class
- Configuring Robolectric settings
Manual Integration
For manual integration, add the following dependency:
testImplementation("io.github.takahirom.roborazzi:roborazzi-compose-preview-scanner-support:[version]")
Then use the ComposablePreview<AndroidPreviewInfo>.captureRoboImage()
function in your tests. Note that ComposablePreview
is a class provided by the ComposablePreviewScanner library, which Roborazzi utilizes for this feature.
This approach allows for more fine-grained control over the screenshot capture process for Compose Previews.
Acknowledgements
Special thanks to @yschimke for the initial proposal, and to @sergio-sastre and @yschimke for their valuable design and code reviews.
For more detailed information on setup and usage, please visit our documentation.
Enhanced Accessibility Text Capture
Thanks to @lukas-mercari 's contribution, we've improved accessibility text dumping for merged Compose elements. Both content descriptions and text are now captured, providing more comprehensive accessibility information in tests.
What's Changed
- [roborazzi-idea-plugin] Fix: Icons are not shown in the new UI by @takahirom in #421
- [CI]Wait for main to succeed for compare ci by @takahirom in #422
- [CI] Remove main push trigger from compare ci by @takahirom in #423
- [CI] Add unit test for WebAssets class by @eyedol in #412
- [Sample]Update dependency androidx.compose.foundation:foundation to v1.6.8 by @renovate in #340
- [Bug fixes] Dump both content description as well as text for the case when two elements are merged by @lukas-mercari in #430
- [Improvement] Add roborazzi-compose-preview-scanner-support module to handle preview settings by @takahirom in #427
- [Feature] Implement generateRobolectricPreviewTests prototype by @takahirom in #416
Full Changelog: 1.21.0...1.22.0
1.21.0
Android Studio, IntelliJ IDEA Plugin is coming
The Roborazzi Plugin has been released after the previous release. Please check it out. The Roborazzi plugin enhances your development workflow by automatically displaying screenshots related to Roborazzi's screenshot tests within IntelliJ IDEA. Easily view and verify visual outputs directly in your IDE, streamlining your testing and development process.
screencast.2024-06-07.10-08-00.mp4
https://plugins.jetbrains.com/plugin/24561-roborazzi
Now, test report assets are written in the same directory as the report HTML.
We are using Materialize for the HTML report generated in build/reports/roborazzi. This causes a Content Security Policy (CSP) problem when using iframes. As a result, we can't view the report correctly in some projects. To resolve this, we now save the assets like CSS and JS in the same directory as the report HTML. Thank you, @eyedol, for tackling this difficult problem. Thank you, @realdadfish, for reporting this!
Bug fix
In the Windows environment, the image path in the report file is not written correctly. I fixed the path separator to resolve this issue. Thank you for reporting this, @ben-gooding-hub.
What's Changed
- [CI] Update actions/checkout digest to a5ac7e5 by @renovate in #384
- [CI] Update nick-fields/retry action to v2.9.0 by @renovate in #357
- [CI] Update dependency io.ktor:ktor-serialization-kotlinx-xml to v2.3.11 by @renovate in #360
- [Sample] Update dependency androidx.appcompat:appcompat to v1.7.0 by @renovate in #394
- [Idea Plugin] Add Roborazzi Preview prototype to Idea Plugin by @takahirom in #395
- [Idea Plugin] Add empty Roborazzi idea plugin by @takahirom in #367
- [Docs] Add faq section about out of memory error by @sanao1006 in #402
- [Idea Plugin] Fix the issue where the image is not selected as intended by @takahirom in #403
- [Idea Plugin] Add README section of idea plugin by @takahirom in #405
- [Internal (compileOnly)] Update dependency androidx.compose.ui:ui-test to v1.6.8 by @renovate in #397
- [CI] Update actions/checkout digest to 692973e by @renovate in #406
- [Docs] Add robolectric.pixelCopyRenderMode to README by @takahirom in #409
- [Docs] Remove unneeded " in README by @takahirom in #410
- [Feature] Read external resources locally when generating html report by @eyedol in #404
- [CI] Update dependency gradle to v8.8 by @renovate in #354
- [Bug fix] Fix windows report relative path by @takahirom in #419
Full Changelog: 1.20.0...1.21.0