@@ -73,11 +73,12 @@ public void testLogin(){
7373
7474
7575 final ListView habitList = activity .getListView ();
76- Habit habit = (Habit ) habitList .getItemAtPosition (0 );
76+
77+ Habit habit = (Habit ) habitList .getItemAtPosition (habitList .getCount ()-1 );
7778 assertEquals ("Disciplining Kids" , habit .getHabitTitle ());
7879 assertEquals ("Good Nanny" ,habit .getHabitReason ());
7980
80- solo .clickInList (0 );
81+ solo .clickInList (habitList . getCount ()- 1 );
8182 solo .assertCurrentActivity ("wrong activity" , HabitDetailViewActivity .class );
8283 assertTrue (solo .waitForText ("Disciplining Kids" , 1 , 1000 ));
8384 assertTrue (solo .waitForText ("Good Nanny" , 1 , 1000 ));
@@ -96,11 +97,12 @@ public void testLogin(){
9697
9798
9899 final ListView habitList2 = activity2 .getListView ();
99- Habit myhabit = (Habit ) habitList .getItemAtPosition (0 );
100+
101+ Habit myhabit = (Habit ) habitList .getItemAtPosition (habitList .getCount ()-1 );
100102 assertEquals ("Disciplining Kids" , myhabit .getHabitTitle ());
101103 assertEquals ("Good Nanny" ,myhabit .getHabitReason ());
102104
103- solo .clickInList (0 );
105+ solo .clickInList (habitList . getCount ()- 1 );
104106 solo .assertCurrentActivity ("wrong activity" , HabitDetailViewActivity .class );
105107 assertTrue (solo .waitForText ("Disciplining Kids" , 1 , 1000 ));
106108 assertTrue (solo .waitForText ("Good Nanny" , 1 , 1000 ));
0 commit comments