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