Project

General

Profile

Download (3.52 KB) Statistics
| Branch: | Tag: | Revision:
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.cichorieae;
11

    
12
import static org.junit.Assert.assertEquals;
13
import static org.junit.Assert.assertFalse;
14
import static org.junit.Assert.assertTrue;
15

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

    
20
import org.junit.Test;
21

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

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

    
36
@DataPortalContexts( { DataPortalContext.cichorieae })
37
public class Cichorieae_TechnicalAnnnotationsTest extends CdmDataPortalTestBase{
38

    
39

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

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

    
44

    
45
    @Test
46
    public void soroseris_hookeriana() throws MalformedURLException {
47
        TaxonProfilePage p = new TaxonProfilePage(driver, getContext(), soroseris_hookeriana_uuid);
48
        String expectedName = "Soroseris hookeriana";
49
        assertEquals(getContext().prepareTitle(expectedName), p.getTitle());
50

    
51
        List<LinkElement> tocLinks = p.getTableOfContentLinks();
52
        // Description mus not be included !!!
53
        assertEquals("Distribution", tocLinks.get(0).getText());
54
        assertEquals("Credits", tocLinks.get(1).getText());
55

    
56
        // Credits contains an technical annotation but this must not be displayed
57
        FeatureBlock creditsBlock = p.getFeatureBlockAt(1, "credits", "div", "div");
58
        //testing this is not possible due to SCHROTT-CODE // assertEquals("expecting 1 DescriptionElements in citation", 1, creditsBlock.getDescriptionElements().size());
59
        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).", creditsBlock.getText());
60
        assertFalse("expecting no footnoteKeys", creditsBlock.hasFootNoteKeys());
61
        assertFalse("expecting no footnotes", creditsBlock.hasFootNotes());
62
    }
63

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

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

    
78
}
(6-6/12)