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

[PagingSample] UI test fails #1075

Open
JoseAlcerreca opened this issue Jan 10, 2023 · 0 comments
Open

[PagingSample] UI test fails #1075

JoseAlcerreca opened this issue Jan 10, 2023 · 0 comments
Assignees

Comments

@JoseAlcerreca
Copy link
Contributor

This test passes locally in API 29 and 33 but fails on CI

    @Test
    @UiThread
    fun showSomeResults() {
        val intent = Intent(ApplicationProvider.getApplicationContext(), MainActivity::class.java)
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
        ActivityScenario.launch<MainActivity>(intent)
        onView(withId(R.id.cheeseList)).check { view, noViewFoundException ->
            if (noViewFoundException != null) {
                throw noViewFoundException
            }

            val recyclerView = view as RecyclerView
            assertThat(recyclerView.adapter).isNotNull()
            assertThat(recyclerView.adapter!!.itemCount).isGreaterThan(0)
        }
    }

https://github.com/android/architecture-components-samples/actions/runs/3881734623/jobs/6621073798

paging.android.example.com.pagingsample.MainActivityTest > showSomeResults[test(AVD) - 8.0.0] FAILED 
	androidx.test.espresso.base.AssertionErrorHandler$AssertionFailedWithCauseError: expected to be greater than: 0
	but was                    : 0
Tests on test(AVD) - 8.0.0 failed: There was 1 failure(s).
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

3 participants
@JoseAlcerreca @dlam and others