paparazzi icon indicating copy to clipboard operation
paparazzi copied to clipboard

Add Gif verification support

Open gamepro65 opened this issue 2 years ago • 3 comments

Adds support by encoding a temp mov during verification and then comparing the golden mov to the temp mov by decoding/comparing each frame. This yielded better accuracy than comparing an unencoded frame to the golden decoded frame. Unfortunately it isn't perfect, encoding noise is slightly different across different arch's. The plugin test verifies with maxPercentDiff of 0.01 which was too strict for windows, had to bump the diff to 0.05 to get it to pass. This is still under the 0.1 that Paparazzi uses by default.

Example failure:

    java.lang.AssertionError: 15 video frames differed by more than 0.1%
    Mismatched video duration expected: 1.0333333333333334 actual: 0.5333333333333333
    Mismatched frame count expected: 31 actual: 16
    find delta video at /Users/cdrury/Development/paparazzi/sample/out/failures
        at org.junit.Assert.fail(Assert.java:89)
        at app.cash.paparazzi.internal.VideoUtils.assertVideoSimilar(VideoUtils.kt:116)
        at app.cash.paparazzi.SnapshotVerifier$newFrameHandler$1.close(SnapshotVerifier.kt:77)
        at kotlin.io.CloseableKt.closeFinally(Closeable.kt:57)
        at app.cash.paparazzi.Paparazzi.takeSnapshots(Paparazzi.kt:280)
        at app.cash.paparazzi.Paparazzi.gif(Paparazzi.kt:228)
        at app.cash.paparazzi.sample.KeypadViewTest.testViews(KeypadViewTest.kt:69)

Rotation direction changed https://user-images.githubusercontent.com/672316/176577507-1097cbd8-41e0-4853-9870-d00639cc98f1.mov

Length of video changed https://user-images.githubusercontent.com/672316/176581246-7d7ea6c6-2993-4241-a029-d1b0865788cb.mov

gamepro65 avatar Jun 30 '22 13:06 gamepro65

I’m unable to login Cashapp on my device please help me out

8373838 avatar Jul 26 '22 01:07 8373838

Have you run spotless on this branch yet?

luis-cortes avatar Jul 28 '22 16:07 luis-cortes

Have you run spotless on this branch yet?

Hmm I think @gamepro65 needs to rebase, branch was created prior to the Spotless integration.

fcduarte avatar Jul 28 '22 17:07 fcduarte