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,2",
|
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 validating3 Nodosilinea radiophila Heidari & Hauer in Fottea 18(2): 142. fig. 5C, D. 1 Nov 2018, nom. illeg.4", nameRelationshipElements.get(2).getText());
|
73
|
assertEquals("non Nodosilinea blockensis, New Species in the solar system5 nec Nodosilinea sensensia, Plantas vasculares de Oz6 nec Nodosilinea sensensia, Species solaris7", nameRelationshipElements.get(3).getText());
|
74
|
BaseElement orthVarElement = nameRelationshipElements.get(4);
|
75
|
assertEquals("orth. var.8 Nodosilinea sensensi9", orthVarElement.getText());
|
76
|
assertEquals("has orthographic variant", orthVarElement.getElement().findElement(By.className("symbol")).getAttribute("title"));
|
77
|
|
78
|
List<BaseElement> footnotes = regItem.getRegistrationFootnotes();
|
79
|
assertEquals(9, 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. Editorial annotation on Nodosilinea sensensia (Blanco) Heidari & Hauer ex Lem",
|
85
|
footnotes .get(1).getText());
|
86
|
assertEquals(
|
87
|
"3. 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",
|
88
|
footnotes .get(2).getText());
|
89
|
assertEquals(
|
90
|
"4. Editorial note on Nodosilinea radiophila",
|
91
|
footnotes .get(3).getText());
|
92
|
assertEquals(
|
93
|
"5. Editorial annotation on Nodosilinea blockensis, New Species in the solar system",
|
94
|
footnotes .get(4).getText());
|
95
|
assertEquals(
|
96
|
"6. Editorial annotation on Nodosilinea sensensia, Plantas vasculares de Oz",
|
97
|
footnotes .get(5).getText());
|
98
|
assertEquals(
|
99
|
"7. Editorial annotation on Nodosilinea sensensia, Species solaris",
|
100
|
footnotes .get(6).getText());
|
101
|
assertEquals(
|
102
|
"8. 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",
|
103
|
footnotes .get(7).getText());
|
104
|
assertEquals(
|
105
|
"9. Editorial annotation on Nodosilinea sensensi",
|
106
|
footnotes .get(8).getText());
|
107
|
|
108
|
}
|
109
|
|
110
|
@Test
|
111
|
public void testNodosilinea_sensensia_SynonymPage() throws MalformedURLException {
|
112
|
|
113
|
TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), taxon_nodosilinea_sensensia_uuid);
|
114
|
|
115
|
WebElement accName = p.getAcceptedName();
|
116
|
assertEquals("Nodosilinea sensensia (Blanco) Heidari & Hauer ex Lem, Nonsens species of the developers Vol1. 2001, comb. nov.1,2 [non Nodosilinea sensensia3 "
|
117
|
+ "nec Nodosilinea sensensia4 nec Nodosilinea blockensis5 orth. var.6 Nodosilinea sensensi7]", accName.getText());
|
118
|
|
119
|
List<BaseElement> footnotes = p.getHomotypicalGroupFootNotes();
|
120
|
assertEquals(7, footnotes.size());
|
121
|
assertEquals(
|
122
|
"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",
|
123
|
footnotes .get(0).getText());
|
124
|
assertEquals(
|
125
|
"2. Editorial annotation on Nodosilinea sensensia (Blanco) Heidari & Hauer ex Lem",
|
126
|
footnotes.get(1).getText());
|
127
|
assertEquals(
|
128
|
"3. Editorial annotation on Nodosilinea sensensia, Plantas vasculares de Oz",
|
129
|
footnotes.get(2).getText());
|
130
|
assertEquals(
|
131
|
"4. Editorial annotation on Nodosilinea sensensia, Species solaris",
|
132
|
footnotes.get(3).getText());
|
133
|
assertEquals(
|
134
|
"5. Editorial annotation on Nodosilinea blockensis, New Species in the solar system",
|
135
|
footnotes.get(4).getText());
|
136
|
assertEquals(
|
137
|
"6. 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",
|
138
|
footnotes.get(5).getText());
|
139
|
assertEquals(
|
140
|
"7. Editorial annotation on Nodosilinea sensensi",
|
141
|
footnotes.get(6).getText());
|
142
|
|
143
|
}
|
144
|
|
145
|
/**
|
146
|
* Test for https://dev.e-taxonomy.eu/redmine/issues/5697
|
147
|
*/
|
148
|
@Test
|
149
|
public void testIssue5697() throws MalformedURLException {
|
150
|
|
151
|
TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), taxon_bulbostylis_pauciflora_uuid);
|
152
|
|
153
|
WebElement accName = p.getAcceptedName();
|
154
|
assertEquals("Bulbostylis pauciflora (Liebm.) C. B. Clarke, nom. cons. [non Bulbostylis pauciflora (Kunth) D.C.]", accName.getText());
|
155
|
assertEquals("is conserved against", accName.findElement(By.className("symbol")).getAttribute("title"));
|
156
|
}
|
157
|
|
158
|
/**
|
159
|
* Test for https://dev.e-taxonomy.eu/redmine/issues/6523
|
160
|
*/
|
161
|
@Test
|
162
|
public void testIssue6523() throws MalformedURLException {
|
163
|
|
164
|
TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), taxon_nepenthes_gracilis_uuid);
|
165
|
|
166
|
WebElement accName = p.getAcceptedName();
|
167
|
assertEquals("Nepenthes gracilis Korth., Verh. Nat. Gesch. Ned. Bezitt., Bot. 19: 22, t. 1 & 4. 1840 [& (J. T. K.) Spock & Scotty in Bot. Jahrb. Sol. 211: 591. 2194], [some typification note].", accName.getText());
|
168
|
|
169
|
WebElement synonym1 = p.getHeterotypicalGroupSynonym(1, 1);
|
170
|
assertEquals("=\nNepenthes teysmanniana Miq., Fl. Ned. Ind. 1(1): 1073. 1858", synonym1.getText());
|
171
|
WebElement synonym2 = p.getHeterotypicalGroupSynonym(1, 2);
|
172
|
assertEquals("≡\nNepenthes tupmanniana Bonstedt in Parey Blumeng. 1: 663. 1931 [non Nepenthes teysmanniana Miq., Fl. Ned. Ind. 1(1): 1073. 1858]", synonym2.getText());
|
173
|
assertEquals("is misspelling for", synonym2.findElement(By.className("symbol")).getAttribute("title"));
|
174
|
}
|
175
|
|
176
|
}
|