Testing Snackbar show with Espresso

This worked for me, please try.

onView(allOf(withId(android.support.design.R.id.snackbar_text), withText("My text")))
            .check(matches(isDisplayed()));

If you use AndroidX, please use the following:

onView(withId(com.google.android.material.R.id.snackbar_text))
        .check(matches(withText(R.string.whatever_is_your_text)))

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)