|
16 | 16 |
|
17 | 17 | package com.example.android.architecture.blueprints.todoapp.tasks;
|
18 | 18 |
|
19 |
| -import android.support.test.InstrumentationRegistry; |
20 |
| -import android.support.test.rule.ActivityTestRule; |
21 |
| -import android.support.test.runner.AndroidJUnit4; |
22 |
| -import android.test.suitebuilder.annotation.LargeTest; |
23 |
| -import android.text.TextUtils; |
24 |
| -import android.view.View; |
25 |
| -import android.widget.ListView; |
26 |
| - |
27 |
| -import com.example.android.architecture.blueprints.todoapp.Injection; |
28 |
| -import com.example.android.architecture.blueprints.todoapp.R; |
29 |
| -import com.example.android.architecture.blueprints.todoapp.TestUtils; |
30 |
| -import com.example.android.architecture.blueprints.todoapp.data.source.TasksDataSource; |
31 |
| - |
32 |
| -import org.hamcrest.Description; |
33 |
| -import org.hamcrest.Matcher; |
34 |
| -import org.hamcrest.TypeSafeMatcher; |
35 |
| -import org.junit.Rule; |
36 |
| -import org.junit.Test; |
37 |
| -import org.junit.runner.RunWith; |
38 |
| - |
39 | 19 | import static android.support.test.InstrumentationRegistry.getTargetContext;
|
40 | 20 | import static android.support.test.espresso.Espresso.onView;
|
41 | 21 | import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu;
|
|
53 | 33 | import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription;
|
54 | 34 | import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
55 | 35 | import static android.support.test.espresso.matcher.ViewMatchers.withText;
|
| 36 | + |
56 | 37 | import static com.google.common.base.Preconditions.checkArgument;
|
| 38 | + |
57 | 39 | import static org.hamcrest.Matchers.allOf;
|
58 | 40 | import static org.hamcrest.core.IsNot.not;
|
59 | 41 |
|
| 42 | +import android.support.test.InstrumentationRegistry; |
| 43 | +import android.support.test.rule.ActivityTestRule; |
| 44 | +import android.support.test.runner.AndroidJUnit4; |
| 45 | +import android.test.suitebuilder.annotation.LargeTest; |
| 46 | +import android.text.TextUtils; |
| 47 | +import android.view.View; |
| 48 | +import android.widget.ListView; |
| 49 | + |
| 50 | +import com.example.android.architecture.blueprints.todoapp.Injection; |
| 51 | +import com.example.android.architecture.blueprints.todoapp.R; |
| 52 | +import com.example.android.architecture.blueprints.todoapp.TestUtils; |
| 53 | +import com.example.android.architecture.blueprints.todoapp.data.source.TasksDataSource; |
| 54 | + |
| 55 | +import org.hamcrest.Description; |
| 56 | +import org.hamcrest.Matcher; |
| 57 | +import org.hamcrest.TypeSafeMatcher; |
| 58 | +import org.junit.Rule; |
| 59 | +import org.junit.Test; |
| 60 | +import org.junit.runner.RunWith; |
| 61 | + |
60 | 62 | /**
|
61 | 63 | * Tests for the tasks screen, the main screen which contains a list of all tasks.
|
62 | 64 | */
|
@@ -404,7 +406,8 @@ private void createTask(String title, String description) {
|
404 | 406 | onView(withId(R.id.fab_add_task)).perform(click());
|
405 | 407 |
|
406 | 408 | // Add task title and description
|
407 |
| - onView(withId(R.id.add_task_title)).perform(typeText(title)); // Type new task title |
| 409 | + onView(withId(R.id.add_task_title)).perform(typeText(title), |
| 410 | + closeSoftKeyboard()); // Type new task title |
408 | 411 | onView(withId(R.id.add_task_description)).perform(typeText(description),
|
409 | 412 | closeSoftKeyboard()); // Type new task description and close the keyboard
|
410 | 413 |
|
|
0 commit comments