Issue#56 Create Example Description on how to start with Test First
This commit is contained in:
parent
dbf95d92fb
commit
3617ab96ac
2 changed files with 416 additions and 3 deletions
|
|
@ -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())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue