1
|
/**
|
2
|
* Copyright (C) 2014 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.dataportal.selenium.tests.cichorieae;
|
10
|
|
11
|
import static org.junit.Assert.assertEquals;
|
12
|
import static org.junit.Assert.assertNotNull;
|
13
|
import static org.junit.Assert.assertNull;
|
14
|
|
15
|
import java.net.MalformedURLException;
|
16
|
import java.util.List;
|
17
|
import java.util.UUID;
|
18
|
|
19
|
import org.junit.Test;
|
20
|
|
21
|
import eu.etaxonomy.dataportal.DataPortalSite;
|
22
|
import eu.etaxonomy.dataportal.ElementUtils;
|
23
|
import eu.etaxonomy.dataportal.elements.FeatureBlock;
|
24
|
import eu.etaxonomy.dataportal.elements.GalleryImage;
|
25
|
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
|
26
|
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
|
27
|
import eu.etaxonomy.dataportal.pages.TaxonProfilePage;
|
28
|
|
29
|
/**
|
30
|
* @author a.kohlbecker
|
31
|
*
|
32
|
*/
|
33
|
@DataPortalContexts( { DataPortalSite.cichorieae })
|
34
|
public class FeatureBlock_Media_Test extends CdmDataPortalTestBase {
|
35
|
|
36
|
static UUID erythroseris_amabilis_Uuid = UUID.fromString("b335ceee-d6c1-4c93-841d-3b4bd279d855");
|
37
|
|
38
|
@Test
|
39
|
public void erythroseris_amabilis() throws MalformedURLException {
|
40
|
TaxonProfilePage p = new TaxonProfilePage(driver, getContext(), erythroseris_amabilis_Uuid);
|
41
|
String expectedName = "Erythroseris amabilis";
|
42
|
assertEquals(getContext().prepareTitle(expectedName), driver.getTitle());
|
43
|
|
44
|
FeatureBlock palynologyBlock = p.getFeatureBlockAt(1, "palynology", "div", "span");
|
45
|
|
46
|
List<List<GalleryImage>> galleryImageRows = ElementUtils.getGalleryImages(palynologyBlock.getElement(), p.getWait());
|
47
|
|
48
|
assertEquals("Expecting one row of images", 1, galleryImageRows.size());
|
49
|
assertEquals("Expecting 3 images in row", 3, galleryImageRows.get(0).size());
|
50
|
|
51
|
GalleryImage firstImage = galleryImageRows.get(0).get(0);
|
52
|
assertNotNull("caption should be on", firstImage.getCaptionText());
|
53
|
|
54
|
}
|
55
|
|
56
|
|
57
|
}
|