concretesolutions / kappuccino

A kotlin library to simplify how to do espresso tests on Android.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update intent matcher doc on README

heitorcolangelo opened this issue · comments

The samples and explanation of how we use Kappuccino to match intents are not up-to-date.
Also, it can be improved, for example (not up-to-date yet, just refactoring):

@Test
fun intentMatcherTest() {
    val WHATS_PACKAGE_NAME = "com.whatsapp"
    val PLAY_STORE_URL = "https://play.google.com/store/apps/details?id="
    Intents.init()

    val matcher = allOf {
    	action(Intent.ACTION_VIEW)
        url(PLAY_STORE_URL + WHATS_PACKAGE_NAME)
    }

    matchIntent {
        matcher
        result {
           ok()
        }
    }

    click {
        id(R.id.btn_start_activity)
    }

    matchIntent {
        matcher
    }

    Intents.release()
}