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.flMalesiana;
|
10
|
|
11
|
import static org.junit.Assert.assertEquals;
|
12
|
|
13
|
import java.util.List;
|
14
|
import java.util.UUID;
|
15
|
|
16
|
import org.junit.After;
|
17
|
import org.junit.Before;
|
18
|
import org.junit.Ignore;
|
19
|
import org.junit.Test;
|
20
|
|
21
|
import eu.etaxonomy.dataportal.DataPortalContext;
|
22
|
import eu.etaxonomy.dataportal.elements.LinkElement;
|
23
|
import eu.etaxonomy.dataportal.elements.TaxonListElement;
|
24
|
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
|
25
|
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
|
26
|
import eu.etaxonomy.dataportal.pages.GenericPortalPage;
|
27
|
import eu.etaxonomy.dataportal.pages.TaxonProfilePage;
|
28
|
import eu.etaxonomy.dataportal.pages.TaxonSearchResultPage;
|
29
|
|
30
|
/**
|
31
|
*
|
32
|
* @author a.kohlbecker
|
33
|
*
|
34
|
*/
|
35
|
|
36
|
@DataPortalContexts( { DataPortalContext.floramalesiana})
|
37
|
public class FloraMalesiana_OriginalSourceTest extends CdmDataPortalTestBase{
|
38
|
|
39
|
private static final UUID UUID_ILLICIUM = UUID.fromString("502e28ca-23d0-44a8-9c13-85fb3d076bff");
|
40
|
|
41
|
private GenericPortalPage homePage;
|
42
|
|
43
|
@Before
|
44
|
public void setUp() throws Exception {
|
45
|
|
46
|
driver.get(getContext().getBaseUri().toString());
|
47
|
homePage = new GenericPortalPage(driver, getContext());
|
48
|
}
|
49
|
|
50
|
@After
|
51
|
public void tearDown(){
|
52
|
logger.debug("@After");
|
53
|
}
|
54
|
|
55
|
|
56
|
@Test
|
57
|
@Ignore // see #3788 (sort order of search results broken in free-text taxon search)
|
58
|
public void Illicium() throws Exception {
|
59
|
|
60
|
TaxonSearchResultPage searchResultPage = homePage.submitQuery("Illicium");
|
61
|
|
62
|
assertEquals(getContext().prepareTitle("Search results"), searchResultPage.getTitle());
|
63
|
|
64
|
logger.debug("getting first result entry");
|
65
|
TaxonListElement entryIillicium = searchResultPage.getResultItem(1);
|
66
|
|
67
|
logger.debug("checking FullTaxonName of first entry: " + entryIillicium.getElement().toString());
|
68
|
assertEquals("Illicium L. in Syst. Nat. ed. 10: 1050. 1759", entryIillicium.getFullTaxonName());
|
69
|
|
70
|
logger.debug("clicking TaxonName" + entryIillicium.getElement().toString());
|
71
|
TaxonProfilePage taxonProfileIillicium = searchResultPage.clickTaxonName(entryIillicium, TaxonProfilePage.class, UUID_ILLICIUM);
|
72
|
|
73
|
// assertNull("Authorship information should be hidden", taxonProfileIillicium.getAuthorInformationText()); // FF WebDriver hangs here
|
74
|
|
75
|
List<LinkElement> primaryTabs = taxonProfileIillicium.getPrimaryTabs();
|
76
|
|
77
|
assertEquals("Expecting 4 tabs", 4, primaryTabs.size());
|
78
|
assertEquals("General\n(active tab)", primaryTabs.get(0).getText());
|
79
|
assertEquals("Synonymy", primaryTabs.get(1).getText());
|
80
|
assertEquals("Images", primaryTabs.get(2).getText());
|
81
|
assertEquals("Keys", primaryTabs.get(3).getText());
|
82
|
|
83
|
}
|
84
|
|
85
|
}
|