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
|
|
14
|
import org.junit.Before;
|
15
|
import org.junit.Test;
|
16
|
import org.openqa.selenium.NoSuchElementException;
|
17
|
|
18
|
import eu.etaxonomy.dataportal.DataPortalSite;
|
19
|
import eu.etaxonomy.dataportal.elements.RegistrationItemFull;
|
20
|
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
|
21
|
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
|
22
|
import eu.etaxonomy.dataportal.pages.PortalPage.MessageType;
|
23
|
import eu.etaxonomy.dataportal.pages.RegistrationPage;
|
24
|
|
25
|
/**
|
26
|
* @author a.kohlbecker
|
27
|
* @since Feb 5, 2019
|
28
|
*
|
29
|
*/
|
30
|
@DataPortalContexts( { DataPortalSite.reference })
|
31
|
public class RegistrationPageTest extends CdmDataPortalTestBase {
|
32
|
|
33
|
private static final String planothidium_victori_id = "http://testbank.org/100001";
|
34
|
|
35
|
private static final String planothidium_victori_epitype_id = "http://testbank.org/100002";
|
36
|
|
37
|
private static final String nodosilinea_id = "http://testbank.org/100003"; // in preparation!
|
38
|
|
39
|
private static final String nodosilinea_radiophila_id = "http://testbank.org/100004";
|
40
|
|
41
|
private static final String ramsaria_id = "http://testbank.org/100005";
|
42
|
|
43
|
private static final String ramsaria_avicennae_id = "http://testbank.org/100006";
|
44
|
|
45
|
String titleSuffix = " | Integration test reference";
|
46
|
|
47
|
|
48
|
|
49
|
@Before
|
50
|
public void setUp() throws Exception {
|
51
|
driver.get(getContext().getBaseUri().toString());
|
52
|
}
|
53
|
|
54
|
|
55
|
@Test
|
56
|
public void test100001() throws MalformedURLException, UnsupportedEncodingException{
|
57
|
|
58
|
RegistrationPage p = new RegistrationPage(driver, getContext(), planothidium_victori_id);
|
59
|
|
60
|
assertEquals("Registration Id: http://testbank.org/100001" + titleSuffix, driver.getTitle());
|
61
|
RegistrationItemFull regItem = p.getRegistrationItem();
|
62
|
assertNotNull(regItem);
|
63
|
assertEquals(
|
64
|
"Planothidium victori Novis, Braidwood & Kilroy in Phytotaxa 64. 2012",
|
65
|
regItem.getNameElement().getText());
|
66
|
assertEquals(
|
67
|
"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",
|
68
|
regItem.getCitation().getText());
|
69
|
assertEquals(
|
70
|
"Registration on 2019-02-06 14:21:52",
|
71
|
regItem.getMetadata().getText());
|
72
|
}
|
73
|
|
74
|
@Test
|
75
|
public void test100002() throws MalformedURLException, UnsupportedEncodingException{
|
76
|
|
77
|
RegistrationPage p = new RegistrationPage(driver, getContext(), planothidium_victori_epitype_id);
|
78
|
|
79
|
assertEquals("Registration Id: http://testbank.org/100002" + titleSuffix, driver.getTitle());
|
80
|
RegistrationItemFull regItem = p.getRegistrationItem();
|
81
|
assertNotNull(regItem);
|
82
|
assertEquals(
|
83
|
"Epitype: (B 40 0040871).",
|
84
|
regItem.getSpecimenTypeDesignations().get(0).getText());
|
85
|
assertEquals(
|
86
|
"for Planothidium victori Novis, Braidwood & Kilroy in Phytotaxa 64. 2012",
|
87
|
regItem.getTypifiedNameElement().getText());
|
88
|
assertEquals(
|
89
|
"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",
|
90
|
regItem.getCitation().getText());
|
91
|
assertEquals(
|
92
|
"Registration on 2019-02-06 14:20:51",
|
93
|
regItem.getMetadata().getText());
|
94
|
}
|
95
|
|
96
|
@Test
|
97
|
public void test100003() throws MalformedURLException, UnsupportedEncodingException{
|
98
|
|
99
|
RegistrationPage p = new RegistrationPage(driver, getContext(), nodosilinea_id);
|
100
|
|
101
|
assertEquals("Registration in preparation" + titleSuffix, driver.getTitle());
|
102
|
RegistrationItemFull regItem = null;
|
103
|
try {
|
104
|
regItem = p.getRegistrationItem();
|
105
|
} catch(NoSuchElementException e) {/* IGNORE */}
|
106
|
assertNull(regItem);
|
107
|
|
108
|
assertEquals(
|
109
|
"Status message\nA registration with the identifier http://testbank.org/100003 is in preparation",
|
110
|
p.getMessages(MessageType.status));
|
111
|
}
|
112
|
|
113
|
|
114
|
@Test
|
115
|
public void test100004() throws MalformedURLException, UnsupportedEncodingException{
|
116
|
|
117
|
RegistrationPage p = new RegistrationPage(driver, getContext(), nodosilinea_radiophila_id);
|
118
|
|
119
|
assertEquals("Registration Id: http://testbank.org/100004" + titleSuffix, driver.getTitle());
|
120
|
RegistrationItemFull regItem = p.getRegistrationItem();
|
121
|
assertNotNull(regItem);
|
122
|
assertEquals(
|
123
|
"Nodosilinea radiophila Heidari & Hauer in Fottea 18(2): 142. fig. 5C, D. 1.11.2018",
|
124
|
regItem.getNameElement().getText());
|
125
|
assertEquals(
|
126
|
"Holotype: (CBFS A–83–1).",
|
127
|
regItem.getSpecimenTypeDesignations().get(0).getText());
|
128
|
assertEquals(
|
129
|
"Heidari, F., Zima, J., Riahi, H. & al., New simple trichal cyanobacterial taxa isolated from radioactive thermal springs in Fottea 18(2): 137–149. 2018",
|
130
|
regItem.getCitation().getText());
|
131
|
assertEquals(
|
132
|
"Registration on 2019-02-06 14:16:45",
|
133
|
regItem.getMetadata().getText());
|
134
|
}
|
135
|
|
136
|
@Test
|
137
|
public void test100005() throws MalformedURLException, UnsupportedEncodingException{
|
138
|
|
139
|
RegistrationPage p = new RegistrationPage(driver, getContext(), ramsaria_id);
|
140
|
|
141
|
assertEquals("Registration Id: http://testbank.org/100005" + titleSuffix, driver.getTitle());
|
142
|
RegistrationItemFull regItem = p.getRegistrationItem();
|
143
|
assertNotNull(regItem);
|
144
|
assertEquals(
|
145
|
"Ramsaria Heidari & Hauer in Fottea 18(2): 146. 1.11.2018",
|
146
|
regItem.getNameElement().getText());
|
147
|
assertEquals(
|
148
|
"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",
|
149
|
regItem.getNameTypeDesignations().get(0).getText());
|
150
|
assertEquals(
|
151
|
"Heidari, F., Zima, J., Riahi, H. & al., New simple trichal cyanobacterial taxa isolated from radioactive thermal springs in Fottea 18(2): 137–149. 2018",
|
152
|
regItem.getCitation().getText());
|
153
|
assertEquals(
|
154
|
"Registration on 2019-02-06 13:54:35",
|
155
|
regItem.getMetadata().getText());
|
156
|
}
|
157
|
|
158
|
@Test
|
159
|
public void test100006() throws MalformedURLException, UnsupportedEncodingException{
|
160
|
|
161
|
RegistrationPage p = new RegistrationPage(driver, getContext(), ramsaria_avicennae_id);
|
162
|
|
163
|
assertEquals("Registration Id: http://testbank.org/100006" + titleSuffix, driver.getTitle());
|
164
|
RegistrationItemFull regItem = p.getRegistrationItem();
|
165
|
assertNotNull(regItem);
|
166
|
assertEquals(
|
167
|
"Ramsaria avicennae Heidari & Hauer in Fottea 18(2): 146, fig. 3F, G. 1.11.2018",
|
168
|
regItem.getNameElement().getText());
|
169
|
assertEquals(
|
170
|
"Holotype: (CBFS A–087–1).",
|
171
|
regItem.getSpecimenTypeDesignations().get(0).getText());
|
172
|
assertEquals(
|
173
|
"Heidari, F., Zima, J., Riahi, H. & al., New simple trichal cyanobacterial taxa isolated from radioactive thermal springs in Fottea 18(2): 137–149. 2018",
|
174
|
regItem.getCitation().getText());
|
175
|
assertEquals(
|
176
|
"Registration on 2019-02-06 13:54:29",
|
177
|
regItem.getMetadata().getText());
|
178
|
}
|
179
|
|
180
|
|
181
|
|
182
|
|
183
|
}
|