Project

General

Profile

Download (5.5 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
    String titleSuffix = " | Integration test reference";
42

    
43
    @Before
44
    public void setUp() throws Exception {
45
        driver.get(getContext().getBaseUri().toString());
46
    }
47

    
48

    
49
    @Test
50
    public void testNodosilinea_sensensia_RegPage() throws MalformedURLException, UnsupportedEncodingException{
51

    
52
        RegistrationPage p = new RegistrationPage(driver, getContext(), reg_nodosilinea_sensensia_id);
53

    
54
        assertEquals("Registration Id: http://testbank.org/100009" + titleSuffix, driver.getTitle());
55
        RegistrationItemFull regItem = p.getRegistrationItem();
56
        assertNotNull(regItem);
57
        assertEquals(
58
                "Nodosilinea sensensia (Blanco) Heidari & Hauer ex Lem, Nonsens species of the developers Vol1",
59
                regItem.getNameElement().getText());
60
        assertEquals(
61
                "Lem, Nonsens species of the developers Vol1",
62
                regItem.getCitation().getText());
63

    
64
        List<BaseElement> nameRelationshipElements = regItem.getNameRelationsipsElements();
65
        assertEquals(5,  nameRelationshipElements.size());
66
        assertEquals("is new combination for Nepenthes alata Blanco, Fl. Filip., ed. 1: 805. 1837", nameRelationshipElements.get(0).getText());
67
        assertEquals("is new name for Nepenthes blancoi Blume in Mus. Bot. Lugd.-Bat. 2: 10. 1852", nameRelationshipElements.get(1).getText());
68
        assertEquals("is validating Nodosilinea radiophila Heidari & Hauer in Fottea 18(2): 142. fig. 5C, D. 1.11.20181", nameRelationshipElements.get(2).getText());
69
        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());
70
        BaseElement orthVarElement = nameRelationshipElements.get(4);
71
        assertEquals("orth. var. Nodosilinea sensensi2, 3", orthVarElement.getText());
72
        assertEquals("has orthographic variant", orthVarElement.getElement().findElement(By.className("symbol")).getAttribute("title"));
73

    
74
        List<BaseElement> nameRelationshipFootnotes = regItem.getNameRelationsipFootnotes();
75
        assertEquals(3, nameRelationshipFootnotes.size());
76
        assertEquals("1. Art.99.9 Turland, Wiersema, Barrie, Greuter, D.Hawksw., Herend., S.Knapp, Kusber, D.Z.Li, Marhold, T.W.May, McNeill, A.M.Monro, J.Prado, M.J.Price & Gideon F.Sm., International Code of Nomenclature for algae, fungi, and plants (Shenzhen Code) adopted by the Nineteenth International Botanical Congress Shenzhen, China, July 2017:22", nameRelationshipFootnotes .get(0).getText());
77
        assertEquals("2. Art. 88.9 Turland, Wiersema, Barrie, Greuter, D.Hawksw., Herend., S.Knapp, Kusber, D.Z.Li, Marhold, T.W.May, McNeill, A.M.Monro, J.Prado, M.J.Price & Gideon F.Sm., International Code of Nomenclature for algae, fungi, and plants (Shenzhen Code) adopted by the Nineteenth International Botanical Congress Shenzhen, China, July 2017:33", nameRelationshipFootnotes .get(1).getText());
78
        assertEquals("3. Lem, Nonsens species of the developers Vol1", nameRelationshipFootnotes .get(2).getText());
79

    
80
    }
81

    
82
    @Test
83
    public void testNodosilinea_sensensia_SynonymPage() throws MalformedURLException, UnsupportedEncodingException {
84

    
85
        TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), taxon_nodosilinea_sensensia_uuid);
86

    
87
        WebElement accName = p.getAcceptedName();
88
        assertEquals("Nodosilinea sensensia (Blanco) Heidari & Hauer ex Lem, Nonsens species of the developers Vol1\n[non Nodosilinea sensensia nec Nodosilinea sensensia nec Nodosilinea blockensis orth. var. Nodosilinea sensensi1, 2 ]", accName.getText());
89

    
90
        List<BaseElement> footnotes = p.getHomotypicalGroupFootNotes();
91
        assertEquals("1. Art. 88.9 Turland, Wiersema, Barrie, Greuter, D.Hawksw., Herend., S.Knapp, Kusber, D.Z.Li, Marhold, T.W.May, McNeill, A.M.Monro, J.Prado, M.J.Price & Gideon F.Sm., International Code of Nomenclature for algae, fungi, and plants (Shenzhen Code) adopted by the Nineteenth International Botanical Congress Shenzhen, China, July 2017:33", footnotes.get(0).getText());
92
        assertEquals("2. Lem, Nonsens species of the developers Vol1", footnotes.get(1).getText());
93

    
94
    }
95

    
96
}
(3-3/4)