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
|
String titleSuffix = " | Integration test reference";
|
44
|
|
45
|
@Before
|
46
|
public void setUp() throws Exception {
|
47
|
driver.get(getContext().getBaseUri().toString());
|
48
|
}
|
49
|
|
50
|
|
51
|
@Test
|
52
|
public void testNodosilinea_sensensia_RegPage() throws MalformedURLException, UnsupportedEncodingException{
|
53
|
|
54
|
RegistrationPage p = new RegistrationPage(driver, getContext(), reg_nodosilinea_sensensia_id);
|
55
|
|
56
|
assertEquals("Registration Id: http://testbank.org/100009" + titleSuffix, driver.getTitle());
|
57
|
RegistrationItemFull regItem = p.getRegistrationItem();
|
58
|
assertNotNull(regItem);
|
59
|
assertEquals(
|
60
|
"Nodosilinea sensensia (Blanco) Heidari & Hauer ex Lem, Nonsens species of the developers Vol1",
|
61
|
regItem.getNameElement().getText());
|
62
|
assertEquals(
|
63
|
"Lem, Nonsens species of the developers Vol1",
|
64
|
regItem.getCitation().getText());
|
65
|
|
66
|
List<BaseElement> nameRelationshipElements = regItem.getNameRelationsipsElements();
|
67
|
assertEquals(5, nameRelationshipElements.size());
|
68
|
assertEquals("is new combination for Nepenthes alata Blanco, Fl. Filip., ed. 1: 805. 1837", nameRelationshipElements.get(0).getText());
|
69
|
assertEquals("is new name for Nepenthes blancoi Blume in Mus. Bot. Lugd.-Bat. 2: 10. 1852", nameRelationshipElements.get(1).getText());
|
70
|
assertEquals("is validating Nodosilinea radiophila Heidari & Hauer in Fottea 18(2): 142. fig. 5C, D. 1.11.20181", nameRelationshipElements.get(2).getText());
|
71
|
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());
|
72
|
BaseElement orthVarElement = nameRelationshipElements.get(4);
|
73
|
assertEquals("orth. var. Nodosilinea sensensi2, 3", orthVarElement.getText());
|
74
|
assertEquals("has orthographic variant", orthVarElement.getElement().findElement(By.className("symbol")).getAttribute("title"));
|
75
|
|
76
|
List<BaseElement> nameRelationshipFootnotes = regItem.getNameRelationsipFootnotes();
|
77
|
assertEquals(3, nameRelationshipFootnotes.size());
|
78
|
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());
|
79
|
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());
|
80
|
assertEquals("3. Lem, Nonsens species of the developers Vol1", nameRelationshipFootnotes .get(2).getText());
|
81
|
|
82
|
}
|
83
|
|
84
|
@Test
|
85
|
public void testNodosilinea_sensensia_SynonymPage() throws MalformedURLException, UnsupportedEncodingException {
|
86
|
|
87
|
TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), taxon_nodosilinea_sensensia_uuid);
|
88
|
|
89
|
WebElement accName = p.getAcceptedName();
|
90
|
assertEquals("Nodosilinea sensensia (Blanco) Heidari & Hauer ex Lem, Nonsens species of the developers Vol1 [non Nodosilinea sensensia nec Nodosilinea sensensia nec Nodosilinea blockensis orth. var. Nodosilinea sensensi1, 2 ]", accName.getText());
|
91
|
|
92
|
List<BaseElement> footnotes = p.getHomotypicalGroupFootNotes();
|
93
|
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());
|
94
|
assertEquals("2. Lem, Nonsens species of the developers Vol1", footnotes.get(1).getText());
|
95
|
|
96
|
}
|
97
|
|
98
|
/**
|
99
|
* Test for https://dev.e-taxonomy.eu/redmine/issues/5697
|
100
|
*
|
101
|
* @throws MalformedURLException
|
102
|
* @throws UnsupportedEncodingException
|
103
|
*/
|
104
|
@Test
|
105
|
public void testIssue5697() throws MalformedURLException, UnsupportedEncodingException {
|
106
|
|
107
|
TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), taxon_bulbostylis_pauciflora_uuid);
|
108
|
|
109
|
WebElement accName = p.getAcceptedName();
|
110
|
assertEquals("Bulbostylis pauciflora (Liebm.) C. B. Clarke, nom. cons. [non Bulbostylis pauciflora (Kunth) D.C. ]", accName.getText());
|
111
|
assertEquals("is conserved against", accName.findElement(By.className("symbol")).getAttribute("title"));
|
112
|
|
113
|
}
|
114
|
|
115
|
}
|