diff --git a/app/src/androidTest/java/com/orgzly/android/espresso/BookChooserActivityTest.java b/app/src/androidTest/java/com/orgzly/android/espresso/BookChooserActivityTest.java index 079c1982..5a5b689f 100644 --- a/app/src/androidTest/java/com/orgzly/android/espresso/BookChooserActivityTest.java +++ b/app/src/androidTest/java/com/orgzly/android/espresso/BookChooserActivityTest.java @@ -31,6 +31,12 @@ private ActivityScenario startActivityWithCreateShortcutAct return ActivityScenario.launch(intent); } + private ActivityScenario startActivityForResult() { + Intent intent = new Intent(context, BookChooserActivity.class); + intent.setAction(Intent.ACTION_CREATE_SHORTCUT); + return ActivityScenario.launchActivityForResult(intent); + } + @Before public void setUp() throws Exception { super.setUp(); @@ -60,7 +66,7 @@ public void testLongClickChoosesBook() { @Test public void testCreateShortcut() { - ActivityScenario scenario = startActivityWithCreateShortcutAction(); + ActivityScenario scenario = startActivityForResult(); onView(allOf(withText("book-one"), isDisplayed())).perform(click());