Closed TheReprator closed 2 years ago
Hi @TheReprator! @Vacxe do you have ideas?
@TheReprator
The main issue with hasDrawable
that it using native bitmap comparation functionality. bitmap.sameAs(otherBitmap)
-> .sameAs
it's a massive pitfall because current image displayed in image view can be slightly different with expected.
However did u try
hasDrawable(R.drawable.ic_error)
instead of
val drawable = ResourcesCompat.getDrawable(
appContext.resources,
R.drawable.ic_error,
appContext.theme
)
hasDrawable(drawable!!)
Yes, i had tried "hasDrawable(R.drawable.ic_error)" as well, but didn't worked
@TheReprator Could u create a PR to Kakao with same resource to reproduce the issue. - Then next we can investigate what's going wrong.
@Vacxe Hi! any news? =)
@Vacxe Hi! any news?)
@AzamatCherchesov Hey, you can close this PR for Kaspresso repo because it is not related for. Also it is outdated and I reached the author directly.
Closing this issue due to @Vacxe comment
@AzamatCherchesov Hey, you can close this PR for Kaspresso repo because it is not related for. Also it is outdated and I reached the author directly.
Hi. I'd appreciate it if you could share this information with everyone, because I have the same issue.
Hi Team,
First thanks for this great UI Testing framework. Currently i am trying to check drawable with imageview but i am getting below error, as follows,
androidx.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'with drawable id -1 or provided instance' doesn't match the selected view.
Exception: junit.framework.AssertionFailedError: 'with drawable id -1 or provided instance' doesn't match the selected view. Expected: with drawable id -1 or provided instance Got: "AppCompatImageView{id=2131230883, res-name=factImage, visibility=VISIBLE, width=180, height=220, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=androidx.constraintlayout.widget.ConstraintLayout$LayoutParams@af535b6, tag=null, root-is-layout-requested=false, has-input-connection=false, x=508.0, y=65.0}"
Caused by: junit.framework.AssertionFailedError: 'with drawable id -1 or provided instance' doesn't match the selected view. Expected: with drawable id -1 or provided instance Got: "AppCompatImageView{id=2131230883, res-name=factImage, visibility=VISIBLE, width=180, height=220, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=androidx.constraintlayout.widget.ConstraintLayout$LayoutParams@af535b6, tag=null, root-is-layout-requested=false, has-input-connection=false, x=508.0, y=65.0}"
Repository: https://github.com/TheReprator/Wipro/blob/image_error/appModules/factList/src/androidTest/kotlin/reprator/wipro/factlist/test/FactListKaspressoTest.kt
Test Name: imageViewDrawableComparison
Looking forward for a solution.
Regards, Vikram Sing