From c38800475aa7b679af8a29301b7a8f85c01b40b2 Mon Sep 17 00:00:00 2001 From: Nikita Evdokimov Date: Wed, 11 Jan 2023 12:39:44 +0300 Subject: [PATCH] TECH: more recycler checks --- .../kaspressample/recycler/RecyclerScreen.kt | 5 +++++ .../kaspressample/recycler/RecyclerTest.kt | 13 ++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/recycler/RecyclerScreen.kt b/samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/recycler/RecyclerScreen.kt index f197ac250..b4a28a590 100644 --- a/samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/recycler/RecyclerScreen.kt +++ b/samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/recycler/RecyclerScreen.kt @@ -3,10 +3,15 @@ package com.kaspersky.kaspressample.recycler import com.kaspersky.kaspressample.R import com.kaspersky.kaspresso.screens.KScreen import io.github.kakaocup.kakao.recycler.KRecyclerView +import io.github.kakaocup.kakao.text.KTextView object RecyclerScreen : KScreen() { override val layoutId: Int = R.layout.fragment_recycler override val viewClass: Class<*> = RecyclerFragment::class.java val recycler = KRecyclerView(builder = { withId(R.id.recycler) }, {}) + + val element0 = KTextView { withText("0") } + val element14 = KTextView { withText("14") } + val element29 = KTextView { withText("29") } } diff --git a/samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/recycler/RecyclerTest.kt b/samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/recycler/RecyclerTest.kt index 31f2ee82d..4b9f9fc28 100644 --- a/samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/recycler/RecyclerTest.kt +++ b/samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/recycler/RecyclerTest.kt @@ -12,11 +12,14 @@ class RecyclerTest : TestCase() { }.after { }.run { RecyclerScreen { - recycler { - scrollTo(15) - scrollToEnd() - scrollToStart() - } + recycler { scrollTo(15) } + element14 { isDisplayed() } + + recycler { scrollToEnd() } + element29 { isDisplayed() } + + recycler { scrollToStart() } + element0 { isDisplayed() } } } }