add tests to check for the addCalendar button available when date is there

This commit is contained in:
ligi 2014-06-12 20:40:33 +02:00
parent 1989343ad2
commit dc595382d6

View file

@ -17,7 +17,6 @@ import static com.google.android.apps.common.testing.ui.espresso.assertion.ViewA
import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.isDisplayed;
import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withId;
import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.CoreMatchers.not;
@TargetApi(14)
public class TheTicketViewActivity extends BaseIntegration<TicketViewActivity> {
@ -66,6 +65,23 @@ public class TheTicketViewActivity extends BaseIntegration<TicketViewActivity> {
onView(withId(R.id.date)).check(matches(isDisplayed()));
}
@MediumTest
public void testLinkToCalendarIsThereWhenPassbookHasDate() {
act_pass.relevantDate = new DateTime();
getActivity();
onView(withId(R.id.addCalendar)).check(matches(isDisplayed()));
}
@MediumTest
public void testLinkToCalendarIsNotThereWhenPassbookHasNoDate() {
act_pass.relevantDate = null;
getActivity();
onView(withId(R.id.addCalendar)).check(matches(not(isDisplayed())));
}
@MediumTest
public void test_click_on_barcode_opens_fullscreen_barcode() {
getActivity();