The following code snippet shows an example of an Espresso test:
A. @Rule fun greeterSaysHello() { onView(withId(R.id.name_field)).do(typeText("Steve")) onView(withId(R.id.greet_button)).do(click()) onView(withText("Hello Steve!")).check(matches(isDisplayed())) }
B. @Test fun greeterSaysHello() { onView(withId(R.id.name_field)).perform(typeText("Steve")) onView(withId(R.id.greet_button)).perform(click()) onView(withText("Hello Steve!")).check(matches(isDisplayed())) }
C. @Test fun greeterSaysHello() { onView(withId(R.id.name_field)).do(typeText("Steve")) onView(withId(R.id.greet_button)).do(click()) onView(withText("Hello Steve!")).compare(matches(isDisplayed())) }
The following code snippet shows an example of an Espresso test:
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
The following code snippet shows an example of an Espresso test:
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!