agoda-com / Kakao

This repo is no longer supported. Please visit a https://github.com/KakaoCup/Kakao
Apache License 2.0
1.11k stars 102 forks source link

Lot of UI Test fail after upgrading to 2.3.3 #228

Closed lucas34 closed 4 years ago

lucas34 commented 4 years ago

Steps to reproduce:

I recently tried to update from 2.3.0 to 2.3.3

I have lot of UI Test failing. All are linked to image assertion. The changelog doesn't mention any change related to image validation. Any insight on how to fix my tests ?

androidx.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'with drawable id 2131234209 or provided instance' doesn't match the selected view.
Expected: with drawable id 2131234209 or provided instance
Got: "AppCompatImageView{id=2131363380, res-name=cue_icon, visibility=VISIBLE, width=16, height=16, 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@244804, tag=null, root-is-layout-requested=false, has-input-connection=false, x=8.0, y=101.0}"

at dalvik.system.VMStack.getThreadStackTrace(Native Method)
at java.lang.Thread.getStackTrace(Thread.java:1538)
at androidx.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:96)
at androidx.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:59)
at androidx.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:324)
at androidx.test.espresso.ViewInteraction.check(ViewInteraction.java:306)
at com.agoda.kakao.delegate.ViewInteractionDelegate.check(ViewInteractionDelegate.kt:26)
at com.agoda.kakao.image.ImageViewAssertions$DefaultImpls.hasDrawable(ImageViewAssertions.kt:24)
at com.agoda.kakao.image.KImageView.hasDrawable(KImageView.kt:17)
at com.agoda.kakao.image.ImageViewAssertions$DefaultImpls.hasDrawable$default(ImageViewAssertions.kt:23)
Unlimity commented 4 years ago

@Vacxe can you please take a look?

Vacxe commented 4 years ago

Yea. Let me check whats going wrong

lucas34 commented 4 years ago

Any idea ?

Unlimity commented 4 years ago

@lucas34 there has been changes made by @Vacxe to how the library handles drawable assertions and that is likely the case. While Konstantin is trying to figure out any issues with the code itself it would be helpful if you could provide a code of the failing tests, the image view parameters (xml args or in-code setup) that you are asserting as well as drawable resource itself.

Vacxe commented 4 years ago

@lucas34 looks like that you have issue with hasDrawable(<RES ID>) function. Actually this method is covered by test in AlertDialogTest and DrawableListTest. Could u please provide additional information or if it possible provide sample of evil resource.

Also could you describe what the android API version in use on devices?

Vacxe commented 4 years ago

@lucas34 looks like issue based on tinting. That's actually is a real tricky issue because assertion based on bitmap evaluation. Ill figure out what we can to do.

lucas34 commented 4 years ago

Fix in 2.3.4