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.Test;
|
17
|
import org.openqa.selenium.By;
|
18
|
import org.openqa.selenium.WebElement;
|
19
|
|
20
|
import eu.etaxonomy.dataportal.DataPortalSite;
|
21
|
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
|
22
|
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
|
23
|
import eu.etaxonomy.dataportal.pages.GenericPortalPage;
|
24
|
|
25
|
/**
|
26
|
* Issues to be covered by this TestClass:
|
27
|
*
|
28
|
* #9230
|
29
|
*
|
30
|
* @author a.kohlbecker
|
31
|
*
|
32
|
*/
|
33
|
|
34
|
@DataPortalContexts( { DataPortalSite.reference })
|
35
|
public class NamePageTest extends CdmDataPortalTestBase{
|
36
|
|
37
|
static final UUID name_nodosilinea_radiophila_uuid = UUID.fromString("e97cc25b-ec11-4bb8-88d7-ab40a023f3fb");
|
38
|
|
39
|
|
40
|
@Before
|
41
|
public void setUp() throws Exception {
|
42
|
driver.get(getContext().getSiteUri().toString());
|
43
|
}
|
44
|
|
45
|
/**
|
46
|
* related to https://dev.e-taxonomy.eu/redmine/issues/9230
|
47
|
*/
|
48
|
@Test
|
49
|
public void testUnpublishedTypeDesignationsHidden() throws MalformedURLException {
|
50
|
|
51
|
GenericPortalPage p = new GenericPortalPage(driver, getContext(), "name/" + name_nodosilinea_radiophila_uuid.toString() + "/null/null");
|
52
|
// expecting to land on name page, see NamePageRedirectTest for other cases
|
53
|
assertTrue(p.getDrupalPagePath().startsWith("cdm_dataportal/name/" + name_nodosilinea_radiophila_uuid.toString()));
|
54
|
WebElement typeDesignationsContainer = p.getDataPortalContent().getElement().findElement(By.cssSelector("div.typeDesignations"));
|
55
|
List<WebElement> typeDesignations = typeDesignationsContainer.findElements(By.xpath("./div"));
|
56
|
assertEquals(1, typeDesignations.size());
|
57
|
typeDesignations.get(0);
|
58
|
assertTrue(typeDesignations.get(0).getAttribute("class").contains("cdm:SpecimenTypeDesignation uuid:dbf91118-1c09-40f6-a3d0-2d9d4b88ac34"));
|
59
|
}
|
60
|
|
61
|
|
62
|
}
|