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

Add labels and grid lines for the comparison image #206

Merged

Conversation

takahirom
Copy link
Owner

No description provided.

Copy link

github-actions bot commented Nov 7, 2023

Snapshot diff report

File name Image
MainJvmTest.test_2_c
ompare.png
com.github.takahirom
.roborazzi.sample.Co
mparisonStyleTest.di
ffNoSmallLineSpace_c
ompare.png
custom-com.github.ta
kahirom.roborazzi.sa
mple.RuleTestWithAll
Image.captureRoboGif
Sample.1_compare.png
manual_view_a11y_dum
p_compare.png
com.github.takahirom
.roborazzi.sample.Ma
nualTest.captureScre
enLevelTabletWithEsp
resso_compare.png
com.github.takahirom
.roborazzi.sample.Ma
nualTest.captureScre
enLevelImageWithEspr
esso_compare.png
com.github.takahirom
.roborazzi.sample.Ma
nualTest.captureScre
enLevelJapaneseWithE
spresso_compare.png
manual_all_3_compare
.png
manual_view_first_sc
reen_with_query_comp
ose_compare.png
manual_all_1_compare
.png
com.github.takahirom
.roborazzi.sample.Co
mparisonStyleTest.di
ffNoBigLineSpace_com
pare.png
manual_view_first_sc
reen_with_query_view
_compare.png
custom_file_compare.
png
custom_outputFilePro
vider-com.github.tak
ahirom.roborazzi.sam
ple.RuleTestWithPath
.captureRoboImageWit
hPath_compare.png
custom_outputFilePro
vider-com.github.tak
ahirom.roborazzi.sam
ple.RuleTestWithPath
.captureRoboImage_co
mpare.png
custom_outputFilePro
vider-com.github.tak
ahirom.roborazzi.sam
ple.RuleTestWithPath
.roboOutputNameTest_
compare.png
manual_view_first_sc
reen_with_query_comp
ose_custom_compare.p
ng
com.github.takahirom
.roborazzi.sample.Ma
nualTest.captureComp
oseImage_compare.png
com.github.takahirom
.roborazzi.sample.Co
mparisonStyleTest.di
ffDefault_compare.pn
g
com.github.takahirom
.roborazzi.sample.Co
mparisonStyleTest.di
ffNoLabel_compare.pn
g
com.github.takahirom
.roborazzi.sample.Ma
nualTest.captureScre
enLevelNightWithEspr
esso_compare.png
custom-com.github.ta
kahirom.roborazzi.sa
mple.RuleTestWithAll
Image.captureRoboGif
Sample.3_compare.png

@takahirom takahirom changed the title Add text and grid for compare canvas Add text and grid for comparison canvas Nov 7, 2023
…compose-canvas/2023-11-07' into takahirom/add-text-and-grid-for-compose-canvas/2023-11-07

# Conflicts:
#	sample-android/src/main/java/com/github/takahirom/roborazzi/sample/FirstFragment.kt
@takahirom takahirom force-pushed the takahirom/add-text-and-grid-for-compose-canvas/2023-11-07 branch from 4316380 to 0772ea5 Compare November 26, 2023 03:25
@takahirom takahirom changed the title Add text and grid for comparison canvas Add labels and grid lines for comparison canvas Nov 26, 2023
@takahirom takahirom changed the title Add labels and grid lines for comparison canvas Add labels and grid lines for comparison image Nov 26, 2023
@takahirom takahirom changed the title Add labels and grid lines for comparison image Add labels and grid lines for the comparison image Nov 26, 2023
@takahirom takahirom merged commit b34bfb8 into main Nov 26, 2023
4 checks passed
@takahirom takahirom deleted the takahirom/add-text-and-grid-for-compose-canvas/2023-11-07 branch November 26, 2023 04:57
@timothyfroehlich
Copy link
Contributor

Sweet!

github-merge-queue bot pushed a commit to slackhq/circuit that referenced this pull request Jan 22, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[io.github.takahirom.roborazzi](https://togithub.com/takahirom/roborazzi)
| plugin | minor | `1.7.0` -> `1.8.0` |
|
[io.github.takahirom.roborazzi:roborazzi-junit-rule](https://togithub.com/takahirom/roborazzi)
| dependencies | minor | `1.7.0` -> `1.8.0` |
|
[io.github.takahirom.roborazzi:roborazzi-compose](https://togithub.com/takahirom/roborazzi)
| dependencies | minor | `1.7.0` -> `1.8.0` |
|
[io.github.takahirom.roborazzi:roborazzi](https://togithub.com/takahirom/roborazzi)
| dependencies | minor | `1.7.0` -> `1.8.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>takahirom/roborazzi (io.github.takahirom.roborazzi)</summary>

###
[`v1.8.0`](https://togithub.com/takahirom/roborazzi/releases/tag/1.8.0)

[Compare
Source](https://togithub.com/takahirom/roborazzi/compare/1.7.0...1.8.0)

##### 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
#&#8203;243](https://togithub.com/takahirom/roborazzi/issues/243).

##### Fix from 1.8.0-rc-1

- Use ComposeTestRule interface instead of concrete
AndroidComposeTestRule class.
[@&#8203;GisoBartels](https://togithub.com/GisoBartels), Thank you for
your code contribution!

[takahirom/roborazzi#241

##### New Feature from 1.7

##### 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.

```kotlin
@&#8203;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](https://togithub.com/takahirom/roborazzi#roborazzirecordnamingstrategy)

##### Enhanced Comparison with Grid and Labels 🚀

This update introduces a new grid and label feature, making visual
comparisons more intuitive and effective. The grid layout provides a
structured view, while labels offer clear identification, streamlining
the testing process.

You can use the old style by setting ComparisonStyle to
ComparisonStyle.Simple in RoborazziOptions

```kotlin
  data class CompareOptions(
...
    val comparisonStyle: ComparisonStyle = ComparisonStyle.Grid(),
  ) {
    @&#8203;ExperimentalRoborazziApi
    sealed interface ComparisonStyle {
      @&#8203;ExperimentalRoborazziApi
      data class Grid(
        val bigLineSpaceDp: Int? = 16,
        val smallLineSpaceDp: Int? = 4,
        val hasLabel: Boolean = true
      ) : ComparisonStyle

      object Simple : ComparisonStyle
    }
```


![image](https://togithub.com/takahirom/roborazzi/assets/1386930/a792a49e-b401-4200-800c-938d7525cf80)

##### Make Roborazzi's ImageComparator customizable.

You can now modify the ImageComparator using
CompareOptions.imageComparator.

##### Behavior changes 🔧

Set the default value of CompareOptions.changeThreshold to zero. This
means it will detect even a single pixel change.

##### What's Changed

- Make Roborazzi's ImageComparator customizable by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[takahirom/roborazzi#182
- Set Default Value of CompareOptions.changeThreshold to Zero by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[takahirom/roborazzi#183
- Fixed a bug where options set via RoborazziRule were ignored by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[takahirom/roborazzi#187
- Fix the issue of keeping the previous test reports by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[takahirom/roborazzi#189
- \[CI]Speed up integration tests by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[takahirom/roborazzi#190
- Refactor processOutputImageAndReport by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[takahirom/roborazzi#191
- Fix the bug where the test reports are not updated when the tests fail
by [@&#8203;takahirom](https://togithub.com/takahirom) in
[takahirom/roborazzi#194
- Add a document about experimental output parameter by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[takahirom/roborazzi#195
- Migrate Robolectric to gradle version catalog by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[takahirom/roborazzi#196
- Add default parameter for CompareOptions.resultValidator by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[takahirom/roborazzi#203
- Enhance Flexibility with Custom File Naming in Roborazzi via
roboOutputName() Function by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[takahirom/roborazzi#205
- Fix the issue where errors are ignored and occur when changing the
size during GIF recording. by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[takahirom/roborazzi#210
- Add labels and grid lines for the comparison image by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[takahirom/roborazzi#206
- Fix simple comparison image by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[takahirom/roborazzi#213

**Full Changelog**:
takahirom/roborazzi@1.7.0...1.8.0

</details>

---

### Configuration

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

🚦 **Automerge**: Enabled.

♻ **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.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNDEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjE0MS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
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.

None yet

2 participants