Project

General

Profile

Download (3.04 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.reference;
10

    
11
import java.util.UUID;
12

    
13
import org.junit.Before;
14
import org.junit.Test;
15
import org.openqa.selenium.By;
16
import org.openqa.selenium.WebElement;
17

    
18
import eu.etaxonomy.dataportal.DataPortalSite;
19
import eu.etaxonomy.dataportal.elements.BaseElement;
20
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
21
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
22
import eu.etaxonomy.dataportal.pages.TaxonSynonymyPage;
23

    
24
/**
25
 * Issues to be covered by this TestClass:
26
 *
27
 * #9265
28
 *
29
 * @author a.kohlbecker
30
 *
31
 */
32

    
33
@DataPortalContexts( { DataPortalSite.reference })
34
public class NomenclaturalSourceTest extends CdmDataPortalTestBase{
35

    
36
    static final UUID taxon_nepenthes_gracilis_uuid = UUID.fromString("5d9af5a8-c8ad-45e8-85df-ce6a01011fb9");
37

    
38
    TaxonSynonymyPage p = null;
39

    
40
    @Before
41
    public void setUp() throws Exception {
42
        driver.get(getContext().getSiteUri().toString());
43
        if(p == null) {
44
            p = new TaxonSynonymyPage(driver, getContext(), taxon_nepenthes_gracilis_uuid);
45
        }
46
    }
47

    
48
    @Test
49
    public void testNomenclaturalReference() {
50

    
51
        WebElement acceptedName = p.getAcceptedName();
52
        assertEquals("Nepenthes gracilis Korth., Verh. Nat. Gesch. Ned. Bezitt., Bot. 19: 22, t. 1 & 4. 1840", acceptedName.getText());
53
        WebElement referenceElement = acceptedName.findElement(By.cssSelector(".reference"));
54
        assertEquals("Verh. Nat. Gesch. Ned. Bezitt., Bot. 19: 22, t. 1 & 4. 1840", referenceElement.getText());
55
    }
56

    
57
    @Test
58
    public void testProtologueAcceptedName() {
59

    
60
        WebElement acceptedName = p.getAcceptedName();
61
        BaseElement protologueElement = new BaseElement(acceptedName.findElement(By.cssSelector(".protologue")));
62
        assertEquals(1, protologueElement.getLinksInElement().size());
63
        assertEquals("http://media.test/protologue/1234", protologueElement.getLinksInElement().get(0).getUrl());
64
    }
65

    
66
    @Test
67
    public void testProtologueHeterotypicSynonym() {
68

    
69
        WebElement synonym = p.getHeterotypicalGroupSynonym(1, 1);
70
        BaseElement protologueElement = new BaseElement(synonym.findElement(By.cssSelector(".protologue")));
71
        assertEquals(1, protologueElement.getLinksInElement().size());
72
        assertEquals("http://media.test/protologue/5678", protologueElement.getLinksInElement().get(0).getUrl());
73
    }
74

    
75
    @Test
76
    public void testProtologueHopmotypicSynonym() {
77

    
78
        WebElement synonym = p.getHeterotypicalGroupSynonym(1, 2);
79
        BaseElement protologueElement = new BaseElement(synonym.findElement(By.cssSelector(".protologue")));
80
        assertEquals(1, protologueElement.getLinksInElement().size());
81
        assertEquals("http://media.test/98765", protologueElement.getLinksInElement().get(0).getUrl());
82
    }
83

    
84
}
(9-9/15)