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
|
|
15
|
import org.junit.Before;
|
16
|
import org.junit.Test;
|
17
|
import org.openqa.selenium.NoSuchElementException;
|
18
|
|
19
|
import eu.etaxonomy.dataportal.DataPortalSite;
|
20
|
import eu.etaxonomy.dataportal.ElementUtils;
|
21
|
import eu.etaxonomy.dataportal.elements.GalleryImage;
|
22
|
import eu.etaxonomy.dataportal.elements.RegistrationItemFull;
|
23
|
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
|
24
|
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
|
25
|
import eu.etaxonomy.dataportal.pages.PortalPage.MessageType;
|
26
|
import eu.etaxonomy.dataportal.pages.RegistrationPage;
|
27
|
|
28
|
/**
|
29
|
* @author a.kohlbecker
|
30
|
* @since Feb 5, 2019
|
31
|
*
|
32
|
*/
|
33
|
@DataPortalContexts( { DataPortalSite.reference })
|
34
|
public class RegistrationPageTest extends CdmDataPortalTestBase {
|
35
|
|
36
|
private static final String planothidium_victori_id = "http://testbank.org/100001";
|
37
|
|
38
|
private static final String planothidium_victori_epitype_id = "http://testbank.org/100002";
|
39
|
|
40
|
private static final String nodosilinea_id = "http://testbank.org/100003"; // in preparation!
|
41
|
|
42
|
private static final String nodosilinea_radiophila_id = "http://testbank.org/100004";
|
43
|
|
44
|
private static final String ramsaria_id = "http://testbank.org/100005";
|
45
|
|
46
|
private static final String ramsaria_avicennae_id = "http://testbank.org/100006";
|
47
|
|
48
|
private static final String glenodinium_apiculatum_types_id = "http://testbank.org/100008";
|
49
|
|
50
|
String titleSuffix = " | Integration test reference";
|
51
|
|
52
|
|
53
|
|
54
|
@Before
|
55
|
public void setUp() throws Exception {
|
56
|
driver.get(getContext().getBaseUri().toString());
|
57
|
}
|
58
|
|
59
|
|
60
|
@Test
|
61
|
public void test100001() throws MalformedURLException, UnsupportedEncodingException{
|
62
|
|
63
|
RegistrationPage p = new RegistrationPage(driver, getContext(), planothidium_victori_id);
|
64
|
|
65
|
assertEquals("Registration Id: http://testbank.org/100001" + titleSuffix, driver.getTitle());
|
66
|
RegistrationItemFull regItem = p.getRegistrationItem();
|
67
|
assertNotNull(regItem);
|
68
|
assertEquals(
|
69
|
"Planothidium victori Novis, Braidwood & Kilroy in Phytotaxa 64. 2012",
|
70
|
regItem.getNameElement().getText());
|
71
|
assertEquals(
|
72
|
"published in: Novis, P. M., Braidwood, J. & Kilroy, C., Small diatoms (Bacillariophyta) in cultures from the Styx River, New Zealand, including descriptions of three new species in Phytotaxa 64: 11-45. 2012",
|
73
|
regItem.getCitation().getText());
|
74
|
assertEquals(
|
75
|
"Registration on 2019-02-06 14:21:52",
|
76
|
regItem.getMetadata().getText());
|
77
|
}
|
78
|
|
79
|
@Test
|
80
|
public void test100002() throws MalformedURLException, UnsupportedEncodingException{
|
81
|
|
82
|
RegistrationPage p = new RegistrationPage(driver, getContext(), planothidium_victori_epitype_id);
|
83
|
|
84
|
assertEquals("Registration Id: http://testbank.org/100002" + titleSuffix, driver.getTitle());
|
85
|
RegistrationItemFull regItem = p.getRegistrationItem();
|
86
|
assertNotNull(regItem);
|
87
|
assertEquals(
|
88
|
"Epitype: Berlin, small river Wuhle, 52°31'14.844\"N, 13°34'40.116\"E, Skibbe - collector number D06 (B 40 0040871).",
|
89
|
regItem.getSpecimenTypeDesignations().get(0).getText());
|
90
|
assertEquals(
|
91
|
"for Planothidium victori Novis, Braidwood & Kilroy in Phytotaxa 64. 2012",
|
92
|
regItem.getTypifiedNameElement().getText());
|
93
|
assertEquals(
|
94
|
"published in: Jahn, R., Abarca, N., Gemeinholzer, B. & al., Planothidium lanceolatum and Planothicium frequentissimum reinvestigated wieht molecular methods and morphology: four new species and the taxonomic importance of the sinus and cavum in Diatom Research 32: 75-107. 2017",
|
95
|
regItem.getCitation().getText());
|
96
|
assertEquals(
|
97
|
"Registration on 2019-02-06 14:20:51",
|
98
|
regItem.getMetadata().getText());
|
99
|
}
|
100
|
|
101
|
@Test
|
102
|
public void test100003() throws MalformedURLException, UnsupportedEncodingException{
|
103
|
|
104
|
RegistrationPage p = new RegistrationPage(driver, getContext(), nodosilinea_id);
|
105
|
|
106
|
assertEquals("Registration in preparation" + titleSuffix, driver.getTitle());
|
107
|
RegistrationItemFull regItem = null;
|
108
|
try {
|
109
|
regItem = p.getRegistrationItem();
|
110
|
} catch(NoSuchElementException e) {/* IGNORE */}
|
111
|
assertNull(regItem);
|
112
|
|
113
|
assertEquals(
|
114
|
"Status message\nA registration with the identifier http://testbank.org/100003 is in preparation",
|
115
|
p.getMessageItems(MessageType.status).get(0));
|
116
|
}
|
117
|
|
118
|
|
119
|
@Test
|
120
|
public void test100004() throws MalformedURLException, UnsupportedEncodingException{
|
121
|
|
122
|
RegistrationPage p = new RegistrationPage(driver, getContext(), nodosilinea_radiophila_id);
|
123
|
|
124
|
assertEquals("Registration Id: http://testbank.org/100004" + titleSuffix, driver.getTitle());
|
125
|
RegistrationItemFull regItem = p.getRegistrationItem();
|
126
|
assertNotNull(regItem);
|
127
|
assertEquals(
|
128
|
"Nodosilinea radiophila Heidari & Hauer in Fottea 18(2): 142. fig. 5C, D. 1.11.2018, nom. illeg.",
|
129
|
regItem.getNameElement().getText());
|
130
|
assertEquals(
|
131
|
"Holotype: Iran, Islamic Republic of, Talesh Mahalleh, Ramsar., alt. 20 m, 36°52'58.8\"N, 50°40'58.8\"E (CBFS A–83–1).",
|
132
|
regItem.getSpecimenTypeDesignations().get(0).getText());
|
133
|
assertEquals(
|
134
|
"published in: Heidari, F., Zima, J., Riahi, H. & al., New simple trichal cyanobacterial taxa isolated from radioactive thermal springs in Fottea 18(2): 137–149. 2018",
|
135
|
regItem.getCitation().getText());
|
136
|
assertEquals(
|
137
|
"Registration on 2019-02-06 14:16:45",
|
138
|
regItem.getMetadata().getText());
|
139
|
}
|
140
|
|
141
|
@Test
|
142
|
public void test100005() throws MalformedURLException, UnsupportedEncodingException{
|
143
|
|
144
|
RegistrationPage p = new RegistrationPage(driver, getContext(), ramsaria_id);
|
145
|
|
146
|
assertEquals("Registration Id: http://testbank.org/100005" + titleSuffix, driver.getTitle());
|
147
|
RegistrationItemFull regItem = p.getRegistrationItem();
|
148
|
assertNotNull(regItem);
|
149
|
assertEquals(
|
150
|
"Ramsaria Heidari & Hauer in Fottea 18(2): 146. 1.11.2018",
|
151
|
regItem.getNameElement().getText());
|
152
|
assertEquals(
|
153
|
"Orig. des.: Ramsaria avicennae Heidari & Hauer Heidari, F. & Hauer, T. - in Heidari, F., Zima, J., Riahi, H. & al., New simple trichal cyanobacterial taxa isolated from radioactive thermal springs in Fottea 18(2): 137–149. 2018:146",
|
154
|
regItem.getNameTypeDesignations().get(0).getText());
|
155
|
assertEquals(
|
156
|
"published in: Heidari, F., Zima, J., Riahi, H. & al., New simple trichal cyanobacterial taxa isolated from radioactive thermal springs in Fottea 18(2): 137–149. 2018",
|
157
|
regItem.getCitation().getText());
|
158
|
assertEquals(
|
159
|
"Registration on 2019-02-06 13:54:35",
|
160
|
regItem.getMetadata().getText());
|
161
|
}
|
162
|
|
163
|
@Test
|
164
|
public void test100006() throws MalformedURLException, UnsupportedEncodingException{
|
165
|
|
166
|
RegistrationPage p = new RegistrationPage(driver, getContext(), ramsaria_avicennae_id);
|
167
|
|
168
|
assertEquals("Registration Id: http://testbank.org/100006" + titleSuffix, driver.getTitle());
|
169
|
RegistrationItemFull regItem = p.getRegistrationItem();
|
170
|
assertNotNull(regItem);
|
171
|
assertEquals(
|
172
|
"Ramsaria avicennae Heidari & Hauer in Fottea 18(2): 146, fig. 3F, G. 1.11.2018",
|
173
|
regItem.getNameElement().getText());
|
174
|
assertEquals(
|
175
|
"Holotype: Iran, Islamic Republic of, Ramsar, alt. 20 m, 36°52'58.8\"N, 50°40'58.8\"E (CBFS A–087–1).",
|
176
|
regItem.getSpecimenTypeDesignations().get(0).getText());
|
177
|
assertEquals(
|
178
|
"published in: Heidari, F., Zima, J., Riahi, H. & al., New simple trichal cyanobacterial taxa isolated from radioactive thermal springs in Fottea 18(2): 137–149. 2018",
|
179
|
regItem.getCitation().getText());
|
180
|
assertEquals(
|
181
|
"Registration on 2019-02-06 13:54:29",
|
182
|
regItem.getMetadata().getText());
|
183
|
}
|
184
|
|
185
|
|
186
|
|
187
|
@Test
|
188
|
public void test100008() throws MalformedURLException, UnsupportedEncodingException{
|
189
|
|
190
|
RegistrationPage p = new RegistrationPage(driver, getContext(), glenodinium_apiculatum_types_id);
|
191
|
|
192
|
assertEquals("Registration Id: http://testbank.org/100008" + titleSuffix, driver.getTitle());
|
193
|
RegistrationItemFull regItem = p.getRegistrationItem();
|
194
|
assertNotNull(regItem);
|
195
|
|
196
|
assertEquals(
|
197
|
"for Glenodinium apiculatum Ehrenb., Infusionsthierchen: 258, pl. XXII. 24.7.1838-8.1838",
|
198
|
regItem.getTypifiedNameElement().getText());
|
199
|
assertEquals(
|
200
|
"published in: Kretschmann, J., Žerdoner ?alasan, A. & Kusber, W.-H., Still curling after all these years: Glenodinium apiculatum Ehrenb. (Peridiniales, Dinophyceae) repeatedly found at its type locality in Berlin (Germany) in Systematics and Biodiversity. 2017",
|
201
|
regItem.getCitation().getText());
|
202
|
assertEquals(
|
203
|
"Registration on 2019-02-12 09:08:29",
|
204
|
regItem.getMetadata().getText());
|
205
|
|
206
|
// type designations in defined order
|
207
|
// 1. Epitype
|
208
|
assertEquals(
|
209
|
"Epitype: Germany, Berlin, 52°31'1.2\"N, 13°21'E, 28.3.2016, D047 (CEDiT 2017E68).",
|
210
|
regItem.getSpecimenTypeDesignations().get(0).getText());
|
211
|
|
212
|
// 2. Lectotype
|
213
|
assertTrue(
|
214
|
regItem.getSpecimenTypeDesignations().get(1).getText().startsWith("Lectotype: Germany, Berlin, 2.4.1835 (BHUPM 671). Naturkundemuseum Berlin (MFN) - Ehrenberg Collection"));
|
215
|
assertEquals(
|
216
|
"BHUPM 671",
|
217
|
regItem.getSpecimenTypeDesignations().get(1).getLinksInElement().get(0).getText());
|
218
|
assertTrue(
|
219
|
regItem.getSpecimenTypeDesignations().get(1).getLinksInElement().get(1).getUrl().endsWith("cdm_dataportal/reference/c5d980ff-8766-4322-9acb-7b0a499de707"));
|
220
|
List<List<GalleryImage>> galleryImages = ElementUtils.getGalleryImages(regItem.getSpecimenTypeDesignations().get(1).getElement(), p.getWait());
|
221
|
assertEquals("Expecting one row of images", 1, galleryImages.size());
|
222
|
assertEquals("Expecting 1 image in row", 1, galleryImages.get(0).size());
|
223
|
assertEquals(
|
224
|
"http://download.naturkundemuseum-berlin.de/Ehrenberg/Ec%20Drawings/Ec%20draw%20001-999/Ec%20draw%20600-699/ECdraw671.jpg",
|
225
|
galleryImages.get(0).get(0).getImageLink().getUrl());
|
226
|
|
227
|
// 3. Isolectotype
|
228
|
assertEquals(
|
229
|
"Isolectotype: Germany, Berlin, 52°31'1.2\"N, 13°21'E, 28.3.2016, D047 (M M-0289351). http://herbarium.bgbm.org/object/B400042045",
|
230
|
regItem.getSpecimenTypeDesignations().get(2).getText());
|
231
|
assertEquals(
|
232
|
"M M-0289351",
|
233
|
regItem.getSpecimenTypeDesignations().get(2).getLinksInElement().get(0).getText());
|
234
|
assertEquals(
|
235
|
"http://herbarium.bgbm.org/object/B400042045",
|
236
|
regItem.getSpecimenTypeDesignations().get(2).getLinksInElement().get(1).getText());
|
237
|
|
238
|
|
239
|
}
|
240
|
|
241
|
|
242
|
|
243
|
|
244
|
}
|