Project

General

Profile

Download (3.52 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.cichorieae;
10

    
11
import java.net.MalformedURLException;
12
import java.util.List;
13
import java.util.UUID;
14

    
15
import org.junit.Test;
16

    
17
import eu.etaxonomy.dataportal.DataPortalSite;
18
import eu.etaxonomy.dataportal.elements.FeatureBlock;
19
import eu.etaxonomy.dataportal.elements.LinkElement;
20
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
21
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
22
import eu.etaxonomy.dataportal.pages.TaxonProfilePage;
23
import eu.etaxonomy.dataportal.pages.TaxonSynonymyPage;
24

    
25
/**
26
 *
27
 * @author a.kohlbecker
28
 *
29
 */
30

    
31
@DataPortalContexts( { DataPortalSite.cichorieae })
32
public class Cichorieae_TechnicalAnnnotationsTest extends CdmDataPortalTestBase{
33

    
34

    
35
    static UUID soroseris_hookeriana_uuid = UUID.fromString("adaabef1-02f9-41a4-8a39-bf13564559f7");
36

    
37
    static UUID pilosella_uuid = UUID.fromString("f42a07d1-d959-4838-b8ea-192b523ad5cc");
38

    
39

    
40
    @Test
41
    public void soroseris_hookeriana() throws MalformedURLException {
42
        TaxonProfilePage p = new TaxonProfilePage(driver, getContext(), soroseris_hookeriana_uuid);
43
        String expectedName = "Soroseris hookeriana";
44
        assertEquals(getContext().prepareTitle(expectedName), p.getTitle());
45

    
46
        List<LinkElement> tocLinks = p.getTableOfContentLinks();
47
        // Description mus not be included !!!
48
        assertEquals("Distribution", tocLinks.get(0).getText());
49
        assertEquals("Credits", tocLinks.get(1).getText());
50

    
51
        // Credits contains an technical annotation but this must not be displayed
52
        FeatureBlock creditsBlock = p.getFeatureBlockAt(1, "credits", "div", "div");
53
        //testing this is not possible due to SCHROTT-CODE // assertEquals("expecting 1 DescriptionElements in citation", 1, creditsBlock.getDescriptionElements().size());
54
        assertEquals("Credits\nBoufford D. E. 2009: Images (12 added)\nSmalla M. 2009: Images (1 added)\nSun H. 2009: Images (3 added)\nYue J. 2009: Images (1 added)\nZhang J. 2009: Images (1 added).\n" +
55
                "\n" +
56
                "1\n" +
57
                "1. This fact has been moved from Soroseris gillii (S. Moore) Stebbins to this taxon.", creditsBlock.getText());
58
        assertTrue("expecting 1 footnote keys", creditsBlock.hasFootNoteKeys());
59
        assertTrue("expecting no footnotes", creditsBlock.hasFootNotes());
60
    }
61

    
62
    @Test
63
    public void pilosella() throws MalformedURLException {
64
        TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), pilosella_uuid);
65
        String expectedName = "Pilosella";
66
        assertEquals(getContext().prepareTitle(expectedName), p.getTitle());
67

    
68
        assertEquals("Pilosella Vaill. in Königl. Akad. Wiss. Paris Phys. Abh. 5: 703. 17541", p.getAcceptedNameText());
69
        assertEquals("Expecting one footnote key", 1, p.getAcceptedNameFootNoteKeys().size());
70
        assertEquals("Expecting one footnote", 1, p.getHomotypicalGroupFootNotes().size());
71
        String expectetToStartWith = "1. As has been discovered by Greuter & al. in Taxon 54: 166 (2005),";
72
        assertTrue("Expecting footnote to start with: '" + expectetToStartWith + "' but was '" + p.getHomotypicalGroupFootNotes().get(0).getText() + "'"
73
                , p.getHomotypicalGroupFootNotes().get(0).getText().startsWith(expectetToStartWith));
74
    }
75

    
76
}
(7-7/13)