88import android .support .test .runner .AndroidJUnit4 ;
99import android .test .suitebuilder .annotation .LargeTest ;
1010
11+ import com .google .firebase .quickstart .database .java .SignInActivity ;
12+
1113import org .junit .Rule ;
1214import org .junit .Test ;
1315import org .junit .runner .RunWith ;
@@ -46,50 +48,50 @@ public void newPostTest() {
4648
4749 // Select email field
4850 ViewInteraction appCompatEditText = onView (
49- allOf (withId (R .id .field_email ),
50- withParent (withId (R .id .layout_email_password )),
51+ allOf (withId (R .id .fieldEmail ),
52+ withParent (withId (R .id .layoutEmailPassword )),
5153 isDisplayed ()));
5254 appCompatEditText .perform (click ());
5355
5456 // Enter email address
5557 ViewInteraction appCompatEditText2 = onView (
56- allOf (withId (R .id .field_email ),
57- withParent (withId (R .id .layout_email_password )),
58+ allOf (withId (R .id .fieldEmail ),
59+ withParent (withId (R .id .layoutEmailPassword )),
5860 isDisplayed ()));
5961 appCompatEditText2 .perform (replaceText (email ));
6062
6163 // Enter password
6264 ViewInteraction appCompatEditText3 = onView (
63- allOf (withId (R .id .field_password ),
64- withParent (withId (R .id .layout_email_password )),
65+ allOf (withId (R .id .fieldPassword ),
66+ withParent (withId (R .id .layoutEmailPassword )),
6567 isDisplayed ()));
6668 appCompatEditText3 .perform (replaceText (password ));
6769
6870 // Click sign up
6971 ViewInteraction appCompatButton = onView (
70- allOf (withId (R .id .button_sign_up ), withText (R .string .sign_up ),
71- withParent (withId (R .id .layout_buttons )),
72+ allOf (withId (R .id .buttonSignUp ), withText (R .string .sign_up ),
73+ withParent (withId (R .id .layoutButtons )),
7274 isDisplayed ()));
7375 appCompatButton .perform (click ());
7476
7577 // Click new post button
7678 ViewInteraction floatingActionButton = onView (
77- allOf (withId (R .id .fab_new_post ), isDisplayed ()));
79+ allOf (withId (R .id .fabNewPost ), isDisplayed ()));
7880 floatingActionButton .perform (click ());
7981
8082 // Enter post title
8183 ViewInteraction appCompatEditText4 = onView (
82- allOf (withId (R .id .field_title ), isDisplayed ()));
84+ allOf (withId (R .id .fieldTitle ), isDisplayed ()));
8385 appCompatEditText4 .perform (replaceText (postTitle ));
8486
8587 // Enter post content
8688 ViewInteraction appCompatEditText5 = onView (
87- allOf (withId (R .id .field_body ), isDisplayed ()));
89+ allOf (withId (R .id .fieldBody ), isDisplayed ()));
8890 appCompatEditText5 .perform (replaceText (postContent ));
8991
9092 // Click submit button
9193 ViewInteraction floatingActionButton2 = onView (
92- allOf (withId (R .id .fab_submit_post ), isDisplayed ()));
94+ allOf (withId (R .id .fabSubmitPost ), isDisplayed ()));
9395 floatingActionButton2 .perform (click ());
9496
9597 // Navigate to "My Posts"
@@ -99,18 +101,18 @@ public void newPostTest() {
99101
100102 // Check that the title is correct
101103 ViewInteraction textView = onView (
102- allOf (withId (R .id .post_title ), withText (postTitle ), isDisplayed ()));
104+ allOf (withId (R .id .postTitle ), withText (postTitle ), isDisplayed ()));
103105 textView .check (matches (withText (postTitle )));
104106
105107 // Check that the content is correct
106108 ViewInteraction textView2 = onView (
107- allOf (withId (R .id .post_body ), withText (postContent ), isDisplayed ()));
109+ allOf (withId (R .id .postBody ), withText (postContent ), isDisplayed ()));
108110 textView2 .check (matches (withText (postContent )));
109111
110112 // Check that it has zero stars
111113 ViewInteraction textView3 = onView (
112- allOf (withId (R .id .post_num_stars ), withText ("0" ),
113- withParent (withId (R .id .star_layout )),
114+ allOf (withId (R .id .postNumStars ), withText ("0" ),
115+ withParent (withId (R .id .starLayout )),
114116 isDisplayed ()));
115117 textView3 .check (matches (withText ("0" )));
116118
0 commit comments