Project

General

Profile

Download (3.4 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
 * Copyright (C) 2009 EDIT
4
 * European Distributed Institute of Taxonomy
5
 * http://www.e-taxonomy.eu
6
 *
7
 * The contents of this file are subject to the Mozilla Public License Version 1.1
8
 * See LICENSE.TXT at the top of this package for the full license terms.
9
 */
10
package eu.etaxonomy.dataportal.selenium.tests.cichorieae;
11

    
12
import static org.junit.Assert.*;
13
import static org.junit.Assert.assertEquals;
14

    
15
import java.net.MalformedURLException;
16
import java.util.List;
17
import java.util.UUID;
18

    
19
import org.junit.Test;
20

    
21
import eu.etaxonomy.dataportal.DataPortalContext;
22
import eu.etaxonomy.dataportal.elements.FeatureBlock;
23
import eu.etaxonomy.dataportal.elements.LinkElement;
24
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
25
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
26
import eu.etaxonomy.dataportal.pages.TaxonProfilePage;
27
import eu.etaxonomy.dataportal.pages.TaxonSynonymyPage;
28

    
29
/**
30
 *
31
 * @author a.kohlbecker
32
 *
33
 */
34

    
35
@DataPortalContexts( { DataPortalContext.cichorieae })
36
public class Cichorieae_TechnicalAnnnotationsTest extends CdmDataPortalTestBase{
37

    
38

    
39
	static UUID soroseris_hookeriana_uuid = UUID.fromString("adaabef1-02f9-41a4-8a39-bf13564559f7");
40

    
41
	static UUID pilosella_uuid = UUID.fromString("f42a07d1-d959-4838-b8ea-192b523ad5cc");
42

    
43

    
44
	@Test
45
	public void soroseris_hookeriana() throws MalformedURLException {
46
		TaxonProfilePage p = new TaxonProfilePage(driver, getContext(), soroseris_hookeriana_uuid);
47
		String expectedName = "Soroseris hookeriana";
48
		assertEquals(getContext().prepareTitle(expectedName), p.getTitle());
49

    
50
		List<LinkElement> tocLinks = p.getTableOfContentLinks();
51
		// Description mus not be included !!!
52
		assertEquals("Distribution", tocLinks.get(0).getText());
53
		assertEquals("Credits", tocLinks.get(1).getText());
54

    
55
		// Credits contains an technical annotation but this mus not be displayed
56
		FeatureBlock creditsBlock = p.getFeatureBlockAt(1, "credits", "div", "div");
57
		//testing this is not possible due to SCHROTT-CODE // assertEquals("expecting 1 DescriptionElements in citation", 1, creditsBlock.getDescriptionElements().size());
58
		assertEquals("Credits\nBoufford D. E. 2009: Images (12 added)\nSmalla M. 2009: Images (1 added)\nSun H. 2009: Images (3 added)\nYue J. 2009: Images (1 added)\nZhang J. 2009: Images (1 added).", creditsBlock.getText());
59
		assertEquals("expecting no footnoteKeys", 0, creditsBlock.getFootNoteKeys().size());
60
		assertEquals("expecting no footnotes", 0, creditsBlock.getFootNotes().size());
61
	}
62

    
63
	@Test
64
	public void pilosella() throws MalformedURLException {
65
		TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), pilosella_uuid);
66
		String expectedName = "Pilosella";
67
		assertEquals(getContext().prepareTitle(expectedName), p.getTitle());
68

    
69
		assertEquals("Pilosella Vaill. in Königl. Akad. Wiss. Paris Phys. Abh. 5: 703. 1754", p.getAcceptedName());
70
		assertEquals("Expecting one footnote key", 1, p.getAcceptedNameFootNoteKeys().size());
71
		assertEquals("Expecting one footnote", 1, p.getHomotypicalGroupFootNotes().size());
72
		String expectetToStartWith = "1. As has been discovered by Greuter & al. in Taxon 54: 166 (2005),";
73
		assertTrue("Expecting footnote to start with: '" + expectetToStartWith + "' but was '" + p.getHomotypicalGroupFootNotes().get(0).getText() + "'"
74
				, p.getHomotypicalGroupFootNotes().get(0).getText().startsWith(expectetToStartWith));
75
	}
76

    
77
}
(4-4/5)