facebook / screenshot-tests-for-android

Generate fast deterministic screenshots during Android instrumentation tests
http://facebook.github.io/screenshot-tests-for-android
Apache License 2.0
1.74k stars 229 forks source link

com.google.android.material.card.MaterialCardView stroke color is not validating #247

Open mnayef95 opened 4 years ago

mnayef95 commented 4 years ago

I'm using MaterialCardView

  <com.google.android.material.card.MaterialCardView
        android:id="@+id/card_view_animation_background"
        android:layout_width="300dp"
        android:layout_height="300dp"
        app:cardCornerRadius="175dp"
        app:cardElevation="0dp"
        app:cardMaxElevation="0dp"
        app:layout_constraintBottom_toTopOf="@+id/text_view_sub_message"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/text_view_message_part1"
        app:strokeColor="@color/colorPrimary"
        app:strokeWidth="2dp">

if I have changed app:strokeColor to any color the screenshot testing will pass successfully

xiphirx commented 4 years ago

Did you verify that it actually changes in the screenshot?

mnayef95 commented 4 years ago

Yes @xiphirx

xiphirx commented 4 years ago

Then what is not passing? Are you running the verify task? Just running the tests wont pass/fail on a change, it will just output the screenshots.

mnayef95 commented 4 years ago

@xiphirx tried to change text color and the test was failed but when I changed cardview border the test was succeed, please note that the two test cases was in the same screen shots.

This is what I have did 1- take screenshots 2- save screenshots under app/screenshots 3- change text color 4- run verify task (test failed) 6- revert text color 7- change cardview border color 8- run verify task (test succeed)

xiphirx commented 4 years ago

Can you share the output image from the test from step 8 and the image you're trying to verify against?