Issue#56 Create Example Description on how to start with Test First

This commit is contained in:
Gergely Hegedus 2022-09-23 18:30:17 +03:00
parent dbf95d92fb
commit 3617ab96ac
2 changed files with 416 additions and 3 deletions

View file

@ -40,6 +40,11 @@ class HomeRobot {
Espresso.onView(withId(R.id.recycler)).perform(RemoveItemAnimations())
}
fun assertToolbarIsShown() = apply {
Espresso.onView(withId(R.id.toolbar))
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
}
fun setupIntentResults() {
Intents.intending(IntentMatchers.hasComponent(AuthActivity::class.java.canonicalName))
.respondWith(Instrumentation.ActivityResult(Activity.RESULT_OK, Intent()))
@ -53,9 +58,11 @@ class HomeRobot {
notIntended(IntentMatchers.hasComponent(AuthActivity::class.java.canonicalName))
}
fun clickSignOut() = apply {
Intents.intending(IntentMatchers.hasComponent(AuthActivity::class.java.canonicalName))
.respondWith(Instrumentation.ActivityResult(0, null))
fun clickSignOut(setupIntentResults: Boolean = true) = apply {
if (setupIntentResults) {
Intents.intending(IntentMatchers.hasComponent(AuthActivity::class.java.canonicalName))
.respondWith(Instrumentation.ActivityResult(Activity.RESULT_OK, Intent()))
}
Espresso.onView(withId(R.id.logout_cta)).perform(click())
}