Project

General

Profile

Download (3.71 KB) Statistics
| Branch: | Tag: | Revision:
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 static org.junit.Assert.assertEquals;
12
import static org.junit.Assert.assertNotNull;
13
import static org.junit.Assert.assertNull;
14

    
15
import java.net.MalformedURLException;
16
import java.util.List;
17
import java.util.UUID;
18

    
19
import org.junit.After;
20
import org.junit.Before;
21
import org.junit.Test;
22

    
23
import eu.etaxonomy.dataportal.DataPortalContext;
24
import eu.etaxonomy.dataportal.elements.FeatureBlock;
25
import eu.etaxonomy.dataportal.elements.LinkElement;
26
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
27
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
28
import eu.etaxonomy.dataportal.pages.TaxonProfilePage;
29

    
30
/**
31
 * @author a.kohlbecker
32
 *
33
 */
34

    
35
@DataPortalContexts( { DataPortalContext.cyprus })
36
public class Bassia_indica_TaxonProfileTest extends CdmDataPortalTestBase{
37

    
38
    static UUID taxonUuid = UUID.fromString("5250a30a-9e6f-4f2f-9663-93127a1a3829");
39

    
40
    TaxonProfilePage p = null;
41

    
42
    @Before
43
    public void setUp() throws MalformedURLException {
44

    
45
        p = new TaxonProfilePage(driver, getContext(), taxonUuid);
46

    
47
    }
48

    
49
    @After
50
    public void tearDown(){
51
        logger.debug("@After");
52
    }
53

    
54

    
55
    @Test
56
    public void testPage() {
57

    
58
        assertEquals(getContext().prepareTitle("Bassia indica"), p.getTitle());
59
        assertNull("Authorship information should be hidden", p.getAuthorInformationText());
60

    
61
        List<LinkElement> primaryTabs = p.getPrimaryTabs();
62
        assertEquals("Expecting 2 tabs", 2, primaryTabs.size());
63
        assertEquals("General\n(active tab)", primaryTabs.get(0).getText());
64
        assertEquals("Synonymy", primaryTabs.get(1).getText());
65

    
66
        assertEquals("Content", p.getTableOfContentHeader());
67
        List<LinkElement> links = p.getTableOfContentLinks();
68
        assertNotNull("Expecting a list of TOC links in the profile page.", links);
69
        p.testTableOfContentEntry(0, "Status", "status");
70
        p.testTableOfContentEntry(1, "Endemism", "endemism");
71
        p.testTableOfContentEntry(2, "Distribution", "distribution");
72

    
73
        FeatureBlock featureBlock;
74

    
75
        featureBlock = p.getFeatureBlockAt(0, "status", "div", "div");
76
        assertEquals("Status\nNaturalized invasive (NA)", featureBlock.getText());
77

    
78
        featureBlock = p.getFeatureBlockAt(1, "endemism", "div", "div");
79
        assertEquals("Endemism\nnot endemic", featureBlock.getText());
80

    
81
        featureBlock = p.getFeatureBlockAt(2, "distribution", "div", "span");
82

    
83
        assertEquals("Distribution\nDivision 4A Division 5B Division 6C\nThe 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
}
(2-2/6)