Revision db46ac2e
Added by Andreas Kohlbecker almost 11 years ago
.gitattributes | ||
---|---|---|
268 | 268 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/java/eu/etaxonomy/dataportal/elements/GalleryImage.java -text |
269 | 269 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/java/eu/etaxonomy/dataportal/elements/ImgElement.java -text |
270 | 270 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/java/eu/etaxonomy/dataportal/elements/LinkElement.java -text |
271 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/java/eu/etaxonomy/dataportal/elements/MultipartDescriptionElementRepresentation.java -text |
|
271 | 272 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/java/eu/etaxonomy/dataportal/elements/SearchBlock.java -text |
272 | 273 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/java/eu/etaxonomy/dataportal/elements/TaxonListElement.java -text |
273 | 274 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/java/eu/etaxonomy/dataportal/elements/TaxonType.java -text |
... | ... | |
296 | 297 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/resources/org/mozilla/addons/firexpath-0.9.6.1-fx.xpi -text |
297 | 298 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/CichorieaeSearchTest.java -text |
298 | 299 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Cichorieae_HybridTest.java -text |
300 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Cichorieae_NamePageTest.java -text |
|
299 | 301 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Cichorieae_TechnicalAnnnotationsTest.java -text |
302 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Lactuca_triquetra_TaxonProfileTest.java -text |
|
300 | 303 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cyprus/Allium_guttatum_subsp_guttatum_TaxonProfileTest.java -text |
301 | 304 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cyprus/CyprusSearchTest.java -text |
302 | 305 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cyprus/Cyprus_HybridTest.java -text |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/java/eu/etaxonomy/dataportal/elements/DescriptionElementRepresentation.java | ||
---|---|---|
38 | 38 |
} |
39 | 39 |
} |
40 | 40 |
|
41 |
|
|
42 |
|
|
41 | 43 |
} |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/java/eu/etaxonomy/dataportal/elements/FeatureBlock.java | ||
---|---|---|
10 | 10 |
package eu.etaxonomy.dataportal.elements; |
11 | 11 |
|
12 | 12 |
import java.util.ArrayList; |
13 |
import java.util.HashMap; |
|
13 | 14 |
import java.util.List; |
14 | 15 |
|
15 | 16 |
import static junit.framework.Assert.*; |
16 | 17 |
import static org.junit.Assert.assertEquals; |
17 | 18 |
|
18 | 19 |
import org.openqa.selenium.By; |
20 |
import org.openqa.selenium.NoSuchElementException; |
|
19 | 21 |
import org.openqa.selenium.WebElement; |
20 | 22 |
import org.openqa.selenium.WebElement; |
21 | 23 |
|
24 |
import com.gargoylesoftware.htmlunit.ElementNotFoundException; |
|
25 |
|
|
22 | 26 |
/** |
23 | 27 |
* @author andreas |
24 | 28 |
* @date Jul 4, 2011 |
... | ... | |
62 | 66 |
/** |
63 | 67 |
* @param element |
64 | 68 |
*/ |
65 |
public FeatureBlock(WebElement element, String enclosingTag, String elementTag) {
|
|
69 |
public FeatureBlock(WebElement element, String enclosingTag, String ... elementTags) {
|
|
66 | 70 |
super(element); |
67 | 71 |
|
68 | 72 |
List<WebElement> fnkList = element.findElements(By.className("footnote-key")); |
... | ... | |
86 | 90 |
//TODO throw exception instead of making an assetion! selenium should have appropriate exeptions |
87 | 91 |
assertEquals("Unexpected tag enclosing description element representations", enclosingTag, descriptionElementsRepresentation.getTagName()); |
88 | 92 |
|
89 |
for(WebElement el : descriptionElementsRepresentation.findElements(By.tagName(elementTag))){ |
|
90 |
descriptionElements.add(new DescriptionElementRepresentation(el)); |
|
93 |
if(elementTags.length > 1){ |
|
94 |
|
|
95 |
// handle multipart elements e.g. <dt></dt><dd></dd> |
|
96 |
HashMap<String, List<WebElement>> elementsByTag = new HashMap<String, List<WebElement>>(); |
|
97 |
Integer lastSize = null; |
|
98 |
for (String elementTag : elementTags) { |
|
99 |
List<WebElement> foundElements = descriptionElementsRepresentation.findElements(By.tagName(elementTag)); |
|
100 |
if(lastSize != null && foundElements.size() != lastSize){ |
|
101 |
throw new NoSuchElementException("Mulitpart element lists differ in size"); |
|
102 |
} |
|
103 |
lastSize = foundElements.size(); |
|
104 |
elementsByTag.put(elementTag, foundElements); |
|
105 |
} |
|
106 |
|
|
107 |
for (int descriptionElementIndex = 0; descriptionElementIndex < lastSize; descriptionElementIndex++){ |
|
108 |
List<WebElement> elementsByIndex = new ArrayList<WebElement>(); |
|
109 |
for (String elementTag : elementTags) { |
|
110 |
elementsByIndex.add(elementsByTag.get(elementTag).get(descriptionElementIndex)); |
|
111 |
} |
|
112 |
descriptionElements.add(new MultipartDescriptionElementRepresentation(elementsByIndex.toArray(new WebElement[elementsByIndex.size()]))); |
|
113 |
|
|
114 |
} |
|
115 |
} else { |
|
116 |
// handle single elements |
|
117 |
String elementTag = elementTags[0]; |
|
118 |
for(WebElement el : descriptionElementsRepresentation.findElements(By.tagName( elementTag ))) { |
|
119 |
descriptionElements.add(new DescriptionElementRepresentation(el)); |
|
120 |
} |
|
91 | 121 |
} |
92 | 122 |
|
93 | 123 |
} |
... | ... | |
105 | 135 |
|
106 | 136 |
DescriptionElementRepresentation firstDescriptionElement = getDescriptionElements().get(descriptionElementId); |
107 | 137 |
|
138 |
if(firstDescriptionElement instanceof MultipartDescriptionElementRepresentation){ |
|
139 |
int multipartElementIndex = 0; |
|
140 |
firstDescriptionElement = ((MultipartDescriptionElementRepresentation)firstDescriptionElement).multipartElements.get(multipartElementIndex); |
|
141 |
} |
|
108 | 142 |
int parentX = getElement().getLocation().getX(); |
109 | 143 |
int elementX = firstDescriptionElement.getElement().getLocation().getX(); |
110 | 144 |
double elementPadLeft = pxSizeToDouble(firstDescriptionElement.getElement().getCssValue("padding-left")); |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/java/eu/etaxonomy/dataportal/elements/MultipartDescriptionElementRepresentation.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2011 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
9 |
*/ |
|
10 |
package eu.etaxonomy.dataportal.elements; |
|
11 |
|
|
12 |
import java.util.ArrayList; |
|
13 |
import java.util.List; |
|
14 |
|
|
15 |
import org.openqa.selenium.WebElement; |
|
16 |
|
|
17 |
public class MultipartDescriptionElementRepresentation extends DescriptionElementRepresentation{ |
|
18 |
|
|
19 |
ArrayList<DescriptionElementRepresentation> multipartElements = null; |
|
20 |
|
|
21 |
public ArrayList<DescriptionElementRepresentation> getMultipartElements() { |
|
22 |
return multipartElements; |
|
23 |
} |
|
24 |
|
|
25 |
public MultipartDescriptionElementRepresentation(WebElement ... element) { |
|
26 |
super(element[0]); |
|
27 |
|
|
28 |
multipartElements = new ArrayList<DescriptionElementRepresentation>(element.length -1); |
|
29 |
for(int i = 0; i < element.length; i++){ |
|
30 |
multipartElements.add(new DescriptionElementRepresentation(element[i])); |
|
31 |
} |
|
32 |
} |
|
33 |
|
|
34 |
@Override |
|
35 |
public WebElement getElement() { |
|
36 |
String methodName = "getElement()"; |
|
37 |
throw new RuntimeException(methodName +" is NOT applicable to MultipartDescriptionElementRepresentation, use getElements().get(n)." + methodName + " instead"); |
|
38 |
} |
|
39 |
|
|
40 |
@Override |
|
41 |
public String getText() { |
|
42 |
StringBuilder combinedText = new StringBuilder(); |
|
43 |
for (DescriptionElementRepresentation element : multipartElements) { |
|
44 |
combinedText.append(element.getText()); |
|
45 |
} |
|
46 |
return combinedText.toString(); |
|
47 |
} |
|
48 |
|
|
49 |
@Override |
|
50 |
public List<String> getClassAttributes() { |
|
51 |
String methodName = "getClassAttributes()"; |
|
52 |
throw new RuntimeException(methodName +" is NOT applicable to MultipartDescriptionElementRepresentation, use getElements().get(n)." + methodName + " instead"); |
|
53 |
} |
|
54 |
|
|
55 |
@Override |
|
56 |
public double getComputedFontSize() { |
|
57 |
String methodName = "getComputedFontSize()"; |
|
58 |
throw new RuntimeException(methodName +" is NOT applicable to MultipartDescriptionElementRepresentation, use getElements().get(n)." + methodName + " instead"); |
|
59 |
} |
|
60 |
|
|
61 |
@Override |
|
62 |
public List<LinkElement> getLinksInElement() { |
|
63 |
List<LinkElement> combinedLinkList = new ArrayList<LinkElement>(); |
|
64 |
for (DescriptionElementRepresentation element : multipartElements) { |
|
65 |
combinedLinkList.addAll(element.getLinksInElement()); |
|
66 |
} |
|
67 |
return combinedLinkList; |
|
68 |
} |
|
69 |
|
|
70 |
@Override |
|
71 |
public String toSting() { |
|
72 |
StringBuilder toStringRepresentatin = new StringBuilder(this.getClass().getSimpleName()); |
|
73 |
for (DescriptionElementRepresentation element : multipartElements) { |
|
74 |
toStringRepresentatin.append("<" + element.getElement().getTagName() + ">"); |
|
75 |
} |
|
76 |
return toStringRepresentatin.toString(); |
|
77 |
} |
|
78 |
|
|
79 |
@Override |
|
80 |
public List getSources() { |
|
81 |
List<BaseElement> combinedSourcesList = new ArrayList<BaseElement>(); |
|
82 |
for (DescriptionElementRepresentation element : multipartElements) { |
|
83 |
combinedSourcesList.addAll(element.getSources()); |
|
84 |
} |
|
85 |
return combinedSourcesList; |
|
86 |
} |
|
87 |
|
|
88 |
|
|
89 |
} |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/java/eu/etaxonomy/dataportal/pages/TaxonProfilePage.java | ||
---|---|---|
165 | 165 |
return null; |
166 | 166 |
} |
167 | 167 |
|
168 |
public FeatureBlock getFeatureBlockAt(int position, String featureName, String enclosingTag, String ... elementTag){ |
|
169 |
|
|
170 |
List<WebElement> featureBlocks = portalContent.findElements(By.className("block-cdm_dataportal-feature")); |
|
171 |
Assert.assertTrue("Too few feature block elements", featureBlocks.size() >= position); |
|
172 |
for(WebElement b : featureBlocks){ |
|
173 |
if (b.getAttribute("id").equals("block-cdm_dataportal-feature-" + featureName)){ |
|
174 |
return new FeatureBlock( b, enclosingTag, elementTag); |
|
175 |
} |
|
176 |
} |
|
177 |
return null; |
|
178 |
} |
|
179 |
|
|
168 | 180 |
/** |
169 | 181 |
* @param index |
170 | 182 |
* @param tocLinkText |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Cichorieae_NamePageTest.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2009 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
9 |
*/ |
|
10 |
package eu.etaxonomy.dataportal.selenium.tests.cichorieae; |
|
11 |
|
|
12 |
import static org.junit.Assert.assertEquals; |
|
13 |
|
|
14 |
import java.net.MalformedURLException; |
|
15 |
import java.util.UUID; |
|
16 |
|
|
17 |
import org.junit.Test; |
|
18 |
|
|
19 |
import eu.etaxonomy.dataportal.DataPortalContext; |
|
20 |
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase; |
|
21 |
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts; |
|
22 |
import eu.etaxonomy.dataportal.pages.GenericPortalPage; |
|
23 |
import eu.etaxonomy.dataportal.pages.TaxonSynonymyPage; |
|
24 |
|
|
25 |
/** |
|
26 |
* |
|
27 |
* @author a.kohlbecker |
|
28 |
* |
|
29 |
*/ |
|
30 |
|
|
31 |
@DataPortalContexts( { DataPortalContext.cichorieae }) |
|
32 |
public class Cichorieae_NamePageTest extends CdmDataPortalTestBase{ |
|
33 |
|
|
34 |
|
|
35 |
static UUID intybellia_rosea_cass_Uuid = UUID.fromString("b8f725f0-320a-49e5-aa9a-82cef1c47c17"); |
|
36 |
|
|
37 |
// static UUID lactuca_favratii_Uuid = UUID.fromString("6027e1fa-9fe5-4ddc-a2de-f72bfa7378c0"); |
|
38 |
// |
|
39 |
// static UUID crepis_oenipontana_Uuid = UUID.fromString("31b8757f-6acb-4826-ba7f-b2d116dc713c"); |
|
40 |
// |
|
41 |
// static UUID crepis_artificialis_Uuid = UUID.fromString("3eabdf89-ddeb-461c-b6f8-341bb8deb7bf"); |
|
42 |
|
|
43 |
|
|
44 |
@Test |
|
45 |
public void intybellia_rosea_cass() throws MalformedURLException { |
|
46 |
GenericPortalPage p = new GenericPortalPage(driver, getContext(), "name/" + intybellia_rosea_cass_Uuid); |
|
47 |
assertEquals(getContext().prepareTitle("Crepis purpurea"), p.getTitle()); |
|
48 |
} |
|
49 |
|
|
50 |
|
|
51 |
} |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Lactuca_triquetra_TaxonProfileTest.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2009 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
9 |
*/ |
|
10 |
package eu.etaxonomy.dataportal.selenium.tests.cichorieae; |
|
11 |
|
|
12 |
import static org.junit.Assert.*; |
|
13 |
|
|
14 |
import java.net.MalformedURLException; |
|
15 |
import java.util.List; |
|
16 |
import java.util.UUID; |
|
17 |
|
|
18 |
import org.apache.commons.lang.StringUtils; |
|
19 |
import org.apache.log4j.Logger; |
|
20 |
import org.junit.After; |
|
21 |
import org.junit.Before; |
|
22 |
import org.junit.Test; |
|
23 |
import org.openqa.selenium.By; |
|
24 |
import org.openqa.selenium.NoSuchElementException; |
|
25 |
import org.openqa.selenium.WebElement; |
|
26 |
|
|
27 |
import eu.etaxonomy.dataportal.DataPortalContext; |
|
28 |
import eu.etaxonomy.dataportal.ElementUtils; |
|
29 |
import eu.etaxonomy.dataportal.elements.BaseElement; |
|
30 |
import eu.etaxonomy.dataportal.elements.DescriptionElementRepresentation; |
|
31 |
import eu.etaxonomy.dataportal.elements.FeatureBlock; |
|
32 |
import eu.etaxonomy.dataportal.elements.ImgElement; |
|
33 |
import eu.etaxonomy.dataportal.elements.LinkElement; |
|
34 |
import eu.etaxonomy.dataportal.elements.MultipartDescriptionElementRepresentation; |
|
35 |
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase; |
|
36 |
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts; |
|
37 |
import eu.etaxonomy.dataportal.pages.TaxonProfilePage; |
|
38 |
|
|
39 |
/** |
|
40 |
* @author a.kohlbecker |
|
41 |
* |
|
42 |
*/ |
|
43 |
|
|
44 |
@DataPortalContexts( { DataPortalContext.cichorieae }) |
|
45 |
public class Lactuca_triquetra_TaxonProfileTest extends CdmDataPortalTestBase{ |
|
46 |
|
|
47 |
public static final Logger logger = Logger.getLogger(Lactuca_triquetra_TaxonProfileTest.class); |
|
48 |
|
|
49 |
static UUID taxonUuid = UUID.fromString("ecb7a76e-694a-4706-b1ab-a2eb334173ff"); |
|
50 |
|
|
51 |
TaxonProfilePage p = null; |
|
52 |
|
|
53 |
@Before |
|
54 |
public void setUp() throws MalformedURLException { |
|
55 |
|
|
56 |
if(p != null && driver != null ){ |
|
57 |
logger.debug("TaxonProfilePage p:" + p.getPageURL() + ", driver is at " + driver.getCurrentUrl()); |
|
58 |
} |
|
59 |
p = new TaxonProfilePage(driver, getContext(), taxonUuid); |
|
60 |
|
|
61 |
} |
|
62 |
|
|
63 |
|
|
64 |
@Test |
|
65 |
public void testTitleAndTabs() { |
|
66 |
|
|
67 |
assertEquals(getContext().prepareTitle("Lactuca triquetra"), p.getTitle()); |
|
68 |
assertNull("Authorship information should be hidden", p.getAuthorInformationText()); |
|
69 |
|
|
70 |
List<LinkElement> primaryTabs = p.getPrimaryTabs(); |
|
71 |
int tabId = 0; |
|
72 |
assertEquals("General", primaryTabs.get(tabId++).getText()); |
|
73 |
assertEquals("Synonymy", primaryTabs.get(tabId++).getText()); |
|
74 |
assertEquals("Images", primaryTabs.get(tabId++).getText()); |
|
75 |
assertEquals("Specimens", primaryTabs.get(tabId++).getText()); |
|
76 |
assertEquals("Expecting " + tabId + " tabs", tabId, primaryTabs.size()); |
|
77 |
|
|
78 |
} |
|
79 |
|
|
80 |
@Test |
|
81 |
public void testProfileImage() { |
|
82 |
ImgElement profileImage = p.getProfileImage(); |
|
83 |
assertNotNull("Expecting profile images to be switched on", profileImage); |
|
84 |
assertTrue("Expoecting image Lactuca_triquetra_Bc_01.JPG", profileImage.getSrcUrl().toString().endsWith("/Lactuca_triquetra_Bc_01.JPG")); |
|
85 |
} |
|
86 |
|
|
87 |
|
|
88 |
@Test |
|
89 |
public void testFeatures() { |
|
90 |
assertEquals("Content", p.getTableOfContentHeader()); |
|
91 |
List<LinkElement> links = p.getTableOfContentLinks(); |
|
92 |
assertNotNull("Expecting a list of TOC links in the profile page.", links); |
|
93 |
|
|
94 |
FeatureBlock featureBlock; |
|
95 |
int featureId = 0; |
|
96 |
|
|
97 |
int descriptionElementFontSize = 12; |
|
98 |
String expectedCssDisplay = "inline"; |
|
99 |
String expectedListStyleType = "none"; |
|
100 |
String expectedListStylePosition = "outside"; |
|
101 |
String expectedListStyleImage = "none"; |
|
102 |
int indent = 0; |
|
103 |
|
|
104 |
/* Description */ |
|
105 |
String featureClass = "description"; |
|
106 |
String featureLabel = "Description"; |
|
107 |
String blockTextFull = null; |
|
108 |
String blockTextBegin = featureLabel + "\nHerb, perennial, scoparious, 40-80 cm high. Flowering stems erect, triangular, medullary, glaucous-green, soon leafless, strongly branched; branches erect, slender. Cauline leaves few, glabrous."; |
|
109 |
String blockTextEnd = "Pappus white, 6.0-7.0 mm long, persistent, fragile, shortly barbellate or scabridulous.\n\nbased on: Meikle, R.D. 1985: Flora auf Cyprus 2. - Kew (as Prenanthes triquetra)."; |
|
110 |
expectedListStyleType = "none"; |
|
111 |
|
|
112 |
p.testTableOfContentEntry(featureId++,featureLabel, featureClass); |
|
113 |
featureBlock = p.getFeatureBlockAt(featureId, featureClass, "div", "span"); |
|
114 |
|
|
115 |
assertTrue(featureBlock.getText().startsWith(blockTextBegin)); |
|
116 |
assertTrue(featureBlock.getText().endsWith(blockTextEnd)); |
|
117 |
featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage); |
|
118 |
assertEquals(0, featureBlock.getOriginalSourcesSections().size()); |
|
119 |
|
|
120 |
/* Distribution */ |
|
121 |
expectedCssDisplay = "block"; |
|
122 |
featureClass = "distribution"; |
|
123 |
featureLabel = "Distribution"; |
|
124 |
blockTextFull = featureLabel + "\n\n\n\nAsia-Temperate:\nCyprus 1,2; Lebanon-Syria (Lebanon 3,4,5); Palestine (Israel 5,6).\n1. Meikle, R. D., Flora of Cyprus 2. 1985, 2. Osorio-Tafall, B. H. & Serafim, G. M., List of the vascular plants of Cyprus. 1973, 3. Mouterde, P., Nouvelle flore du Liban et de la Syrie. Texte 3. 1978-1984, 4. Boissier, E., Flora Orientalis 3. 1875, 5. Post, G. E. , Flora of Syria, Palestine, and Sinai 2. 19336. (N)"; |
|
125 |
p.testTableOfContentEntry(featureId++, featureLabel, featureClass); |
|
126 |
featureBlock = p.getFeatureBlockAt(featureId, featureClass, "div", "dt", "dd"); |
|
127 |
|
|
128 |
assertEquals(blockTextFull, featureBlock.getText()); |
|
129 |
|
|
130 |
MultipartDescriptionElementRepresentation descriptionElement = (MultipartDescriptionElementRepresentation) featureBlock.getDescriptionElements().get(0); |
|
131 |
logger.info(descriptionElement.getText()); |
|
132 |
featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage); |
|
133 |
assertEquals(0, featureBlock.getOriginalSourcesSections().size()); |
|
134 |
assertEquals("Expecting 7 FootnoteKeys", 7, featureBlock.getFootNoteKeys().size()); |
|
135 |
assertEquals("Expecting 6 Footnotes", 6, featureBlock.getFootNotes().size()); |
|
136 |
|
|
137 |
assertNotNull("Expecting an OpenLayers map", featureBlock.getElement().findElement(By.id("openlayers_map"))); |
|
138 |
WebElement mapCaptionElement = null; |
|
139 |
try { |
|
140 |
mapCaptionElement = featureBlock.getElement().findElement(By.className("distribution_map_caption")); |
|
141 |
} catch (NoSuchElementException e){ |
|
142 |
/* IGNORE */ |
|
143 |
} |
|
144 |
assertNull(mapCaptionElement); |
|
145 |
|
|
146 |
/* Uses */ |
|
147 |
featureClass = "ecology"; |
|
148 |
featureLabel = "Ecology"; |
|
149 |
blockTextFull = featureLabel + "\n500 m. On chalky cliffs or in flushes on serpentine.\n\nfrom: Meikle, R. D. 1985: Flora of Cyprus 2. – Kew. (as Prenanthes triquetra)"; |
|
150 |
expectedCssDisplay = "inline"; |
|
151 |
|
|
152 |
p.testTableOfContentEntry(featureId++, featureLabel, featureClass); |
|
153 |
featureBlock = p.getFeatureBlockAt(featureId, featureClass, "div", "span"); |
|
154 |
|
|
155 |
assertEquals(blockTextFull, featureBlock.getText()); |
|
156 |
featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage); |
|
157 |
assertEquals(0, featureBlock.getOriginalSourcesSections().size()); |
|
158 |
assertEquals("Expecting no FootnoteKeys", 0, featureBlock.getFootNoteKeys().size()); |
|
159 |
assertEquals("Expecting no Footnotes", 0, featureBlock.getFootNotes().size()); |
|
160 |
|
|
161 |
|
|
162 |
/* Common names */ |
|
163 |
featureClass = "common_names"; |
|
164 |
featureLabel = "Common names"; |
|
165 |
expectedCssDisplay = "block"; |
|
166 |
blockTextFull = featureLabel + "\nArabic (Lebanon): سْكَرْيولَة ثُلاثِيَّة الأَرْكان7\n7. Nehmé, M., Dictionnaire Etymologique de la Flore du Liban. 2000"; |
|
167 |
|
|
168 |
p.testTableOfContentEntry(featureId++, featureLabel, featureClass); |
|
169 |
featureBlock = p.getFeatureBlockAt(featureId, featureClass, "div", "li"); |
|
170 |
|
|
171 |
assertEquals(blockTextFull, featureBlock.getText()); |
|
172 |
|
|
173 |
|
|
174 |
/* Uses */ |
|
175 |
featureClass = "credits"; |
|
176 |
featureLabel = "Credits"; |
|
177 |
blockTextFull = featureLabel + "\nChristodoulou C. S. 2009: Images (1 added).\nMakris C. 2009: Images (1 added)."; |
|
178 |
expectedCssDisplay = "block"; |
|
179 |
|
|
180 |
p.testTableOfContentEntry(featureId++, featureLabel, featureClass); |
|
181 |
featureBlock = p.getFeatureBlockAt(featureId, featureClass, "div", "span"); |
|
182 |
|
|
183 |
assertEquals(blockTextFull, featureBlock.getText()); |
|
184 |
featureBlock.testDescriptionElementLayout(0, indent, descriptionElementFontSize, expectedCssDisplay, expectedListStyleType, expectedListStylePosition, expectedListStyleImage); |
|
185 |
assertEquals(0, featureBlock.getOriginalSourcesSections().size()); |
|
186 |
assertEquals("Expecting no FootnoteKeys", 0, featureBlock.getFootNoteKeys().size()); |
|
187 |
assertEquals("Expecting no Footnotes", 0, featureBlock.getFootNotes().size()); |
|
188 |
|
|
189 |
} |
|
190 |
|
|
191 |
} |
Also available in: Unified diff
test for cichorieae taxon profile & multipart extension for descriptionElements & NamePage test