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.UUID;
|
13
|
|
14
|
import org.junit.Before;
|
15
|
import org.junit.Test;
|
16
|
import org.openqa.selenium.By;
|
17
|
import org.openqa.selenium.WebElement;
|
18
|
|
19
|
import eu.etaxonomy.dataportal.DataPortalSite;
|
20
|
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
|
21
|
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
|
22
|
import eu.etaxonomy.dataportal.pages.GenericPortalPage;
|
23
|
|
24
|
/**
|
25
|
* Issues to be covered by this TestClass:
|
26
|
*
|
27
|
* #3616
|
28
|
*
|
29
|
* @author a.kohlbecker
|
30
|
*
|
31
|
*/
|
32
|
|
33
|
@DataPortalContexts( { DataPortalSite.reference })
|
34
|
public class MediaPageTest extends CdmDataPortalTestBase{
|
35
|
|
36
|
static final UUID ehrenberg_drawing_uuid = UUID.fromString("d0bf650c-4cc6-4dfe-bb2f-a289b426af2f");
|
37
|
|
38
|
|
39
|
@Before
|
40
|
public void setUp() throws Exception {
|
41
|
driver.get(getContext().getSiteUri().toString());
|
42
|
}
|
43
|
|
44
|
/**
|
45
|
* related to https://dev.e-taxonomy.eu/redmine/issues/6709
|
46
|
*/
|
47
|
@Test
|
48
|
public void testTitle_issue6709() throws MalformedURLException {
|
49
|
|
50
|
GenericPortalPage p = new GenericPortalPage(driver, getContext(), "media/" + ehrenberg_drawing_uuid.toString());
|
51
|
assertEquals(
|
52
|
"Media (ECdraw671.jpg) | Integration test reference",
|
53
|
driver.getTitle()
|
54
|
);
|
55
|
assertEquals(
|
56
|
"Media (ECdraw671.jpg)",
|
57
|
driver.findElement(By.id("page-title")).getText()
|
58
|
);
|
59
|
}
|
60
|
|
61
|
|
62
|
/**
|
63
|
* related to https://dev.e-taxonomy.eu/redmine/issues/6316
|
64
|
*/
|
65
|
@Test
|
66
|
public void testSources_issue6316() throws MalformedURLException {
|
67
|
|
68
|
|
69
|
GenericPortalPage p = new GenericPortalPage(driver, getContext(), "media/" + ehrenberg_drawing_uuid.toString());
|
70
|
WebElement mediaCaption = driver.findElement(By.className("media-caption"));
|
71
|
assertEquals("Source:\nNaturkundemuseum Berlin (MFN) - Ehrenberg Collection [761]", mediaCaption.getText());
|
72
|
}
|
73
|
|
74
|
}
|