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

[#205] Set Rectangle Color (Diff / Exclude) #206

Merged

Conversation

woosyume
Copy link
Contributor

PR Details

Description

As a new feature, I'm suggesting that client can set color for rectangles with the difference.

Related Issue

#205

Motivation and Context

About my case,
When we release something, we run image comparison for before and after deployment.
It's job of internal automation app based on Selenium WebDriver.

But we sometime take time to find diff rectangle when it's exists because there are some other parts with red colored.
Maybe you can see it with the following page.
https://www.rakuten.co.jp/

That's why I want to set other color so that we can find difference as soon as possible.

How Has This Been Tested

Tested in UT level

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
    Screen Shot 2021-03-25 at 17 48 23

Copy link
Owner

@romankh3 romankh3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's good

@romankh3 romankh3 self-assigned this Mar 25, 2021
@romankh3 romankh3 self-requested a review March 25, 2021 16:51
Copy link
Owner

@romankh3 romankh3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please. add a test with pictures for ImageComparison.compareImages() method with modified colors for rectangles.

@@ -464,7 +465,9 @@ public void shouldProperlyWorkGettersAndSetters() {
.setThreshold(400)
.setDifferenceRectangleFilling(true, 35.1)
.setExcludedRectangleFilling(true, 45.1)
.setAllowingPercentOfDifferentPixels(48.15);
.setAllowingPercentOfDifferentPixels(48.15)
.setDifferenceRectangleColor(Color.RED)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good to set a non-default value here. The same for line 469.
Please, update it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your comment.
Could you please let me know that you mean only set a non-default value for test class or for main modification as well?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only for test case to be ensure, that setter works as well as we expected.

Default values for production code should be the same as were before.

@romankh3 romankh3 merged commit f3e68cb into romankh3:development Mar 28, 2021
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