12
12
13
13
import victoralbertos .io .rxgcm .data .api .GcmServerService ;
14
14
import victoralbertos .io .rxgcm .presentation .FragmentBase ;
15
- import victoralbertos .io .rxgcm .presentation .HostActivityIssues ;
15
+ import victoralbertos .io .rxgcm .presentation .StartActivity ;
16
16
17
17
import static android .support .test .espresso .Espresso .onView ;
18
18
import static android .support .test .espresso .action .ViewActions .click ;
30
30
@ FixMethodOrder (MethodSorters .NAME_ASCENDING )
31
31
public class NotificationsTest {
32
32
private final static String TITLE = "A tittle" , BODY = "A Body" ;
33
- @ Rule public ActivityTestRule <HostActivityIssues > mActivityRule = new ActivityTestRule (HostActivityIssues .class );
33
+ @ Rule public ActivityTestRule <StartActivity > mActivityRule = new ActivityTestRule (StartActivity .class );
34
34
35
35
@ Test public void _1_Send_And_Receive_Notification_On_Foreground () {
36
36
//Conservative delay to wait for token in case app is not previously installed
37
37
waitTime (7000 );
38
38
39
+ onView (withId (R .id .bt_no_nested_fragment )).perform (click ());
40
+
39
41
//Send issue
40
42
onView (withId (R .id .et_title )).perform (click (), replaceText (TITLE ), closeSoftKeyboard ());
41
43
onView (withId (R .id .et_body )).perform (click (), replaceText (BODY ), closeSoftKeyboard ());
@@ -60,7 +62,20 @@ public class NotificationsTest {
60
62
onView (withId (R .id .rv_notifications )).perform (RecyclerViewActions .actionOnItemAtPosition (0 , click ()));
61
63
}
62
64
63
- @ Test public void _2_Send_And_Receive_Notification_On_Background () {
65
+ @ Test public void _2_Send_And_Receive_Notification_On_Foreground_Nested_Fragment () {
66
+ onView (withId (R .id .bt_nested_fragment )).perform (click ());
67
+
68
+ //Send nested supply
69
+ onView (withId (R .id .et_title )).perform (click (), replaceText (TITLE ), closeSoftKeyboard ());
70
+ onView (withId (R .id .et_body )).perform (click (), replaceText (BODY ), closeSoftKeyboard ());
71
+ onView (withId (R .id .bt_send_supply )).perform (click ());
72
+
73
+ waitTime (3000 );
74
+
75
+ onView (withId (R .id .rv_notifications )).perform (RecyclerViewActions .actionOnItemAtPosition (0 , click ()));
76
+ }
77
+
78
+ @ Test public void _3_Send_And_Receive_Notification_On_Background () {
64
79
AppGcmReceiverUIBackground .initTestBackgroundMessage ();
65
80
mActivityRule .getActivity ().finish ();
66
81
0 commit comments