Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

[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).
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@JoseAlcerreca @dlam and others