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().getBaseUri().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
|
"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.11.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
|
|
95
|
@Test
|
96
|
public void testNodosilinea_sensensia_SynonymPage() throws MalformedURLException, UnsupportedEncodingException {
|
97
|
|
98
|
TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), taxon_nodosilinea_sensensia_uuid);
|
99
|
|
100
|
WebElement accName = p.getAcceptedName();
|
101
|
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());
|
102
|
|
103
|
List<BaseElement> footnotes = p.getHomotypicalGroupFootNotes();
|
104
|
assertEquals(3, footnotes.size());
|
105
|
assertEquals(
|
106
|
"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",
|
107
|
footnotes .get(0).getText());
|
108
|
assertEquals(
|
109
|
"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",
|
110
|
footnotes.get(1).getText());
|
111
|
assertEquals(
|
112
|
"3. Lem, Nonsens species of the developers Vol1. 2001",
|
113
|
footnotes.get(2).getText());
|
114
|
|
115
|
|
116
|
}
|
117
|
|
118
|
/**
|
119
|
* Test for https://dev.e-taxonomy.eu/redmine/issues/5697
|
120
|
*
|
121
|
* @throws MalformedURLException
|
122
|
* @throws UnsupportedEncodingException
|
123
|
*/
|
124
|
@Test
|
125
|
public void testIssue5697() throws MalformedURLException, UnsupportedEncodingException {
|
126
|
|
127
|
TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), taxon_bulbostylis_pauciflora_uuid);
|
128
|
|
129
|
WebElement accName = p.getAcceptedName();
|
130
|
assertEquals("Bulbostylis pauciflora (Liebm.) C. B. Clarke, nom. cons. [non Bulbostylis pauciflora (Kunth) D.C.]", accName.getText());
|
131
|
assertEquals("is conserved against", accName.findElement(By.className("symbol")).getAttribute("title"));
|
132
|
|
133
|
}
|
134
|
|
135
|
/**
|
136
|
* Test for https://dev.e-taxonomy.eu/redmine/issues/6523
|
137
|
*/
|
138
|
@Test
|
139
|
public void testIssue6523() throws MalformedURLException, UnsupportedEncodingException {
|
140
|
|
141
|
TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), taxon_nepenthes_gracilis_uuid);
|
142
|
|
143
|
WebElement accName = p.getAcceptedName();
|
144
|
assertEquals("Nepenthes gracilis Korth., Verh. Nat. Gesch. Ned. Bezitt., Bot. 19: 22, t. 1 & 4. 1840", accName.getText());
|
145
|
|
146
|
WebElement synonym1 = p.getHeterotypicalGroupSynonym(1, 1);
|
147
|
assertEquals("=\nNepenthes teysmanniana Miq., Fl. Ned. Ind. 1(1): 1073. 1858", synonym1.getText());
|
148
|
WebElement synonym2 = p.getHeterotypicalGroupSynonym(1, 2);
|
149
|
assertEquals("≡\nNepenthes tupmanniana Bonstedt in Parey Blumeng. 1: 663. 1931 [non Nepenthes teysmanniana Miq., Fl. Ned. Ind. 1(1): 1073. 1858]", synonym2.getText());
|
150
|
assertEquals("is misspelling for", synonym2.findElement(By.className("symbol")).getAttribute("title"));
|
151
|
|
152
|
}
|
153
|
|
154
|
}
|