File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
androidTest/java/com/testingandroid/Tutorial5 Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 99import android .support .test .rule .ActivityTestRule ;
1010import android .support .test .runner .AndroidJUnit4 ;
1111
12+ import com .testingandroid .R ;
1213import com .testingandroid .login .LoginActivity ;
1314
1415import org .hamcrest .Matcher ;
2728import static android .support .test .espresso .intent .matcher .IntentMatchers .hasAction ;
2829import static android .support .test .espresso .intent .matcher .IntentMatchers .hasData ;
2930import static android .support .test .espresso .matcher .ViewMatchers .isDisplayed ;
31+ import static android .support .test .espresso .matcher .ViewMatchers .withId ;
3032import static android .support .test .espresso .matcher .ViewMatchers .withText ;
3133import static org .hamcrest .Matchers .allOf ;
3234
@@ -53,8 +55,9 @@ public void checkTextOnScreen() {
5355 intending (MediaPickIntent ).respondWith (new Instrumentation .ActivityResult (Activity .RESULT_OK , resultData ));
5456
5557 onView (withText ("Gallery" )).perform (click ());
56- onView (withText ( "gallery pick" )).perform (click ());
58+ onView (withId ( R . id . btnGalleryPick )).perform (click ());
5759 intended (MediaPickIntent );
60+ //To check the image pick works or not
5861 try {
5962 Thread .sleep (4500 );
6063 } catch (InterruptedException e ) {
Original file line number Diff line number Diff line change 2929 app : layout_constraintTop_toTopOf =" parent" />
3030
3131 <Button
32- android : id =" @+id/btnLoginButton "
32+ android : id =" @+id/btnGalleryPick "
3333 android : layout_width =" 130dp"
3434 android : layout_height =" wrap_content"
3535 android : layout_gravity =" center_horizontal"
You can’t perform that action at this time.
0 commit comments