From b6d01be191f831e74fd6f1a5519a10411fc8a22d Mon Sep 17 00:00:00 2001 From: "pavel.krylov" Date: Wed, 18 Jun 2025 20:05:30 +0300 Subject: [PATCH] Added EmptyDrawableMatcherTest --- .../sample/EmptyDrawableMatcherTest.kt | 26 +++++++++++++++++++ .../sample/screen/EmptyImageViewScreen.kt | 11 ++++++++ sample/src/main/AndroidManifest.xml | 4 +++ .../kakaocup/sample/EmptyImageViewActivity.kt | 5 ++++ .../res/layout/activity_empty_image_view.xml | 19 ++++++++++++++ 5 files changed, 65 insertions(+) create mode 100644 sample/src/androidTest/kotlin/io/github/kakaocup/sample/EmptyDrawableMatcherTest.kt create mode 100644 sample/src/androidTest/kotlin/io/github/kakaocup/sample/screen/EmptyImageViewScreen.kt create mode 100644 sample/src/main/kotlin/io/github/kakaocup/sample/EmptyImageViewActivity.kt create mode 100644 sample/src/main/res/layout/activity_empty_image_view.xml diff --git a/sample/src/androidTest/kotlin/io/github/kakaocup/sample/EmptyDrawableMatcherTest.kt b/sample/src/androidTest/kotlin/io/github/kakaocup/sample/EmptyDrawableMatcherTest.kt new file mode 100644 index 000000000..f73041a45 --- /dev/null +++ b/sample/src/androidTest/kotlin/io/github/kakaocup/sample/EmptyDrawableMatcherTest.kt @@ -0,0 +1,26 @@ +package io.github.kakaocup.sample + +import androidx.test.ext.junit.rules.ActivityScenarioRule +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner +import io.github.kakaocup.kakao.screen.Screen +import io.github.kakaocup.sample.screen.EmptyImageViewScreen +import org.junit.Ignore +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith + +@RunWith(AndroidJUnit4ClassRunner::class) +class EmptyDrawableMatcherTest { + + @Rule + @JvmField + val rule = ActivityScenarioRule(EmptyImageViewActivity::class.java) + + @Test + @Ignore("DrawableMatcher needs to be fixed") + fun test() { + Screen.onScreen { + imageViewWithDrawable.isVisible() + } + } +} diff --git a/sample/src/androidTest/kotlin/io/github/kakaocup/sample/screen/EmptyImageViewScreen.kt b/sample/src/androidTest/kotlin/io/github/kakaocup/sample/screen/EmptyImageViewScreen.kt new file mode 100644 index 000000000..172e8cbd2 --- /dev/null +++ b/sample/src/androidTest/kotlin/io/github/kakaocup/sample/screen/EmptyImageViewScreen.kt @@ -0,0 +1,11 @@ +package io.github.kakaocup.sample.screen + +import io.github.kakaocup.kakao.image.KImageView +import io.github.kakaocup.kakao.screen.Screen +import io.github.kakaocup.sample.R + +open class EmptyImageViewScreen : Screen() { + val imageViewWithDrawable = KImageView { + withDrawable(R.drawable.ic_sentiment_very_satisfied_black_24dp) + } +} diff --git a/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml index 036bac892..1e59860e1 100644 --- a/sample/src/main/AndroidManifest.xml +++ b/sample/src/main/AndroidManifest.xml @@ -132,6 +132,10 @@ android:name="io.github.kakaocup.sample.ChipsActivity" android:label="Chips Activity" android:theme="@style/MaterialAppTheme" /> + diff --git a/sample/src/main/kotlin/io/github/kakaocup/sample/EmptyImageViewActivity.kt b/sample/src/main/kotlin/io/github/kakaocup/sample/EmptyImageViewActivity.kt new file mode 100644 index 000000000..e5e642421 --- /dev/null +++ b/sample/src/main/kotlin/io/github/kakaocup/sample/EmptyImageViewActivity.kt @@ -0,0 +1,5 @@ +package io.github.kakaocup.sample + +import androidx.appcompat.app.AppCompatActivity + +class EmptyImageViewActivity: AppCompatActivity(R.layout.activity_empty_image_view) diff --git a/sample/src/main/res/layout/activity_empty_image_view.xml b/sample/src/main/res/layout/activity_empty_image_view.xml new file mode 100644 index 000000000..b21af6a1d --- /dev/null +++ b/sample/src/main/res/layout/activity_empty_image_view.xml @@ -0,0 +1,19 @@ + + + + + + + + +