Project

General

Profile

« Previous | Next » 

Revision 9bfd2b5e

Added by Andreas Kohlbecker over 10 years ago

adapting test to modified BeanInitialiser

View differences:

7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Cichorieae_TechnicalAnnnotationsTest.java
9 9
 */
10 10
package eu.etaxonomy.dataportal.selenium.tests.cichorieae;
11 11

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

  
15 15
import java.net.MalformedURLException;
16 16
import java.util.List;
......
36 36
public class Cichorieae_TechnicalAnnnotationsTest extends CdmDataPortalTestBase{
37 37

  
38 38

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

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

  
43 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());
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 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());
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 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
	}
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 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());
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 68

  
69
		assertEquals("Pilosella Vaill. in Königl. Akad. Wiss. Paris Phys. Abh. 5: 703. 1754", p.getAcceptedNameText());
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
	}
69
        assertEquals("Pilosella Vaill. in Königl. Akad. Wiss. Paris Phys. Abh. 5: 703. 1754", p.getAcceptedNameText());
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 76

  
77 77
}

Also available in: Unified diff