Created
June 11, 2016 15:10
-
-
Save up1/c6e60fcb85c9be3086b25a5bd2f17825 to your computer and use it in GitHub Desktop.
Espresso Test Record
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| LargeTest | |
| @RunWith(AndroidJUnit4.class) | |
| public class NotesActivityTest { | |
| @Rule | |
| public ActivityTestRule<NotesActivity> mActivityTestRule = new ActivityTestRule<>(NotesActivity.class); | |
| @Test | |
| public void notesActivityTest() { | |
| ViewInteraction floatingActionButton = onView( | |
| allOf(withId(com.example.android.testing.notes.R.id.fab_add_notes), | |
| withParent(withId(com.example.android.testing.notes.R.id.coordinatorLayout)), | |
| isDisplayed())); | |
| floatingActionButton.perform(click()); | |
| ViewInteraction appCompatEditText = onView( | |
| allOf(withId(com.example.android.testing.notes.R.id.add_note_title), isDisplayed())); | |
| appCompatEditText.perform(replaceText("new title")); | |
| ViewInteraction appCompatEditText2 = onView( | |
| allOf(withId(com.example.android.testing.notes.R.id.add_note_description), isDisplayed())); | |
| appCompatEditText2.perform(replaceText("ggggh")); | |
| ViewInteraction floatingActionButton2 = onView( | |
| allOf(withId(com.example.android.testing.notes.R.id.fab_add_notes), | |
| withParent(withId(com.example.android.testing.notes.R.id.coordinatorLayout)), | |
| isDisplayed())); | |
| floatingActionButton2.perform(click()); | |
| ViewInteraction appCompatEditText3 = onView( | |
| allOf(withId(com.example.android.testing.notes.R.id.add_note_description), withText("ggggh"), isDisplayed())); | |
| appCompatEditText3.perform(replaceText("gggghhh")); | |
| ViewInteraction textView = onView( | |
| allOf(withId(com.example.android.testing.notes.R.id.note_detail_title), withText("new title"), isDisplayed())); | |
| textView.check(matches(withText("new title"))); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment