Skip to content

Test coverage #34

Description

@Gelassen

Is your feature request related to a problem?

I had an issue to cover UI screen with shimmer by espresso integration test

Describe the solution you'd like:

            onView(allOf(withClassName(endsWith("RecyclerView")), isDisplayed()))
                .check(matches(CustomMatchers().recyclerViewSizeMatch(count)))
                                                                or
            onView(CustomMatchers().isThisRequiredListInShimmer(tagToMatch))
    fun isThisRequiredListInShimmer(tagToMatch: String): BoundedMatcher<View, RecyclerView> {
        return object : BoundedMatcher<View, RecyclerView>(RecyclerView::class.java) {

            override fun describeTo(description: Description) {
                description.appendText("RecyclerView in shimmer component should have defined tag $tagToMatch")
            }

            override fun matchesSafely(item: RecyclerView): Boolean {
                return item.tag != null && item.tag.equals(tagToMatch)
            }
        }
    }

Describe alternatives you've considered:

This a solution I implemented for my use case, but it would be good to have more elegant way to do this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions