@@ -0,0 +1,3168 @@
+package com.example.android.architecture.blueprints.todoapp.testworksTests;%0A%0Aimport android.support.test.rule.ActivityTestRule;%0Aimport android.support.test.runner.AndroidJUnit4;%0A%0Aimport com.example.android.architecture.blueprints.todoapp.R;%0Aimport com.example.android.architecture.blueprints.todoapp.tasks.TasksActivity;%0A%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0A%0Aimport static android.support.test.espresso.Espresso.onView;%0Aimport static android.support.test.espresso.action.ViewActions.click;%0Aimport static android.support.test.espresso.action.ViewActions.closeSoftKeyboard;%0Aimport static android.support.test.espresso.action.ViewActions.replaceText;%0Aimport static android.support.test.espresso.action.ViewActions.typeText;%0Aimport static android.support.test.espresso.matcher.ViewMatchers.withId;%0Aimport static android.support.test.espresso.matcher.ViewMatchers.withText;%0A%0A/**%0A * Test Example Three%0A * Functionalize creating task into class method.%0A * Add second test for creating another task%0A */%0A%0A@RunWith(AndroidJUnit4.class)%0Apublic class TestFour %7B%0A%0A    private final static String TESTTITLE = %22TEST TITLE%22;%0A%0A    private final static String TESTDESCR = %22TEST DESCRIPTION%22;%0A%0A    private final static String TESTTITLE2 = %22SECOND TEST TITLE%22;%0A%0A    private final static String TESTDESC2 = %22SECOND TEST DESCRIPTION%22;%0A%0A    @Rule%0A    public ActivityTestRule%3CTasksActivity%3E mActivityTestRule =%0A            new ActivityTestRule%3C%3E(TasksActivity.class);%0A%0A    @Test%0A    public void createOneTask() %7B%0A        createTask(TESTTITLE, TESTDESCR);%0A    %7D%0A%0A    @Test%0A    public void createSecondTask() %7B%0A        createTask(TESTTITLE2, TESTDESC2);%0A    %7D%0A%0A    @Test%0A    public void editTask() %7B%0A        // First add a task%0A        createTask(TESTTITLE, TESTDESCR);%0A%0A        // Click on the task on the list%0A        onView(withText(TESTTITLE)).perform(click());%0A%0A        // Click on the edit task button%0A        onView(withId(R.id.fab_edit_task)).perform(click());%0A%0A        String editTaskTitle = %22Edited Title%22;%0A        String editTaskDescription = %22Edited Description%22;%0A%0A        // Edit task title and description%0A        onView(withId(R.id.add_task_title))%0A                .perform(replaceText(editTaskTitle), closeSoftKeyboard()); // Type new task title%0A        onView(withId(R.id.add_task_description)).perform(replaceText(editTaskDescription),%0A                closeSoftKeyboard()); // Type new task description and close the keyboard%0A%0A        // Save the task%0A        onView(withId(R.id.fab_edit_task_done)).perform(click());%0A    %7D%0A%0A    private void createTask(String title, String description) %7B%0A        // Click on the add task button%0A        onView(withId(R.id.fab_add_task)).perform(click());%0A%0A        // Add task title and description%0A        onView(withId(R.id.add_task_title)).perform(typeText(title),%0A                closeSoftKeyboard()); // Type new task title%0A        onView(withId(R.id.add_task_description)).perform(typeText(description),%0A                closeSoftKeyboard()); // Type new task description and close the keyboard%0A%0A        // Save the task%0A        onView(withId(R.id.fab_edit_task_done)).perform(click());%0A    %7D%0A%7D%0A

Add test for editing task