1
|
/**
|
2
|
* Copyright (C) 2009 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.cyprus;
|
10
|
|
11
|
import java.net.MalformedURLException;
|
12
|
import java.util.List;
|
13
|
import java.util.UUID;
|
14
|
|
15
|
import org.junit.After;
|
16
|
import org.junit.Before;
|
17
|
import org.junit.Test;
|
18
|
|
19
|
import eu.etaxonomy.dataportal.DataPortalContext;
|
20
|
import eu.etaxonomy.dataportal.elements.FeatureBlock;
|
21
|
import eu.etaxonomy.dataportal.elements.LinkElement;
|
22
|
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
|
23
|
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
|
24
|
import eu.etaxonomy.dataportal.pages.TaxonProfilePage;
|
25
|
|
26
|
/**
|
27
|
* @author a.kohlbecker
|
28
|
*
|
29
|
*/
|
30
|
|
31
|
@DataPortalContexts( { DataPortalContext.cyprus })
|
32
|
public class Bassia_indica_TaxonProfileTest extends CdmDataPortalTestBase{
|
33
|
|
34
|
static UUID taxonUuid = UUID.fromString("5250a30a-9e6f-4f2f-9663-93127a1a3829");
|
35
|
|
36
|
TaxonProfilePage p = null;
|
37
|
|
38
|
@Before
|
39
|
public void setUp() throws MalformedURLException {
|
40
|
|
41
|
p = new TaxonProfilePage(driver, getContext(), taxonUuid);
|
42
|
|
43
|
}
|
44
|
|
45
|
@After
|
46
|
public void tearDown(){
|
47
|
logger.debug("@After");
|
48
|
}
|
49
|
|
50
|
|
51
|
@Test
|
52
|
public void testPage() {
|
53
|
|
54
|
assertEquals(getContext().prepareTitle("Bassia indica"), p.getTitle());
|
55
|
assertNull("Authorship information should be hidden", p.getAuthorInformationText());
|
56
|
|
57
|
List<LinkElement> primaryTabs = p.getPrimaryTabs();
|
58
|
assertEquals("Expecting 2 tabs", 2, primaryTabs.size());
|
59
|
assertEquals("General\n(active tab)", primaryTabs.get(0).getText());
|
60
|
assertEquals("Synonymy", primaryTabs.get(1).getText());
|
61
|
|
62
|
assertEquals("Content", p.getTableOfContentHeader());
|
63
|
List<LinkElement> links = p.getTableOfContentLinks();
|
64
|
assertNotNull("Expecting a list of TOC links in the profile page.", links);
|
65
|
p.testTableOfContentEntry(0, "Status", "status");
|
66
|
p.testTableOfContentEntry(1, "Endemism", "endemism");
|
67
|
p.testTableOfContentEntry(2, "Distribution", "distribution");
|
68
|
|
69
|
FeatureBlock featureBlock;
|
70
|
|
71
|
featureBlock = p.getFeatureBlockAt(0, "status", "div", "div");
|
72
|
assertEquals("Status\nNaturalized invasive (NA)", featureBlock.getText());
|
73
|
|
74
|
featureBlock = p.getFeatureBlockAt(1, "endemism", "div", "div");
|
75
|
assertEquals("Endemism\nnot endemic", featureBlock.getText());
|
76
|
|
77
|
featureBlock = p.getFeatureBlockAt(2, "distribution", "div", "span");
|
78
|
|
79
|
assertEquals("Distribution\n"
|
80
|
+ "Division 4A\n"
|
81
|
+ "Division 5B\n"
|
82
|
+ "Division 6C\n"
|
83
|
+ "The record for division 5 may refer to division 6.\nA. J. Chrtek & B. Slavík, Contribution to the flora of Cyprus. 4. in Fl. Medit. 10. 2001, B. A. Della & G. Iatrou, New plant records from Cyprus in Kew Bull. 50. 1995, C. R. Hand, Supplementary notes to the flora of Cyprus III. in Willdenowia 33. 2003", featureBlock.getText());
|
84
|
assertEquals("Distribution", featureBlock.getHeader());
|
85
|
assertEquals("expecting two footnote keys", 3, featureBlock.countFootNoteKeys());
|
86
|
|
87
|
// ------- prepared for bibliography ---------
|
88
|
// FeatureBlock bibliography = p.getFeatureBlockAt(5, "bibliography", "div", "div");
|
89
|
// List<BaseElement> bibliographyEntries = bibliography.getFootNotes();
|
90
|
// assertEquals("A. R. D. Meikle, Flora of Cyprus 2. 1985", bibliographyEntries.get(1));
|
91
|
// assertEquals("B. R. Hand, Supplementary notes to the flora of Cyprus VI. in Willdenowia 39. 2009", bibliographyEntries.get(1));
|
92
|
|
93
|
|
94
|
}
|
95
|
|
96
|
}
|