@Test public void randomNameNotDisplayed() throws Exception { try { assertNameDisplayed(ExamplDb.class.getSimpleName()); fail(); } catch (Exception e) { assertThat(e, instanceOf(EspressoException.class)); } }
@Override public void handle(Throwable error, Matcher<View> viewMatcher) { if (error instanceof EspressoException || error instanceof AssertionFailedError || error instanceof AssertionError) { Uri location = Uri.EMPTY; if (activityRef.get() != null) { location = screenShotManager.shoot(activityRef.get().getWindow().getDecorView()); } throw Throwables.propagate(getUserFriendlyError(error, viewMatcher, location.toString())); } else { throw Throwables.propagate(error); } }