コード例 #1
0
 @Test
 @Ignore
 public void shouldShowNoArtistTabs_WhenThereAreNoArtists() throws NodeSelectorException {
   Map<String, Object> model = new HashMap<String, Object>();
   model.put("artists", new ArrayList<Artist>());
   HtmlElements tags = selectorEngine.process(HTML_PATH, model);
   assertThat(tags.matching(".artist-tabs li"), not(exists()));
 }
コード例 #2
0
 @Test
 @Ignore
 public void shouldShowTwoArtistTabs_WhenThereAreTwoArtists() throws NodeSelectorException {
   Map<String, Object> model = new HashMap<String, Object>();
   model.put("artists", getTwoArtistsWithNoAlbums());
   HtmlElements tags = selectorEngine.process(HTML_PATH, model);
   assertThat(tags.matching(".artist-tabs li"), hasSize(2));
 }
コード例 #3
0
 @Test
 @Ignore
 public void shouldNotShowCdAvailableImage_WhenCdIsNotAvailable() throws NodeSelectorException {
   Map<String, Object> model = new HashMap<String, Object>();
   model.put("artists", getOneArtistWithOneAlbum());
   HtmlElements tags = selectorEngine.process(HTML_PATH, model);
   assertThat(tags.matching(".cd-available"), not(exists()));
 }
コード例 #4
0
 @Test
 @Ignore
 public void shouldShowOneAlbum_WhenThereIsOneAlbum() throws NodeSelectorException {
   Map<String, Object> model = new HashMap<String, Object>();
   model.put("artists", getOneArtistWithOneAlbum());
   HtmlElements tags = selectorEngine.process(HTML_PATH, model);
   assertThat(tags.matching(".album"), occursOnce());
 }
コード例 #5
0
 @Test
 @Ignore
 public void shouldSetTheAlbumName_WhenThereIsOneAlbum() throws NodeSelectorException {
   Map<String, Object> model = new HashMap<String, Object>();
   model.put("artists", getOneArtistWithOneAlbum());
   HtmlElements tags = selectorEngine.process(HTML_PATH, model);
   assertThat(tags.matching(".album h3"), isSingleElementThat(hasOnlyText("expected album name")));
 }
コード例 #6
0
 @Test
 @Ignore
 public void shouldSetTheSecondTabCssClassToTabTitle_WhenThereAreTwoArtists()
     throws NodeSelectorException {
   Map<String, Object> model = new HashMap<String, Object>();
   model.put("artists", getTwoArtistsWithNoAlbums());
   HtmlElements tags = selectorEngine.process(HTML_PATH, model);
   assertThat(
       tags.matching(".artist-tabs li:first-of-type"), isSingleElementThat(hasClass("tab-title")));
 }
コード例 #7
0
 @Test
 @Ignore
 public void shouldShowVinylAvailableImage_WhenVinylIsAvailable() throws NodeSelectorException {
   Map<String, Object> model = new HashMap<String, Object>();
   List<Artist> artists = getOneArtistWithOneAlbum();
   artists.get(0).getAlbums().get(0).setVinylAvailable(true);
   model.put("artists", artists);
   HtmlElements tags = selectorEngine.process(HTML_PATH, model);
   assertThat(tags.matching(".vinyl-available"), occursOnce());
 }
コード例 #8
0
 @Test
 @Ignore
 public void shouldNotSetTheSecondAlbumCssClassToActive_WhenThereAreTwoAlbums()
     throws NodeSelectorException {
   Map<String, Object> model = new HashMap<String, Object>();
   model.put("artists", getOneArtistWithTwoAlbums());
   HtmlElements tags = selectorEngine.process(HTML_PATH, model);
   assertThat(
       tags.matching(".album:nth-of-type(2) > div"), isSingleElementThat(not(hasClass("active"))));
 }
コード例 #9
0
 @Test
 @Ignore
 public void shouldSetTheArtistImageSrc_WhenThereIsOneArtist() throws NodeSelectorException {
   Map<String, Object> model = new HashMap<String, Object>();
   model.put("artists", getOneArtistWithNoAlbums());
   HtmlElements tags = selectorEngine.process(HTML_PATH, model);
   assertThat(
       tags.matching(".artist-image"),
       isSingleElementThat(hasAttribute("src", "expected artist image")));
 }
コード例 #10
0
 @Test
 @Ignore
 public void shouldSetTheFirstArtistIdToArtist1_WhenThereAreTwoArtists()
     throws NodeSelectorException {
   Map<String, Object> model = new HashMap<String, Object>();
   model.put("artists", getTwoArtistsWithNoAlbums());
   HtmlElements tags = selectorEngine.process(HTML_PATH, model);
   assertThat(
       tags.matching(".artist:first-of-type"), isSingleElementThat(hasAttribute("id", "artist1")));
 }
コード例 #11
0
 @Test
 @Ignore
 public void shouldSetTheSecondArtistDivCssClassesToArtistContent_WhenThereAreTwoArtists()
     throws NodeSelectorException {
   Map<String, Object> model = new HashMap<String, Object>();
   model.put("artists", getTwoArtistsWithNoAlbums());
   HtmlElements tags = selectorEngine.process(HTML_PATH, model);
   assertThat(
       tags.matching(".artist:nth-of-type(2)"), isSingleElementThat(hasClasses("artist content")));
 }
コード例 #12
0
 @Test
 @Ignore
 public void shouldSetTheSecondTabHrefToArtist2_WhenThereAreTwoArtists()
     throws NodeSelectorException {
   Map<String, Object> model = new HashMap<String, Object>();
   model.put("artists", getTwoArtistsWithNoAlbums());
   HtmlElements tags = selectorEngine.process(HTML_PATH, model);
   assertThat(
       tags.matching(".artist-tabs li:nth-of-type(2) a"),
       isSingleElementThat(hasAttribute("href", "#artist2")));
 }
コード例 #13
0
 @Test
 @Ignore
 public void
     shouldSetTheSecondArtistSecondAlbumIdToArtist2Album2_WhenThereAreTwoArtistsEachWithTwoAlbums()
         throws NodeSelectorException {
   Map<String, Object> model = new HashMap<String, Object>();
   model.put("artists", getTwoArtistsEachWithTwoAlbums());
   HtmlElements tags = selectorEngine.process(HTML_PATH, model);
   assertThat(
       tags.matching(".artist:nth-of-type(2) .album:nth-of-type(2) > div"),
       isSingleElementThat(hasAttribute("id", "artist2-album2")));
 }
コード例 #14
0
 @Test
 @Ignore
 public void
     shouldSetTheFirstArtistSecondAccordionEntryHrefToArtist1Album2_WhenThereAreTwoArtistsEachWithTwoAlbums()
         throws NodeSelectorException {
   Map<String, Object> model = new HashMap<String, Object>();
   model.put("artists", getTwoArtistsEachWithTwoAlbums());
   HtmlElements tags = selectorEngine.process(HTML_PATH, model);
   assertThat(
       tags.matching(".artist:first-of-type .album:nth-of-type(2) a"),
       isSingleElementThat(hasAttribute("href", "#artist1-album2")));
 }