Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test coverage #34

Open
Gelassen opened this issue Oct 13, 2023 · 0 comments
Open

Test coverage #34

Gelassen opened this issue Oct 13, 2023 · 0 comments

Comments

@Gelassen
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant