package com.lamkansing.matternote;

import android.test.ActivityInstrumentationTestCase2;
import static android.support.test.espresso.Espresso.*;
import static android.support.test.espresso.matcher.ViewMatchers.*;
import static android.support.test.espresso.assertion.ViewAssertions.matches;

/**
 * Created by line on 7/5/15.
 */
public class HelloWorldEspressoTest extends ActivityInstrumentationTestCase2<Notebooks> {

    public HelloWorldEspressoTest() {
        super(Notebooks.class);
    }

    @Override
    public void setUp() throws Exception {
        super.setUp();
        getActivity();
    }

    public void testListGoesOverTheFold() {
        onView(withText("Hello world!")).check(matches(isDisplayed()));
    }
}
@@ -284,16 +284,73 @@
 matches;
+%0Aimport android.support.test.espresso.action.ViewActions;
 %0A%0A/**%0A *
@@ -683,107 +683,636 @@
 test
-ListGoesOverTheFold() %7B%0A        onView(withText(%22Hello world!%22)).check(matches(isDisplayed()));%0A    %7D
+CreateNewNotebook()%7B%0A        onView(withId(R.id.fabaddnotebook)).check(matches(isDisplayed()));%0A        onView(withId(R.id.fabaddnotebook)).perform(ViewActions.click());%0A%0A        // on dialog fragment, enter new notebook name%0A        onView(withId(R.id.editText_notebookname)).check(matches(isDisplayed()));%0A        onView(withId(R.id.editText_notebookname)).perform(ViewActions.typeText(%22testing%22));%0A        onView(withText(%22save%22)).perform(ViewActions.click());%0A    %7D%0A%0A    /*%0A    public void testClickListNotebook()%7B%0A        onData(allOf(is(instanceOf(String.class)), is(%22Americano%22)))%0A                .perform(click());%0A    %7D*/
 %0A%7D

check fab add notebook