8000 Update roborazzi to v1.26.0 by Daio-io · Pull Request #18 · Daio-io/wild · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update roborazzi to v1.26.0 #18

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

Merged
merged 2 commits into from
Aug 23, 2024
Merged

Update roborazzi to v1.26.0 #18

merged 2 commits into from
Aug 23, 2024

Conversation

Daio-io
Copy link
Owner
@Daio-io Daio-io commented Aug 20, 2024

This PR contains the following updates:

Package Type Update Change
io.github.takahirom.roborazzi plugin minor 1.8.0-alpha-6 -> 1.26.0
io.github.takahirom.roborazzi:roborazzi-gradle-plugin dependencies minor 1.8.0-alpha-6 -> 1.26.0

Release Notes

takahirom/roborazzi (io.github.takahirom.roborazzi)

v1.26.0

Compare Source

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

Full Changelog: takahirom/roborazzi@1.25.0...1.26.0

v1.25.0

Compare Source

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

Full Changelog: takahirom/roborazzi@1.24.0...1.25.0

v1.24.0

Compare Source

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

Full Changelog: takahirom/roborazzi@1.23.0...1.24.0

v1.23.0

Compare Source

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 rena 10000 med:

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

Full Changelog: takahirom/roborazzi@1.22.2...1.23.0

v1.22.2

Compare Source

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

Full Changelog: takahirom/roborazzi@1.22.1...1.22.2

v1.22.1

Compare Source

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

Full Changelog: takahirom/roborazzi@1.22.0...1.22.1

v1.22.0

Compare Source

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.

image

What's Changed

Full Changelog: takahirom/roborazzi@1.21.0...1.22.0

v1.21.0

Compare Source

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

Full Changelog: takahirom/roborazzi@1.20.0...1.21.0

v1.20.0

Compare Source

Workflow Enhancement

We use images as inputs for tests, ensuring that the compare and verify tasks function correctly. However, while running record tasks, we do not need the input images. Despite this, these input images invalidate the record task and disable the cache. Therefore, we no longer use input images for record tasks. Thank you, @​lukas-mercari, for informing us and proposing this improvement.

What's Changed

Full Changelog: takahirom/roborazzi@1.19.0...1.20.0

v1.19.0

Compare Source

Bug Fix

I was informed that if you have multiple test suites, the RoborazziPlugin sometimes fails due to concurrent processes. This happens because the cleanup process runs multiple times. Therefore, I made the cleanup process run only once. Thank you for reporting this, @​lukas-mercari.

What's Changed

Full Changelog: takahirom/roborazzi@1.18.0...1.19.0

v1.18.0

Compare Source

Migrating from java.io.File to kotlinx-io

Note: We are not changing the API for users, so the captureRoboImage methods are still using the java.io.File class.
Roborazzi previously used java.io.File for saving and loading files. Although Roborazzi supports iOS, sharing much of the logic is challenging when using java.io.File. Therefore, we have migrated to kotlinx-io.
We are attentive to the Kotlin versions our users employ. We upgraded from version 1.9.21 to 1.9.22 due to a dependency on kotlinx-io. Since Kotlin 1.9.22 was released last year, it should be compatible with most projects.
Thank you, @​eyedol, for your outstanding contribution! Your efforts are greatly appreciated.

|    \--- org.jetbrains.kotlinx:kotlinx-io-core:0.3.3
|         +--- org.jetbrains.kotlinx:kotlinx-io-bytestring:0.3.3
|         |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.22 (*)
|         \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.22 (*)
What's Changed
New Contributors

Full Changelog: takahirom/roborazzi@1.17.0...1.18.0

v1.17.0

Compare Source

Bug Fixes
  • There seemed to be a pattern where ActivityScenario's close was not being called when tests failed, causing leaks, so I used a use block to ensure it is closed properly. @​yschimke, thank you for pointing out this issue.
  • At companies that use Roborazzi on a large scale, there were issues with the output dir not being restored properly due to Configuration cache and other factors, so I simplified the design to make problems less likely to occur.
  • There were occasional errors reporting that a directory did not exist, and I've added code to address this issue. @​lukas-mercari, thank you for your contribution.
What's Changed
New Contributors

Full Changelog: takahirom/roborazzi@1.16.1...1.17.0

v1.16.1

Compare Source

Bugfix

We removed the setting for the test task's input directory in 1.16.0, but it caused incorrect results in the compare tests. Therefore, I reverted the changes to the test input directory. This bug is now covered by Roborazzi's integration tests.

What's Changed

Full Changelog: takahirom/roborazzi@1.16.0...1.16.1

v1.16.0

Compare Source

Improvements
  • @​lukas-mercari informed me that we can optimize our build-cache strategy by eliminating outdated cache invalidation logic. With this adjustment, Roborazzi's integration test time was reduced from 10 minutes to 6 minutes by utilizing caches. Thanks for the excellent improvement suggestion. This might also help other users' projects. Roborazzi's integration tests cover several use cases, but if you encounter any issues related to caching, please let me know.
  • We have been supporting iOS since the previous version of Roborazzi and want to share code with the iOS sourceset as much as possible. Therefore, we migrated from Gson to Kotlinx.serialization 1.6.3. Thank you for your contribution, @​sanao1006
  • Roborazzi has been supporting accessibility dumps for Android, and we have now added the capability to check the disabled status within these dumps. Thank you for your contribution, @​lukas-mercari !
image
What's Changed

Full Changelog: takahirom/roborazzi@1.15.0...1.16.0

v1.15.0

Compare Source

Improvements
  • Resolved a Race Condition in Roborazzi Gradle Integration Tests: In version 1.14.0, we identified an intermittent issue where images from Roborazzi did not always appear in the output directory during certain test scenarios, particularly when test results were cached. Despite efforts to resolve this in 1.14.0, the issue persisted due to its elusive nature. In this release, we have successfully addressed this problem, ensuring that images are now consistently placed in the output directory under similar conditions. This improvement has been verified through our integration tests. This issue may occur in user projects, so we recommend updating to this version.
    We continue to refine our testing processes to prevent similar issues in future releases.
What's Changed

Full Changelog: takahirom/roborazzi@1.14.0...1.15.0

v1.14.0

Compare Source

Bug fixes

Cache-related Flakiness in Comparison Results: We've identified and resolved an intermittent issue where cached data could sometimes prevent users from seeing comparison results in Roborazzi.
https://github.com/takahirom/roborazzi/pull/323

What's Changed
New Contributors

Full Changelog: takahirom/roborazzi@1.13.0...1.14.0

v1.13.0

Compare Source

Add experimental, minimal support for iOS in Compose Multiplatform

Roborazzi has supported Compose Desktop, but we hadn't yet supported iOS, which could be a major use case for Compose Multiplatform. Therefore, I have added support for iOS.
Now, you can record, compare, and verify just as you would with Android support.
https://takahirom.github.io/roborazzi/compose-multiplatform.html#experimental-feature-ios-support

ios_button_compare

However, Roborazzi is fundamentally based on the JVM. Currently, we offer only minimal features. If you are interested in helping to improve these features, please take a look at these issues:
https://github.com/takahirom/roborazzi/issues/302 https://github.com/takahirom/roborazzi/issues/305

Changes Affecting Existing Support

To support iOS, we have made some dependency changes for Android and Compose Desktop. I believe these changes will not affect existing behavior. However, if you notice anything, please let me know.

All
Kotlin:
1.8.22 -> 1.9.21

dropbox/differ:
0.0.1 -> 0.0.2

Desktop Compose Version

Compose Multiplatform:
1.4.3 -> 1.6.1

What's Changed

Full Changelog: takahirom/roborazzi@1.12.0...1.13.0

v1.12.0

Compare Source

Bug Fixes
  • Fixed an issue where recorded images with a transparent background and a scaling option (e.g., 0.5F) were always detected as changes. Thanks for reporting this, @​yongsuk44!
  • Addressed a bug related to robolectric.screenshot.hwrdr.native introduced in Robolectric 4.12, which caused unwanted shadows when using Compose's roboCaptureImage{} with this new option. This has now been corrected by @​lukas-mercari. Thanks for your contribution!
What's Changed
New Contributors

Full Changelog: takahirom/roborazzi@1.11.0...1.12.0

v1.11.0

Compare Source

New feature

In Roborazzi, if you specify outputDir in the Gradle settings, you can use the build cache. Now, Roborazzi passes the setting into the test.

build.gradle

roborazzi {
    outputDir = "src/your/screenshot/folder"
}

gradle.propeties

roborazzi.record.filePathStrategy=relativePathFromRoborazziContextOutputDirectory 

Test

captureRoboImage()
-> saved src/your/screenshot/folder/package.class.method.png

captureRoboImage("test.png")

-> saved src/your/screenshot/folder/test.png
What's Changed

Full Changelog: takahirom/roborazzi@1.10.1...1.11.0

v1.10.1

Compare Source

Changes from 1.10.0

This release includes a bug fix for a Javascript error that prevented the HTML report from being displayed.

Changes from 1.9.0
New experimental feature
Custom context data for images and reports

Custom context data enables the addition of information to images and reports in Roborazzi's tests, which I believe is very important. For example, it can include the test class name of a screenshot or whether it is in dark mode.
You can now add custom context data using RoborazziOptions, and Roborazzi will add the test class name metadata if you use RoborazziRule. If you have any opinions about this feature, please let me know at https://github.com/takahirom/roborazzi/issues/257.
Furthermore, this opens up possibilities with AI. Given that AI now possesses multimodal capabilities, it has become feasible for AI to process images.
This feature was made possible thanks to @​sanao1006 's contribution of migrating from org.json to gson.

    onView(ViewMatchers.isRoot())
      .captureRoboImage(
        roborazziOptions = RoborazziOptions(
          contextData = mapOf(
            "context_data_key" to "context_data_value"
          )
        )
      )
  }
image
Important bug fix

Gradle attempts to load the test cache whenever possible, but there was an issue where Roborazzi couldn't restore images from the cache. This release includes a fix for this problem. Thank you, @​francescocervone, for reporting this issue.

What's Changed
New Contributors

Full Changelog: takahirom/roborazzi@1.9.0...1.10.0

v1.10.0

Compare Source

New experimental feature
Custom context data for images and reports

Custom context data enables the addition of information to images and reports in Roborazzi's tests, which I believe is very important. For example, it can include the test class name of a screenshot or whether it is in dark mode.
You can now add custom context data using RoborazziOptions, and Roborazzi will add the test class name metadata if you use RoborazziRule. If you have any opinions about this feature, please let me know at https://github.com/takahirom/roborazzi/issues/257.
Furthermore, this opens up possibilities with AI. Given that AI now possesses multimodal capabilities, it has become feasible for AI to process images.
This feature was made possible thanks to @​sanao1006 's contribution of migrating from org.json to gson.

    onView(ViewMatchers.isRoot())
      .captureRoboImage(
        roborazziOptions = RoborazziOptions(
          contextData = mapOf(
            "context_data_key" to "context_data_value"
          )
        )
      )
  }
image
Important bug fix

Gradle attempts to load the test cache whenever possible, but there was an issue where Roborazzi couldn't restore images from the cache. This release includes a fix for this problem. Thank you, @​francescocervone, for reporting this issue.

What's Changed
New Contributors

Full Changelog: takahirom/roborazzi@1.9.0...1.10.0

v1.9.0

Compare Source

Announcement: Simplified Release Strategy for Roborazzi

We're making some changes to our release strategy to enhance your experience. Moving forward, we will be streamlining our versioning system. Instead of maintaining separate alpha/rc/stable versions, we will integrate experimental features directly into stable releases, marked with clear experimental annotations. This approach aims to simplify updates and improve clarity while ensuring you still have access to the latest features and improvements.

We value your input and experience. If you have any thoughts or feedback on this change, please feel free to share them with us on GitHub Issue #​243.

New Experimental Features
  • Introduction of captureScreenRoboImage() Function:
    This function executes screenshot tests that include dialogs on the screen, offering an alternative to the conventional use of Espresso's ViewInteraction or Compose Test's SemanticsNodeInteraction captureRoboImage(). Thank you, @​nelletto, for bringing this issue with dialog screenshots to our attention.

    Before:

    onRoot().captureRoboImage()
    onView(isRoot()).captureRoboImage()

    After:

    captureScreenRoboImage()
image
  • RoborazziTaskType Property:
    I developed Roborazzi to facilitate layout viewing during UI tests, addressing the limitations in Robolectric's layout visibility. Initially, Roborazzi couldn't support just viewing layouts during the verification task (roborazziVerifyDebug). Hence, I've introduced a feature allowing task type alteration during test executions.

    onView(ViewMatchers.isRoot())
      .captureRoboImage(
        roborazziOptions = RoborazziOptions(
          taskType = roborazziSystemPropertyTaskType().convertVerifyingToComparing()
        )
      )
Behavior Changes
  • Adjustments for Upcoming Robolectric Shadow Rendering Support:
    While Robolectric is in the process of introducing technical support for shadow rendering, Roborazzi is adapting its screenshot capture method accordingly. We're shifting towards using the PixelCopy class more extensively instead of relying solely on the View draw method. If you notice any issues with this change, please report them to us. Thank you, @​sergio-sastre, for highlighting the advantages of using PixelCopy.
Bug Fixes
  • Fixed Potential Memory Leak:
    Addressed a memory leak issue occurring when using compose captureRoboImage{} multiple times within a single test. (Thanks for reporting this @​vetoketju )
  • Resolved File Path Duplication:
    Corrected an issue where not specifying a file path with relativePathFromRoborazziContextOutputDirectory resulted in duplicated file paths, like build/output/roborazzi/build/output/roborazzi/xxxx.png.
  • Fixed a bug in window ordering for screenshots: Windows are now accurately layered by type for more reliable and consistent screenshot results.
  • Fixed the issue where captureScreenRoboImage() failed to capture Material3 Compose dialogs and bottom sheets.
    @​marianeum Thank you for reporting this issue!
  • Resolved the issue causing comparison images to enlarge when using the scale option.
Others
What's Changed

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@Daio-io Daio-io enabled auto-merge (squash) August 23, 2024 08:27
@Daio-io Daio-io merged commit 2740de3 into main Aug 23, 2024
2 checks passed
@Daio-io Daio-io deleted the renovate/roborazzi branch August 23, 2024 08:35
Daio-io added a commit that referenced this pull request Apr 11, 2025
Co-authored-by: Renovate Bot <renovate@whitesourcesoftware.com>
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

Successfully merging this pull request may close these issues.

2 participants
0