1
|
/**
|
2
|
* Copyright (C) 2009 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.net.MalformedURLException;
|
12
|
import java.util.List;
|
13
|
import java.util.UUID;
|
14
|
|
15
|
import org.junit.Before;
|
16
|
import org.junit.Ignore;
|
17
|
import org.junit.Test;
|
18
|
import org.openqa.selenium.WebElement;
|
19
|
|
20
|
import eu.etaxonomy.dataportal.DataPortalSite;
|
21
|
import eu.etaxonomy.dataportal.ElementUtils;
|
22
|
import eu.etaxonomy.dataportal.StringConstants;
|
23
|
import eu.etaxonomy.dataportal.elements.BaseElement;
|
24
|
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
|
25
|
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
|
26
|
import eu.etaxonomy.dataportal.pages.TaxonSynonymyPage;
|
27
|
|
28
|
/**
|
29
|
* Issues to be covered by this TestClass:
|
30
|
*
|
31
|
* #5676
|
32
|
* #5647
|
33
|
* #5492
|
34
|
* #7658 + #6682
|
35
|
*
|
36
|
* @author a.kohlbecker
|
37
|
*
|
38
|
*/
|
39
|
|
40
|
@DataPortalContexts( { DataPortalSite.reference })
|
41
|
public class MisappliedNamesTest extends CdmDataPortalTestBase{
|
42
|
|
43
|
static final UUID miconia_cubacinerea_Uuid = UUID.fromString("c6716cee-2039-4ba8-a239-4b1b353f9c84");
|
44
|
|
45
|
static final UUID trichocentrum_undulatum_Uuid = UUID.fromString("7e86b2a4-ba71-4494-b544-ae5656e02ed2");
|
46
|
|
47
|
static final UUID nepenthes_abalata_Uuid = UUID.fromString("9b588d8a-c4fa-430a-b9c7-026bf715ecf6");
|
48
|
|
49
|
|
50
|
|
51
|
@Before
|
52
|
public void setUp() throws Exception {
|
53
|
driver.get(getContext().getBaseUri().toString());
|
54
|
}
|
55
|
|
56
|
/**
|
57
|
* Test for correct sensu representation of misapplied names, see #5676 and #5647
|
58
|
*
|
59
|
* https://dev.e-taxonomy.eu/redmine/issues/5647
|
60
|
*
|
61
|
* NOTE: Species solaris has no authorship!!
|
62
|
*/
|
63
|
@Test
|
64
|
public void tesIssue5647() throws MalformedURLException {
|
65
|
|
66
|
TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), miconia_cubacinerea_Uuid);
|
67
|
|
68
|
WebElement misappliedName = p.getMisappliedName(1);
|
69
|
assertNotNull(misappliedName);
|
70
|
assertEquals("–\n\"Ossaea glomerata\" sensu Species solaris; sensu A&S1; sensu Lem2", misappliedName.getText());
|
71
|
List<BaseElement> footnotes = ElementUtils.findFootNotes(p.getTaxonRelationships());
|
72
|
assertEquals(2, footnotes.size());
|
73
|
assertEquals("1. A&S, Plantas vasculares de Oz", footnotes.get(0).getText());
|
74
|
assertEquals("2. Lem, New Species in the solar system", footnotes.get(1).getText());
|
75
|
|
76
|
}
|
77
|
|
78
|
|
79
|
/**
|
80
|
* https://dev.e-taxonomy.eu/redmine/issues/5492
|
81
|
*/
|
82
|
@Test
|
83
|
public void testIssue5492() throws MalformedURLException {
|
84
|
|
85
|
TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), trichocentrum_undulatum_Uuid);
|
86
|
|
87
|
WebElement misappliedName1 = p.getMisappliedName(1);
|
88
|
assertNotNull(misappliedName1);
|
89
|
assertEquals("–\n\"Oncidium guttatum\" auct. sensu Greuter, W. & Rankin Rodríguez, R1", misappliedName1.getText());
|
90
|
|
91
|
WebElement misappliedName2 = p.getMisappliedName(2);
|
92
|
assertNotNull(misappliedName2);
|
93
|
assertEquals("–\n" + StringConstants.DOUBTFULMARKER_SPACE +"\"Oncidium carthaginense\" auct. sensu Greuter, W. & Rankin Rodríguez, R1", misappliedName2.getText());
|
94
|
|
95
|
|
96
|
List<BaseElement> footnotes = ElementUtils.findFootNotes(p.getTaxonRelationships());
|
97
|
assertEquals(1, footnotes.size());
|
98
|
assertEquals("1. Greuter, W. & Rankin Rodríguez, R, Plantas vasculares de Cuba: inventario preliminar. Tercera edición, actualizada. Vascular plants of Cuba: a preliminary checklist. Third updated edition.", footnotes.get(0).getText());
|
99
|
}
|
100
|
|
101
|
/**
|
102
|
* https://dev.e-taxonomy.eu/redmine/issues/7658
|
103
|
* https://dev.e-taxonomy.eu/redmine/issues/6682
|
104
|
*/
|
105
|
@Test
|
106
|
@Ignore
|
107
|
public void testIssue7658() throws MalformedURLException {
|
108
|
|
109
|
|
110
|
TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), nepenthes_abalata_Uuid);
|
111
|
|
112
|
WebElement misappliedName1 = p.getMisappliedName(1);
|
113
|
assertNotNull(misappliedName1);
|
114
|
assertEquals("–\n\"Nepenthes alata\" pro parte, sensu Cheek, Jebb 20011, non Blanco, err. sec. Cheek, Jebb 2013", misappliedName1.getText());
|
115
|
|
116
|
WebElement misappliedName2 = p.getMisappliedName(2);
|
117
|
assertNotNull(misappliedName2);
|
118
|
assertEquals("–\n\"Nepenthes blancoi\" pro parte, sensu Macfarlane 19082, non Blume, err. sec. Cheek, Jebb 2013", misappliedName2.getText());
|
119
|
|
120
|
|
121
|
List<BaseElement> footnotes = ElementUtils.findFootNotes(p.getTaxonRelationships());
|
122
|
assertEquals(1, footnotes.size());
|
123
|
}
|
124
|
|
125
|
}
|