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.flMalesiana;
|
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.junit.After;
|
19
|
import org.junit.Before;
|
20
|
import org.junit.Test;
|
21
|
import org.openqa.selenium.By;
|
22
|
import org.openqa.selenium.WebElement;
|
23
|
|
24
|
import eu.etaxonomy.dataportal.DataPortalContext;
|
25
|
import eu.etaxonomy.dataportal.elements.BaseElement;
|
26
|
import eu.etaxonomy.dataportal.elements.FeatureBlock;
|
27
|
import eu.etaxonomy.dataportal.elements.ImgElement;
|
28
|
import eu.etaxonomy.dataportal.elements.LinkElement;
|
29
|
import eu.etaxonomy.dataportal.elements.TaxonListElement;
|
30
|
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
|
31
|
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
|
32
|
import eu.etaxonomy.dataportal.pages.GenericPortalPage;
|
33
|
import eu.etaxonomy.dataportal.pages.PortalPage;
|
34
|
import eu.etaxonomy.dataportal.pages.TaxonProfilePage;
|
35
|
import eu.etaxonomy.dataportal.pages.TaxonSearchResultPage;
|
36
|
|
37
|
/**
|
38
|
*
|
39
|
* @author a.kohlbecker
|
40
|
*
|
41
|
*/
|
42
|
|
43
|
@DataPortalContexts( { DataPortalContext.floramalesiana})
|
44
|
public class FloraMalesiana_OriginalSourceTest extends CdmDataPortalTestBase{
|
45
|
|
46
|
// Milichia speciosa
|
47
|
static UUID taxonUuid = UUID.fromString("1f1f8356-a172-4f7d-ad98-e8a37489ce9f");
|
48
|
|
49
|
TaxonProfilePage p = null;
|
50
|
|
51
|
private GenericPortalPage homePage;
|
52
|
|
53
|
@Before
|
54
|
public void setUp() throws Exception {
|
55
|
|
56
|
driver.get(getContext().getBaseUri().toString());
|
57
|
homePage = new GenericPortalPage(driver, getContext());
|
58
|
|
59
|
}
|
60
|
|
61
|
@After
|
62
|
public void tearDown(){
|
63
|
logger.debug("@After");
|
64
|
}
|
65
|
|
66
|
|
67
|
@Test
|
68
|
public void Illicium() throws Exception {
|
69
|
|
70
|
TaxonSearchResultPage searchResultPage = homePage.submitQuery("Illicium");
|
71
|
|
72
|
assertEquals(getContext().prepareTitle("Search results"), searchResultPage.getTitle());
|
73
|
|
74
|
TaxonListElement entryIillicium = searchResultPage.getResultItem(1);
|
75
|
|
76
|
assertEquals("Illicium L. in Syst. Nat. ed. 10: 1050. 1759", entryIillicium.getFullTaxonName());
|
77
|
|
78
|
PortalPage taxonProfileIillicium = searchResultPage.clickTaxonName(entryIillicium);
|
79
|
|
80
|
// assertNull("Authorship information should be hidden", p.getAuthorInformationText());
|
81
|
//
|
82
|
// List<LinkElement> primaryTabs = p.getPrimaryTabs();
|
83
|
// assertEquals("Expecting 3 tabs", 3, primaryTabs.size());
|
84
|
// assertEquals("General", primaryTabs.get(0).getText());
|
85
|
// assertEquals("Nomenclature", primaryTabs.get(1).getText());
|
86
|
// assertEquals("Specimens", primaryTabs.get(2).getText());
|
87
|
//
|
88
|
// assertEquals("Content", p.getTableOfContentHeader());
|
89
|
// List<LinkElement> tocLinks = p.getTableOfContentLinks();
|
90
|
// assertNotNull("Expecting a list of TOC links in the profile page.", tocLinks);
|
91
|
//
|
92
|
// p.testTableOfContentEntry(0, "Citations", "citation");
|
93
|
// p.testTableOfContentEntry(1, "Distribution", "distribution");
|
94
|
// p.testTableOfContentEntry(2, "Occurrence", "occurrence");
|
95
|
//
|
96
|
// FeatureBlock featureBlock = p.getFeatureBlockAt(0, "citation", "ul", "li");
|
97
|
// assertEquals("expecting no footnote keys", 0, featureBlock.getFootNoteKeys().size());
|
98
|
//
|
99
|
// List<WebElement> listElements = featureBlock.getElement().findElements(By.tagName("li"));
|
100
|
// assertEquals("Expecting 48 listElements tags in \"Citations\"", 48, listElements.size());
|
101
|
//
|
102
|
// // ---
|
103
|
// assertEquals("Argyrites speciosa (Meigen, 1830): Croatia", listElements.get(0).getText());
|
104
|
// List<WebElement> anchorTags = listElements.get(0).findElements(By.tagName("a"));
|
105
|
// assertEquals("Expecting one link", 1, anchorTags.size());
|
106
|
// assertTrue(anchorTags.get(0).getAttribute("href").endsWith("?q=cdm_dataportal/name/8d117f24-c9ba-44cd-bf9a-54f2b41e4a0f"));
|
107
|
//
|
108
|
// // ---
|
109
|
// assertEquals("Milichia speciosa Meigen, 1830: type information (Becker 1902: 314)", listElements.get(2).getText());
|
110
|
// anchorTags = listElements.get(2).findElements(By.tagName("a"));
|
111
|
// assertEquals("Expecting two links", 2, anchorTags.size());
|
112
|
// assertEquals("Milichia speciosa Meigen, 1830", anchorTags.get(0).getText());
|
113
|
// assertTrue(anchorTags.get(0).getAttribute("href").endsWith("?q=cdm_dataportal/name/031ab38f-54a7-4012-8595-31929a6f7f45"));
|
114
|
// assertEquals("Becker 1902", anchorTags.get(1).getText());
|
115
|
// assertTrue(anchorTags.get(1).getAttribute("href").endsWith("?q=cdm_dataportal/reference/96d55a98-4811-4ad9-94d2-a306a212070b"));
|
116
|
//
|
117
|
// // ---
|
118
|
// assertEquals("Milichia speciosa Meigen, 1830: checklist, Italy (Canzoneri & Gorodkov & Krivosheina & Munari & Nartshuk & Papp & Süss 1995: 25)", listElements.get(9).getText());
|
119
|
// anchorTags = listElements.get(9).findElements(By.tagName("a"));
|
120
|
// assertEquals("Expecting two links", 2, anchorTags.size());
|
121
|
// assertEquals("Milichia speciosa Meigen, 1830", anchorTags.get(0).getText());
|
122
|
// assertTrue(anchorTags.get(0).getAttribute("href").endsWith("?q=cdm_dataportal/name/031ab38f-54a7-4012-8595-31929a6f7f45"));
|
123
|
// assertEquals("Canzoneri & Gorodkov & Krivosheina & Munari & Nartshuk & Papp & Süss 1995", anchorTags.get(1).getText());
|
124
|
// assertTrue(anchorTags.get(1).getAttribute("href").endsWith("?q=cdm_dataportal/reference/338a6b6b-a26a-43e9-bf4a-6077b5a84668"));
|
125
|
}
|
126
|
|
127
|
}
|