Project

General

Profile

Revision 20e02fff

ID20e02fffa23cb6e5c979a3e17e57f5492bce15d6
Parent 50d9206b
Child 44707ee3

Added by Andreas Kohlbecker over 1 year ago

test for media page title ref #6709 and original source display ref #6316

View differences:

modules/cdm_dataportal/theme/cdm_dataportal.media.theme
295 295
  }
296 296

  
297 297
  if(!empty($annotations_and_sources['source_references'])){
298
    _description_list_group_add($groups, t('Sources') . ':', markup_to_render_array(join(', ', $annotations_and_sources['source_references'])) );
298
    $sources_label = count($annotations_and_sources['source_references']) > 1 ? t('Sources') : t('Source');
299
    _description_list_group_add($groups, $sources_label . ':', markup_to_render_array(join(', ', $annotations_and_sources['source_references'])) );
299 300
  }
300 301

  
301 302
  // TODO add all other metadata elements generically.
src/test/java/eu/etaxonomy/dataportal/selenium/tests/reference/MediaPageTest.java
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().getBaseUri().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
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)