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

Update roborazzi to v1.39.0 #1526

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update roborazzi to v1.39.0 #1526

wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 15, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
io.github.takahirom.roborazzi:roborazzi-junit-rule 1.36.0 -> 1.39.0 age adoption passing confidence
io.github.takahirom.roborazzi:roborazzi-compose 1.36.0 -> 1.39.0 age adoption passing confidence
io.github.takahirom.roborazzi:roborazzi 1.36.0 -> 1.39.0 age adoption passing confidence
io.github.takahirom.roborazzi:roborazzi-gradle-plugin 1.36.0 -> 1.39.0 age adoption passing confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

takahirom/roborazzi (io.github.takahirom.roborazzi:roborazzi-junit-rule)

v1.39.0

Compare Source

Bug Fixes
Diff screenshots are now as large as the largest of the two compared screenshots

Previously, when the size of a screenshot changed (e.g., became smaller), the image diff would not appear because it was based on the minimum size of each screenshot. This has been fixed so that the diff is now based on the largest of the two compared screenshots. Thank you for reporting this issue, @​outadoc!

Report HTML's image order is now deterministic

The image order in the HTML report used to be random. Thanks to @​mannodermaus, it is now sorted by name.

OpenAiAiAssertionModel is now Gemini compatible

Gemini has a compatibility mode with the OpenAI API (https://ai.google.dev/gemini-api/docs/openai). By using https://generativelanguage.googleapis.com/v1beta/openai/ as the base URL, we can essentially use Gemini. However, some properties are different, so we had to modify the OpenAiAiAssertionModel to be compatible with Gemini.

I'm currently developing another library called Arbigent, an AI agent testing framework. I'm planning to add an AI image assertion feature using Roborazzi's AI-Powered Image Assertion, and I needed this compatibility for that. This isn't directly related to this project, but if you're interested in testing, check it out: https://github.com/takahirom/arbigent

What's Changed

Full Changelog: takahirom/roborazzi@1.38.0...1.39.0

v1.38.0

Compare Source

Bugfix
Fix: Bug preventing the revival of deleted screenshot images

Thanks to @​pedromfmachado's contribution, we've addressed a bug where deleted screenshot test images would be erroneously revived. Previously, when screenshot tests were removed and their corresponding images deleted from the output directory, running the record task again would cause the Roborazzi Gradle task to recreate the removed images. While this could be temporarily resolved with roborazzi.cleanupOldScreenshots=true, that approach was undesirable as it would also remove images when test filters were used. This was a complex issue to solve, and we extend our gratitude to @​pedromfmachado for the fix.

Fix: Made screenshot dump deterministic

We have a dump feature that allows us to check the properties or hierarchy of views or composables in an image. We sorted the properties to ensure a deterministic output. Thanks to @​siarhei-luskanau for this contribution.

New Feature
Feature: Added RoborazziComposeActivityThemeOption

Previously, changing the theme of RoborazziTransparentActivity was not possible. We have now deprecated RoborazziTransparentActivity and renamed it to RoborazziActivity. Additionally, we added RoborazziComposeActivityThemeOption to enable changing the Activity's theme. Thank you again, @​pedromfmachado, for this feature.

You can now change the Activity theme like this:

 @​OptIn(ExperimentalRoborazziApi::class)
 @​Test
 fun whenNonTransparentThemeItShouldHaveNonTransparentBackground() {
   captureRoboImage(
     roborazziComposeOptions = RoborazziComposeOptions {
       activityTheme(android.R.style.Theme_Material_Light)
     }
   ) {
     Text("This composable function should NOT have transparent background!")
   }
 }
What's Changed
New Contributors

Full Changelog: takahirom/roborazzi@1.37.0...1.38.0

v1.37.0

Compare Source

Bug Fixes and Workarounds
Compose AlertDialog Support

Support for capturing Alert Dialogs has been fixed, ensuring correct screenshot display. captureScreenRoboImage(), which merges all windows, is now used only when multiple windows are present. Thanks to @​ashughes for reporting this and to @​mhidaka and @​hiroaki404 for bringing it to my attention at a Japan Android testing event.

image
Workaround for Overlap Handling for SDK 35 Compose Screenshots
Problem

When updating to SDK 35 and using the default theme, the ActionBar is included in screenshots, leading to overlap when using createComposeRule(). This occurs because createComposeRule() uses the default theme by default. Thank you for letting me know about this, @​keyboardsurfer!

I have filed an issue for this: https://issuetracker.google.com/issues/383368165

Why this happens

SDK 35 enforces edge-to-edge display, which means it does not provide automatic padding for the ActionBar.

How Roborazzi currently workarounds this

Roborazzi now automatically hides the ActionBar when taking screenshots on SDK 35 and higher. This functions similarly to view.getActivity()?.actionBar?.hide(). However, this workaround may cause performance issues and should not be relied upon. Roborazzi outputs warning logs with alternative suggestions. Thank you to @​sergio-sastre for advising on this workaround!

If you need to include the ActionBar in screenshots, Roborazzi provides a flag, roborazzi.compose.actionbar.overlap.fix=false, that can be added to your gradle.properties file.

What should we do?

A permanent solution will likely require changes from Google. In the meantime, adding <application android:theme="@&#8203;style/android:Theme.Material.Light.NoActionBar" /> to the module's src/test/AndroidManifest.xml file changes the Activity's default theme and resolves the issue. Thank you to @​mattinger for finding this!

https://github.com/takahirom/roborazzi/issues/598#issuecomment-2533372700

Stabilized Output for Dump Screenshots

Thanks to @​siarhei-luskanau for contributing an improvement that reduces unnecessary diffs for the Roborazzi dump feature.

New Features
Add inspectionMode() for Compose Previews

Thanks to @​YusukeMoriJapan's contribution, inspectionMode() is now available in RoborazziComposeOptions. This is particularly useful when working with libraries that have specific preview implementations. This mode is off by default to maintain high fidelity.

Here's how to enable it:

captureRoboImage(
    roborazziComposeOptions = RoborazziComposeOptions {
        inspectionMode(true)
    }
) {
    ...
}

What's Changed
New Contributors

Full Changelog: takahirom/roborazzi@1.36.0...1.37.0


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 was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/roborazzi branch from 8e74e7e to 2bddcb8 Compare December 23, 2024 13:12
@renovate renovate bot changed the title Update roborazzi to v1.37.0 Update roborazzi to v1.38.0 Dec 23, 2024
@renovate renovate bot force-pushed the renovate/roborazzi branch from 2bddcb8 to a979081 Compare January 6, 2025 07:47
@renovate renovate bot changed the title Update roborazzi to v1.38.0 Update roborazzi Jan 6, 2025
@renovate renovate bot force-pushed the renovate/roborazzi branch from a979081 to f0efc0e Compare January 6, 2025 11:55
@renovate renovate bot changed the title Update roborazzi Update roborazzi to v1.39.0 Jan 6, 2025
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.

0 participants