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
|
|
19
|
import eu.etaxonomy.dataportal.DataPortalSite;
|
20
|
import eu.etaxonomy.dataportal.elements.OpenLayersMap;
|
21
|
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
|
22
|
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
|
23
|
import eu.etaxonomy.dataportal.pages.NamePage;
|
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
|
public class MapTest extends CdmDataPortalTestBase {
|
33
|
|
34
|
|
35
|
private static final String nodosilinea_radiophila_regid = "http://testbank.org/100004";
|
36
|
|
37
|
private static final String ramsaria_regid = "http://testbank.org/100005";
|
38
|
|
39
|
private static final UUID nodosilinea_radiophila_name_UUID = UUID.fromString("e97cc25b-ec11-4bb8-88d7-ab40a023f3fb");
|
40
|
|
41
|
private static final UUID ramsaria_name_UUID = UUID.fromString("3a6d4bf2-5c89-4525-9e87-0bacac96990b");
|
42
|
|
43
|
|
44
|
String titleSuffix = " | Integration test reference";
|
45
|
|
46
|
|
47
|
|
48
|
@Before
|
49
|
public void setUp() throws Exception {
|
50
|
driver.get(getContext().getSiteUri().toString());
|
51
|
}
|
52
|
|
53
|
@Test
|
54
|
public void namePageMapShown() throws MalformedURLException{
|
55
|
|
56
|
NamePage p = new NamePage(driver, getContext(), nodosilinea_radiophila_name_UUID);
|
57
|
List<OpenLayersMap> openLayersMaps = OpenLayersMap.findOpenLayersMaps(p);
|
58
|
assertFalse(openLayersMaps.isEmpty());
|
59
|
assertEquals(1, openLayersMaps.size());
|
60
|
assertEquals("specimens", openLayersMaps.get(0).getMapName());
|
61
|
}
|
62
|
|
63
|
@Test
|
64
|
public void registrationPageMapShown() throws MalformedURLException, UnsupportedEncodingException{
|
65
|
|
66
|
RegistrationPage p = new RegistrationPage(driver, getContext(), nodosilinea_radiophila_regid);
|
67
|
List<OpenLayersMap> openLayersMaps = OpenLayersMap.findOpenLayersMaps(p);
|
68
|
assertFalse(openLayersMaps.isEmpty());
|
69
|
assertEquals(1, openLayersMaps.size());
|
70
|
assertEquals("specimens", openLayersMaps.get(0).getMapName());
|
71
|
}
|
72
|
|
73
|
@Test
|
74
|
public void namePageMapHidden() throws MalformedURLException{
|
75
|
|
76
|
NamePage p = new NamePage(driver, getContext(), ramsaria_name_UUID);
|
77
|
List<OpenLayersMap> openLayersMaps = OpenLayersMap.findOpenLayersMaps(p);
|
78
|
assertTrue(openLayersMaps.isEmpty());
|
79
|
}
|
80
|
|
81
|
@Test
|
82
|
public void registrationPageMapHidden() throws MalformedURLException, UnsupportedEncodingException{
|
83
|
|
84
|
RegistrationPage p = new RegistrationPage(driver, getContext(), ramsaria_regid);
|
85
|
List<OpenLayersMap> openLayersMaps = OpenLayersMap.findOpenLayersMaps(p);
|
86
|
assertTrue(openLayersMaps.isEmpty());
|
87
|
}
|
88
|
|
89
|
}
|