Skip to content

Commit 896c0f7

Browse files
committed
espresso post fixed
1 parent e78b138 commit 896c0f7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

_drafts/2019-02-04-espresso.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ class ActionViewTest {
131131
@Test
132132
fun verifyNavigateToSecondActivityWithMessage() {
133133
onView(withId(R.id.editTextName)).perform(typeText("value"))
134-
onView(withId(R.id.buttonNavigate)).perform(click())
134+
onView(withId(R.id.buttonNavigate)).perform(closeSoftKeyboard(), click())
135135

136136
intended(allOf(
137137
hasComponent(hasShortClassName(".SecondActivity")),
138-
toPackage(pl.androidcode.espresso),
138+
toPackage("pl.androidcode.espresso"),
139139
hasExtra(MainActivity.NAME, "value")))
140140
}
141141
}
@@ -146,19 +146,19 @@ Sprawdzanie stanu widoków następuje poprzez wyołanie metody `check` klasy `Vi
146146

147147
{% highlight kotlin %}
148148
@RunWith(AndroidJUnit4::class)
149-
class EspressoTest {
149+
class VerifyTest {
150150

151151
@get:Rule
152152
var activityRule: ActivityTestRule<MainActivity> = ActivityTestRule(MainActivity::class.java)
153153

154154
@Test
155-
fun verifyChangedText() {
156-
//actions
157-
onView(withId(R.id.editTextName)).perform(typeText("value"))
158-
onView(withId(R.id.buttonAction)).perform(click()) //do action
155+
fun verifyHideTextViewWhenHideTextTyped() {
156+
//actions
157+
onView(withId(R.id.editTextName)).perform(typeText("hide"))
158+
onView(withId(R.id.buttonAction)).perform(click())
159159

160160
//verify
161-
onView(withId(R.id.textViewName)).check(matches(withText("value")))
161+
onView(withId(R.id.textViewName)).check(matches(not(isDisplayed())))
162162
}
163163
}
164164
{% endhighlight %}

0 commit comments

Comments
 (0)