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.apache.log4j.Level;
|
19
|
import org.junit.After;
|
20
|
import org.junit.Before;
|
21
|
import org.junit.Test;
|
22
|
import org.openqa.selenium.By;
|
23
|
import org.openqa.selenium.WebElement;
|
24
|
|
25
|
import eu.etaxonomy.dataportal.DataPortalContext;
|
26
|
import eu.etaxonomy.dataportal.elements.BaseElement;
|
27
|
import eu.etaxonomy.dataportal.elements.FeatureBlock;
|
28
|
import eu.etaxonomy.dataportal.elements.ImgElement;
|
29
|
import eu.etaxonomy.dataportal.elements.LinkElement;
|
30
|
import eu.etaxonomy.dataportal.elements.TaxonListElement;
|
31
|
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
|
32
|
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
|
33
|
import eu.etaxonomy.dataportal.pages.GenericPortalPage;
|
34
|
import eu.etaxonomy.dataportal.pages.PortalPage;
|
35
|
import eu.etaxonomy.dataportal.pages.TaxonProfilePage;
|
36
|
import eu.etaxonomy.dataportal.pages.TaxonSearchResultPage;
|
37
|
|
38
|
/**
|
39
|
*
|
40
|
* @author a.kohlbecker
|
41
|
*
|
42
|
*/
|
43
|
|
44
|
@DataPortalContexts( { DataPortalContext.floramalesiana})
|
45
|
public class FloraMalesiana_OriginalSourceTest extends CdmDataPortalTestBase{
|
46
|
|
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
|
}
|
88
|
|
89
|
}
|