Skip to content

Commit

Permalink
Use hshift=1 when comparing screenshot images
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamGrzybkowski committed Aug 6, 2024
1 parent 69125df commit 053639b
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ package com.gravatar.uitestutils
import androidx.compose.runtime.Composable
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.dropbox.differ.SimpleImageComparator
import com.github.takahirom.roborazzi.ExperimentalRoborazziApi
import com.github.takahirom.roborazzi.RobolectricDeviceQualifiers
import com.github.takahirom.roborazzi.RoborazziOptions
import com.github.takahirom.roborazzi.RoborazziRule
import com.github.takahirom.roborazzi.captureRoboImage
import org.junit.Rule
Expand All @@ -24,10 +27,16 @@ abstract class RoborazziTest {
@get:Rule
val composeRule = createComposeRule()

@OptIn(ExperimentalRoborazziApi::class)
@get:Rule
val roborazziRule = RoborazziRule(
options = RoborazziRule.Options(
outputDirectoryPath = SCREENSHOTS_PATH,
roborazziOptions = RoborazziOptions(
compareOptions = RoborazziOptions.CompareOptions(
imageComparator = SimpleImageComparator(maxDistance = 0.007F, hShift = 1)
)
)
),
)

Expand Down

0 comments on commit 053639b

Please sign in to comment.