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.util.UUID;
|
12
|
|
13
|
import org.junit.Before;
|
14
|
import org.junit.Test;
|
15
|
import org.openqa.selenium.By;
|
16
|
import org.openqa.selenium.WebElement;
|
17
|
|
18
|
import eu.etaxonomy.dataportal.DataPortalSite;
|
19
|
import eu.etaxonomy.dataportal.elements.BaseElement;
|
20
|
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
|
21
|
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
|
22
|
import eu.etaxonomy.dataportal.pages.TaxonSynonymyPage;
|
23
|
|
24
|
/**
|
25
|
* Issues to be covered by this TestClass:
|
26
|
*
|
27
|
* #9265
|
28
|
*
|
29
|
* @author a.kohlbecker
|
30
|
*
|
31
|
*/
|
32
|
|
33
|
@DataPortalContexts( { DataPortalSite.reference })
|
34
|
public class NomenclaturalSourceTest extends CdmDataPortalTestBase{
|
35
|
|
36
|
static final UUID taxon_nepenthes_gracilis_uuid = UUID.fromString("5d9af5a8-c8ad-45e8-85df-ce6a01011fb9");
|
37
|
|
38
|
TaxonSynonymyPage p = null;
|
39
|
|
40
|
@Before
|
41
|
public void setUp() throws Exception {
|
42
|
driver.get(getContext().getSiteUri().toString());
|
43
|
if(p == null) {
|
44
|
p = new TaxonSynonymyPage(driver, getContext(), taxon_nepenthes_gracilis_uuid);
|
45
|
}
|
46
|
}
|
47
|
|
48
|
@Test
|
49
|
public void testNomenclaturalReference() {
|
50
|
|
51
|
WebElement acceptedName = p.getAcceptedName();
|
52
|
assertEquals("Nepenthes gracilis Korth., Verh. Nat. Gesch. Ned. Bezitt., Bot. 19: 22, t. 1 & 4. 1840 [& (J. T. K.) Spock & Scotty in Bot. Jahrb. Sol. 211: 591. 21941,2], [some typification note].", acceptedName.getText());
|
53
|
WebElement referenceElement = acceptedName.findElement(By.cssSelector(".reference"));
|
54
|
assertEquals("Verh. Nat. Gesch. Ned. Bezitt., Bot. 19: 22, t. 1 & 4. 1840", referenceElement.getText());
|
55
|
}
|
56
|
|
57
|
@Test
|
58
|
public void testProtologueAcceptedName() {
|
59
|
|
60
|
WebElement acceptedName = p.getAcceptedName();
|
61
|
BaseElement protologueElement = new BaseElement(acceptedName.findElement(By.cssSelector(".protologue")));
|
62
|
assertEquals(3, protologueElement.getLinksInElement().size());
|
63
|
assertTrue(protologueElement.getLinksInElement().get(0).getUrl().endsWith("cdm_dataportal/taxon/5d9af5a8-c8ad-45e8-85df-ce6a01011fb9/synonymy#footnote-1"));
|
64
|
assertTrue(protologueElement.getLinksInElement().get(1).getUrl().endsWith("cdm_dataportal/taxon/5d9af5a8-c8ad-45e8-85df-ce6a01011fb9/synonymy#footnote-2"));
|
65
|
assertEquals("http://media.test/protologue/1234", protologueElement.getLinksInElement().get(2).getUrl());
|
66
|
}
|
67
|
|
68
|
@Test
|
69
|
public void testProtologueHeterotypicSynonym() {
|
70
|
|
71
|
WebElement synonym = p.getHeterotypicalGroupSynonym(1, 1);
|
72
|
BaseElement protologueElement = new BaseElement(synonym.findElement(By.cssSelector(".protologue")));
|
73
|
assertEquals(1, protologueElement.getLinksInElement().size());
|
74
|
assertEquals("http://media.test/protologue/5678", protologueElement.getLinksInElement().get(0).getUrl());
|
75
|
}
|
76
|
|
77
|
@Test
|
78
|
public void testProtologueHopmotypicSynonym() {
|
79
|
|
80
|
WebElement synonym = p.getHeterotypicalGroupSynonym(1, 2);
|
81
|
BaseElement protologueElement = new BaseElement(synonym.findElement(By.cssSelector(".protologue")));
|
82
|
assertEquals(1, protologueElement.getLinksInElement().size());
|
83
|
assertEquals("http://media.test/98765", protologueElement.getLinksInElement().get(0).getUrl());
|
84
|
}
|
85
|
|
86
|
}
|