@Override @Test public void checkAnExtendedWidget() { assertTrue(rottenTomatoes.getExtendeddMovieCount() >= 1); Movie movie = rottenTomatoes.getAnExtendedMovie(0); assertTrue(!StringUtils.isBlank(movie.title())); assertTrue(!StringUtils.isBlank(movie.score())); assertNotNull(movie.getPoster()); movie.goToReview(); rottenTomatoes.checkExtendedReview(); }
@Test @Override public void checkACommonWidget() { assertTrue(rottenTomatoes.getSimpleMovieCount() >= 1); Movie movie = rottenTomatoes.getASimpleMovie(0); assertTrue(!StringUtils.isBlank(movie.title())); assertTrue(!StringUtils.isBlank(movie.score())); assertNotNull(movie.getPoster()); movie.goToReview(); rottenTomatoes.checkSimpleReview(); }
@Override @Test public void checkTheLocatorOverridingOnAWidget() { try { assertTrue(rottenTomatoes.getFakedMovieCount() == 0); } catch (Exception e) { if (!NoSuchElementException.class.isAssignableFrom(e.getClass())) throw e; } rottenTomatoes.getASimpleMovie(0).goToReview(); try { rottenTomatoes.checkFakeReview(); } catch (Exception e) { if (NoSuchElementException.class.isAssignableFrom(e.getClass())) return; else throw e; } throw new RuntimeException("Any exception was expected"); }