Revision adfb51b3
Added by Andreas Kohlbecker over 11 years ago
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/flMalesiana/FloraMalesiana_OriginalSourceTest.java | ||
---|---|---|
15 | 15 |
import java.util.List; |
16 | 16 |
import java.util.UUID; |
17 | 17 |
|
18 |
import org.apache.log4j.Level; |
|
18 | 19 |
import org.junit.After; |
19 | 20 |
import org.junit.Before; |
20 | 21 |
import org.junit.Test; |
... | ... | |
43 | 44 |
@DataPortalContexts( { DataPortalContext.floramalesiana}) |
44 | 45 |
public class FloraMalesiana_OriginalSourceTest extends CdmDataPortalTestBase{ |
45 | 46 |
|
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 |
} |
|
47 |
private GenericPortalPage homePage; |
|
48 |
|
|
49 |
@Before |
|
50 |
public void setUp() throws Exception { |
|
51 |
|
|
52 |
driver.get(getContext().getBaseUri().toString()); |
|
53 |
homePage = new GenericPortalPage(driver, getContext()); |
|
54 |
} |
|
55 |
|
|
56 |
@After |
|
57 |
public void tearDown(){ |
|
58 |
logger.debug("@After"); |
|
59 |
} |
|
60 |
|
|
61 |
|
|
62 |
@Test |
|
63 |
public void Illicium() throws Exception { |
|
64 |
|
|
65 |
TaxonSearchResultPage searchResultPage = homePage.submitQuery("Illicium"); |
|
66 |
|
|
67 |
assertEquals(getContext().prepareTitle("Search results"), searchResultPage.getTitle()); |
|
68 |
|
|
69 |
logger.debug("getting first result entry"); |
|
70 |
TaxonListElement entryIillicium = searchResultPage.getResultItem(1); |
|
71 |
|
|
72 |
logger.debug("checking FullTaxonName of first entry: " + entryIillicium.getElement().toString()); |
|
73 |
assertEquals("Illicium L. in Syst. Nat. ed. 10: 1050. 1759", entryIillicium.getFullTaxonName()); |
|
74 |
|
|
75 |
logger.debug("clicking TaxonName" + entryIillicium.getElement().toString()); |
|
76 |
TaxonProfilePage taxonProfileIillicium = searchResultPage.clickTaxonName(entryIillicium, TaxonProfilePage.class); |
|
77 |
|
|
78 |
// assertNull("Authorship information should be hidden", taxonProfileIillicium.getAuthorInformationText()); // FF WebDriver hangs here |
|
79 |
|
|
80 |
List<LinkElement> primaryTabs = taxonProfileIillicium.getPrimaryTabs(); |
|
81 |
assertEquals("Expecting 4 tabs", 4, primaryTabs.size()); |
|
82 |
assertEquals("General", primaryTabs.get(0).getText()); |
|
83 |
assertEquals("Synonymy", primaryTabs.get(1).getText()); |
|
84 |
assertEquals("Specimens", primaryTabs.get(2).getText()); |
|
85 |
assertEquals("Keys", primaryTabs.get(3).getText()); |
|
86 |
|
|
87 |
} |
|
126 | 88 |
|
127 | 89 |
} |
Also available in: Unified diff
fixing #2987 (selenium test Illicium@floramalesiana(eu.etaxonomy.dataportal.selenium.tests.flMalesiana.FloraMalesiana_OriginalSourceTest) fails due to timeouts) and adapting code to selenium 2.26.0 in pom