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

Error performing 'load adapter data' #196

Closed automaticqa closed 4 years ago

automaticqa commented 4 years ago

Hello guys, I try to interact with HorizontalGridView's list. All its items contain identical views and strings. so, i try to click on HorizontalGridView's item at first position. 15-34-30

I declared devicesList and ListItem:

object DevicesListScreen : BaseScreen<DevicesListScreen>() {
    val devicesList = KAbsListView(
        builder = {withId(R.id.row_content)},
        itemTypeBuilder = {itemType ( :: ListItem )}
    )

    class ListItem(i: DataInteraction) : KAdapterItem<ListItem>(i) {
        val title = KTextView(i) {
                withDescendant { withId(R.id.deviceType) }
        }
    }
}

I get PerformException: Error performing 'load adapter data' on view '(with id: id/row_content)' If i understsand right I have problem with a ListItem's description/declararion. Could you please advise me, how to declare ListItem correctly in order with its hierarchy using Kakao. Thank you! Спасибо!

Unlimity commented 4 years ago

Hi there! Actually, the error message tells you that it can't find a list view adapter at a view with id R.id.row_content So it seems there is no adapter in the view espresso matched during runtime. Please make sure that you have your adapter set up before espresso accesses it and that the matcher provided in the builder actually matches your GridView. Cheers!

automaticqa commented 4 years ago

Thanks! Exactly! Probably it happens because of incorrect ListItem's declaration. That's wht i asked about ListItem

Unlimity commented 4 years ago

I revised your layout again and I see small issue: you don't need withDescendant declaration if you're matching a text view. Passing parent's data interaction to the KView constructor will limit the matcher to the needed root view of a list item. In the builder, you can directly look for your text view:

    class ListItem(i: DataInteraction) : KAdapterItem<ListItem>(i) {
        val title = KTextView(i) { withId(R.id.deviceType) }
    }
Unlimity commented 4 years ago

Closing this issue. If you still have this issue @StanlyT please feel free to reopen.