Project

General

Profile

Download (7.93 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2019 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.io.UnsupportedEncodingException;
12
import java.net.MalformedURLException;
13
import java.util.List;
14
import java.util.UUID;
15

    
16
import org.junit.Before;
17
import org.junit.Test;
18
import org.openqa.selenium.By;
19
import org.openqa.selenium.WebElement;
20

    
21
import eu.etaxonomy.dataportal.DataPortalSite;
22
import eu.etaxonomy.dataportal.elements.BaseElement;
23
import eu.etaxonomy.dataportal.elements.RegistrationItemFull;
24
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
25
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
26
import eu.etaxonomy.dataportal.pages.RegistrationPage;
27
import eu.etaxonomy.dataportal.pages.TaxonSynonymyPage;
28

    
29
/**
30
 * @author a.kohlbecker
31
 * @since Feb 5, 2019
32
 *
33
 */
34
@DataPortalContexts( { DataPortalSite.reference })
35
public class NameRelationshipsTest extends CdmDataPortalTestBase {
36

    
37
    private static final String reg_nodosilinea_sensensia_id = "http://testbank.org/100009";
38

    
39
    private static final UUID taxon_nodosilinea_sensensia_uuid = UUID.fromString("7094ea13-2a95-46d9-bfca-8c0e0848e44c");
40

    
41
    private static final UUID taxon_bulbostylis_pauciflora_uuid = UUID.fromString("27f2ad59-0e11-44f4-a931-c69053260321");
42

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

    
45
    String titleSuffix = " | Integration test reference";
46

    
47
    @Before
48
    public void setUp() throws Exception {
49
        driver.get(getContext().getSiteUri().toString());
50
    }
51

    
52

    
53
    @Test
54
    public void testNodosilinea_sensensia_RegPage() throws MalformedURLException, UnsupportedEncodingException{
55

    
56
        RegistrationPage p = new RegistrationPage(driver, getContext(), reg_nodosilinea_sensensia_id);
57

    
58
        assertEquals("Registration Id: http://testbank.org/100009" + titleSuffix, driver.getTitle());
59
        RegistrationItemFull regItem = p.getRegistrationItem();
60
        assertNotNull(regItem);
61
        assertEquals(
62
                "Nodosilinea sensensia (Blanco) Heidari & Hauer ex Lem, Nonsens species of the developers Vol1. 2001, comb. nov.1",
63
                regItem.getNameElement().getText());
64
        assertEquals(
65
                "published in: Lem, Nonsens species of the developers Vol1. 2001",
66
                regItem.getCitation().getText());
67

    
68
        List<BaseElement> nameRelationshipElements = regItem.getNameRelationsipsElements();
69
        assertEquals(5,  nameRelationshipElements.size());
70
        assertEquals("is new combination for Nepenthes alata Blanco, Fl. Filip., ed. 1: 805. 1837", nameRelationshipElements.get(0).getText());
71
        assertEquals("is new name for Nepenthes blancoi Blume in Mus. Bot. Lugd.-Bat. 2: 10. 1852", nameRelationshipElements.get(1).getText());
72
        assertEquals("is validating2 Nodosilinea radiophila Heidari & Hauer in Fottea 18(2): 142. fig. 5C, D. 1 Nov 2018, nom. illeg.", nameRelationshipElements.get(2).getText());
73
        assertEquals("non Nodosilinea blockensis, New Species in the solar system nec Nodosilinea sensensia, Plantas vasculares de Oz nec Nodosilinea sensensia, Species solaris", nameRelationshipElements.get(3).getText());
74
        BaseElement orthVarElement = nameRelationshipElements.get(4);
75
        assertEquals("orth. var.3 Nodosilinea sensensi4", orthVarElement.getText());
76
        assertEquals("has orthographic variant", orthVarElement.getElement().findElement(By.className("symbol")).getAttribute("title"));
77

    
78
        List<BaseElement> footnotes = regItem.getRegistrationFootnotes();
79
        assertEquals(4, footnotes.size());
80
        assertEquals(
81
                "1. Art. 99.9 Turland, N.J., Wiersema, J.H., Barrie, F.R. & al., International Code of Nomenclature for algae, fungi, and plants (Shenzhen Code) adopted by the Nineteenth International Botanical Congress Shenzhen, China, July 2017: 11",
82
                footnotes .get(0).getText());
83
        assertEquals(
84
                "2. Art. 77.7 Turland, N.J., Wiersema, J.H., Barrie, F.R. & al., International Code of Nomenclature for algae, fungi, and plants (Shenzhen Code) adopted by the Nineteenth International Botanical Congress Shenzhen, China, July 2017: 22",
85
                footnotes .get(1).getText());
86
        assertEquals(
87
                "3. Art. 88.9 Turland, N.J., Wiersema, J.H., Barrie, F.R. & al., International Code of Nomenclature for algae, fungi, and plants (Shenzhen Code) adopted by the Nineteenth International Botanical Congress Shenzhen, China, July 2017: 33",
88
                footnotes .get(2).getText());
89
        assertEquals(
90
                "4. Lem, Nonsens species of the developers Vol1. 2001",
91
                footnotes .get(3).getText());
92
    }
93

    
94
    @Test
95
    public void testNodosilinea_sensensia_SynonymPage() throws MalformedURLException, UnsupportedEncodingException {
96

    
97
        TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), taxon_nodosilinea_sensensia_uuid);
98

    
99
        WebElement accName = p.getAcceptedName();
100
        assertEquals("Nodosilinea sensensia (Blanco) Heidari & Hauer ex Lem, Nonsens species of the developers Vol1. 2001, comb. nov.1 [non Nodosilinea sensensia nec Nodosilinea sensensia nec Nodosilinea blockensis orth. var.2 Nodosilinea sensensi3]", accName.getText());
101

    
102
        List<BaseElement> footnotes = p.getHomotypicalGroupFootNotes();
103
        assertEquals(3, footnotes.size());
104
        assertEquals(
105
                "1. Art. 99.9 Turland, N.J., Wiersema, J.H., Barrie, F.R. & al., International Code of Nomenclature for algae, fungi, and plants (Shenzhen Code) adopted by the Nineteenth International Botanical Congress Shenzhen, China, July 2017: 11",
106
                footnotes .get(0).getText());
107
        assertEquals(
108
                "2. Art. 88.9 Turland, N.J., Wiersema, J.H., Barrie, F.R. & al., International Code of Nomenclature for algae, fungi, and plants (Shenzhen Code) adopted by the Nineteenth International Botanical Congress Shenzhen, China, July 2017: 33",
109
                footnotes.get(1).getText());
110
        assertEquals(
111
                "3. Lem, Nonsens species of the developers Vol1. 2001",
112
                footnotes.get(2).getText());
113

    
114
    }
115

    
116
    /**
117
     * Test for https://dev.e-taxonomy.eu/redmine/issues/5697
118
     *
119
     * @throws MalformedURLException
120
     * @throws UnsupportedEncodingException
121
     */
122
    @Test
123
    public void testIssue5697() throws MalformedURLException, UnsupportedEncodingException {
124

    
125
        TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), taxon_bulbostylis_pauciflora_uuid);
126

    
127
        WebElement accName = p.getAcceptedName();
128
        assertEquals("Bulbostylis pauciflora (Liebm.) C. B. Clarke, nom. cons. [non Bulbostylis pauciflora (Kunth) D.C.]", accName.getText());
129
        assertEquals("is conserved against", accName.findElement(By.className("symbol")).getAttribute("title"));
130
    }
131

    
132
    /**
133
     * Test for https://dev.e-taxonomy.eu/redmine/issues/6523
134
     */
135
    @Test
136
    public void testIssue6523() throws MalformedURLException, UnsupportedEncodingException {
137

    
138
        TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), taxon_nepenthes_gracilis_uuid);
139

    
140
        WebElement accName = p.getAcceptedName();
141
        assertEquals("Nepenthes gracilis Korth., Verh. Nat. Gesch. Ned. Bezitt., Bot. 19: 22, t. 1 & 4. 1840", accName.getText());
142

    
143
        WebElement synonym1 = p.getHeterotypicalGroupSynonym(1, 1);
144
        assertEquals("=\nNepenthes teysmanniana Miq., Fl. Ned. Ind. 1(1): 1073. 1858", synonym1.getText());
145
        WebElement synonym2 = p.getHeterotypicalGroupSynonym(1, 2);
146
        assertEquals("≡\nNepenthes tupmanniana Bonstedt in Parey Blumeng. 1: 663. 1931 [non Nepenthes teysmanniana Miq., Fl. Ned. Ind. 1(1): 1073. 1858]", synonym2.getText());
147
        assertEquals("is misspelling for", synonym2.findElement(By.className("symbol")).getAttribute("title"));
148
    }
149

    
150
}
(7-7/10)