Project

General

Profile

« Previous | Next » 

Revision ff4f2e07

Added by Andreas Kohlbecker almost 9 years ago

more test for typedesignations

View differences:

.gitattributes
1090 1090
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/resources/org/mozilla/addons/disable_add_on_compatibility_checks-1.3.xpi -text
1091 1091
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/resources/org/mozilla/addons/firebug-1.10.5-fx.xpi -text
1092 1092
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/resources/org/mozilla/addons/firepath-0.9.7-fx.xpi -text
1093
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/CichorieaeSearchTest.java -text
1094 1093
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Cichorieae_CommonNamesTest.java -text
1095 1094
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Cichorieae_FootnoteTest.java -text
1096 1095
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Cichorieae_HybridTest.java -text
1097 1096
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Cichorieae_NamePageTest.java -text
1097
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Cichorieae_SearchTest.java -text
1098 1098
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Cichorieae_TechnicalAnnnotationsTest.java -text
1099 1099
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Cichorieae_TypeTest.java -text
1100
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Crepis_tectorum_Synonymy.java -text
1100
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Crepis_tectorum_SynonymyTest.java -text
1101 1101
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Lactuca_triquetra_TaxonProfileTest.java -text
1102
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Scorzonera_SynonymyTest.java -text
1102 1103
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cyprus/Allium_guttatum_subsp_guttatum_TaxonProfileTest.java -text
1103 1104
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cyprus/CyprusSearchTest.java -text
1104 1105
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cyprus/Cyprus_HybridTest.java -text
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/java/eu/etaxonomy/dataportal/elements/TypeDesignationElement.java
10 10
package eu.etaxonomy.dataportal.elements;
11 11

  
12 12
import org.openqa.selenium.By;
13
import org.openqa.selenium.NoSuchElementException;
13 14
import org.openqa.selenium.WebElement;
14 15

  
15 16
/**
......
19 20
 */
20 21
public class TypeDesignationElement extends BaseElement {
21 22

  
22
    private WebElement status;
23
    private final WebElement status;
23 24

  
24
    private TypeDesignationType typeDesignationType;
25
    private WebElement nameDescription = null;
26

  
27
    private final TypeDesignationType typeDesignationType;
25 28

  
26 29
    public TypeDesignationElement(WebElement element) {
27 30
        super(element);
28 31
        status = element.findElement(By.cssSelector(".status"));
32
        try {
33
            nameDescription = element.findElement(By.cssSelector(".description"));
34
        } catch (NoSuchElementException e) {
35
            // IGNORE
36
        }
29 37
        typeDesignationType = TypeDesignationType.valueOf(element.getAttribute("class"));
30 38
    }
31 39

  
......
37 45
        return typeDesignationType;
38 46
    }
39 47

  
48
    /**
49
     * contains nomenclatorical status, protologues, etc.
50
     *
51
     * @return the nameDescription
52
     */
53
    public WebElement getNameDescription() {
54
        return nameDescription;
55
    }
56

  
40 57
}
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/java/eu/etaxonomy/dataportal/pages/TaxonSynonymyPage.java
10 10
 */
11 11
package eu.etaxonomy.dataportal.pages;
12 12

  
13
import static org.junit.Assert.assertEquals;
14
import static org.junit.Assert.assertTrue;
15

  
16 13
import java.net.MalformedURLException;
17 14
import java.util.ArrayList;
18 15
import java.util.List;
19 16
import java.util.UUID;
20 17

  
21 18
import org.apache.log4j.Logger;
22
import org.junit.Assert;
23 19
import org.openqa.selenium.By;
24
import org.openqa.selenium.NoSuchElementException;
25
import org.openqa.selenium.WebElement;
26 20
import org.openqa.selenium.WebDriver;
21
import org.openqa.selenium.WebElement;
27 22
import org.openqa.selenium.support.CacheLookup;
28 23
import org.openqa.selenium.support.FindBy;
29 24

  
30 25
import eu.etaxonomy.dataportal.DataPortalContext;
31 26
import eu.etaxonomy.dataportal.ElementUtils;
32 27
import eu.etaxonomy.dataportal.elements.BaseElement;
33
import eu.etaxonomy.dataportal.elements.FeatureBlock;
34
import eu.etaxonomy.dataportal.elements.ImgElement;
35 28
import eu.etaxonomy.dataportal.elements.LinkElement;
36 29
import eu.etaxonomy.dataportal.elements.TypeDesignationElement;
37 30

  
......
131 124
    }
132 125

  
133 126
    /**
127
     * @return
128
     */
129
    public List<BaseElement> getAcceptedNameFootNotes() {
130
        List<WebElement> fnListElements = synonymy.findElements(
131
                By.xpath("./span[contains(@class,'accepted-name')]/following-sibling::ul[contains(@class, 'footnotes')]/li[contains(@class, 'footnotes')]/span[contains(@class, 'footnote')]")
132
        );
133
        return ElementUtils.baseElementsFromFootNoteListElements(fnListElements);
134
    }
135

  
136
    /**
134 137
     * @param synonymIndex
135 138
     *            the 1-based position of the synonym in the list of homotypical
136 139
     *            synonyms
......
197 200
     * @return
198 201
     */
199 202
    public WebElement getHeterotypicalGroupSynonym(Integer heterotypicalGroupIndex, Integer synonymIndex) {
200
        WebElement synonym = synonymy.findElement(By.xpath("./div[contains(@class,'heterotypic-synonymy-group')][" + heterotypicalGroupIndex + "]/ul/li[" + synonymIndex + "]"));
203
        WebElement synonym = synonymy.findElement(By.xpath("./div[contains(@class,'heterotypic-synonymy-group')][" + heterotypicalGroupIndex + "]/ul[contains(@class,'heterotypicSynonymyGroup')]/li[" + synonymIndex + "]"));
201 204
        return synonym;
202 205
    }
203 206

  
204 207
    /**
205 208
     * @param heterotypicalGroupIndex
209
     *            the 1-based index of the heterotypical group
210
     * @return
211
     */
212
    public List<TypeDesignationElement> getHeterotypicalGroupTypeDesignations(Integer heterotypicalGroupIndex) {
213
        List<WebElement> typeDesignationElements = synonymy.findElements(By
214
                .xpath("./div[contains(@class,'heterotypic-synonymy-group')][" + heterotypicalGroupIndex
215
                        + "]/ul[contains(@class,'heterotypicSynonymyGroup')]/ul[contains(@class,'typeDesignations')]/li"));
216
        List<TypeDesignationElement> typeDesignations = new ArrayList<TypeDesignationElement>();
217
        for (WebElement el : typeDesignationElements) {
218
            typeDesignations.add(new TypeDesignationElement(el));
219
        }
220
        return typeDesignations;
221
    }
222

  
223
    /**
224
     * @param heterotypicalGroupIndex
206 225
     * 				the 1-based index of the heterotypical group
207 226
     * @return
208 227
     */
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/CichorieaeSearchTest.java
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.util.List;
16
import java.util.UUID;
17

  
18
import junit.framework.Assert;
19

  
20
import org.junit.Before;
21
import org.junit.Test;
22
import org.openqa.selenium.By;
23
import org.openqa.selenium.WebElement;
24

  
25
import eu.etaxonomy.dataportal.DataPortalContext;
26
import eu.etaxonomy.dataportal.elements.GalleryImage;
27
import eu.etaxonomy.dataportal.elements.LinkElement;
28
import eu.etaxonomy.dataportal.elements.TaxonListElement;
29
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
30
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
31
import eu.etaxonomy.dataportal.pages.GenericPortalPage;
32
import eu.etaxonomy.dataportal.pages.PortalPage;
33
import eu.etaxonomy.dataportal.pages.TaxonSearchResultPage;
34
import eu.etaxonomy.dataportal.selenium.VisibilityOfElementLocated;
35

  
36
@DataPortalContexts( { DataPortalContext.cichorieae })
37
public class CichorieaeSearchTest extends CdmDataPortalTestBase {
38

  
39
    private static final UUID UUID_L_COMMUNIS = UUID.fromString("5d65f017-0c23-43e4-888d-9649de50dd45");
40
    private static GenericPortalPage homePage = null;
41

  
42
    @Before
43
    public void setUp() throws Exception {
44

  
45
        driver.get(getContext().getBaseUri().toString());
46
        homePage = new GenericPortalPage(driver, getContext());
47

  
48
    }
49

  
50
    @Test
51
    public void testSearchLCommunis() throws Exception {
52

  
53
        TaxonSearchResultPage searchResultPage = homePage.submitQuery("Lapsana com*");
54

  
55
        assertEquals(getContext().prepareTitle("Search results"), searchResultPage.getTitle());
56

  
57
        TaxonListElement lapsanaCommunnis = searchResultPage.getResultItem(1);
58

  
59
        assertEquals("Lapsana communis L., Sp. Pl.: 811. 1753", lapsanaCommunnis.getFullTaxonName());
60

  
61
        WebElement nameElement = lapsanaCommunnis.getElement().findElement(By.className("BotanicalName"));
62

  
63
        WebElement namePart1 = nameElement.findElement(By.xpath("span[1]"));
64
        Assert.assertEquals("Lapsana", namePart1.getText());
65
        Assert.assertEquals("italic", namePart1.getCssValue("font-style"));
66

  
67
        WebElement namePart2 = nameElement.findElement(By.xpath("span[2]"));
68
        Assert.assertEquals("communis", namePart2.getText());
69
        Assert.assertEquals("italic", namePart2.getCssValue("font-style"));
70

  
71
        WebElement authorPart = nameElement.findElement(By.xpath("span[3]"));
72
        Assert.assertEquals("L.", authorPart.getText());
73
        Assert.assertEquals("normal", authorPart.getCssValue("font-style"));
74

  
75
        WebElement referenceElement = lapsanaCommunnis.getElement().findElement(By.className("reference"));
76
        Assert.assertEquals("Sp. Pl.: 811. 1753", referenceElement.findElement((By.className("reference"))).getText());
77

  
78
        PortalPage taxonProfilLapsanaCommunnis = searchResultPage.clickTaxonName(lapsanaCommunnis, GenericPortalPage.class, UUID_L_COMMUNIS);
79
        assertEquals(getContext().prepareTitle("Lapsana communis"), taxonProfilLapsanaCommunnis.getTitle());
80
    }
81

  
82
    @Test
83
    public void testSearchLCommunis_ImageLinks() throws Exception {
84

  
85
        TaxonSearchResultPage searchResultPage = homePage.submitQuery("Lapsana com*");
86

  
87
        assertEquals(getContext().prepareTitle("Search results"), searchResultPage.getTitle());
88

  
89
        TaxonListElement lapsanaCommunnis = searchResultPage.getResultItem(1);
90

  
91
        List<List<GalleryImage>> galleryImageRows = searchResultPage.getGalleryImagesOf(lapsanaCommunnis);
92

  
93
        assertEquals("Expecting one row of images", 1, galleryImageRows.size());
94
        assertEquals("Expecting 4 images in row", 4, galleryImageRows.get(0).size());
95

  
96
        GalleryImage firstImage = galleryImageRows.get(0).get(0);
97
        assertNull("caption should be off", firstImage.getCaptionText());
98
        searchResultPage.clickLink(firstImage.getImageLink(), new VisibilityOfElementLocated(By.id("images")), GenericPortalPage.class);
99
    }
100

  
101
}
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Cichorieae_SearchTest.java
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.util.List;
16
import java.util.UUID;
17

  
18
import junit.framework.Assert;
19

  
20
import org.junit.Before;
21
import org.junit.Test;
22
import org.openqa.selenium.By;
23
import org.openqa.selenium.WebElement;
24

  
25
import eu.etaxonomy.dataportal.DataPortalContext;
26
import eu.etaxonomy.dataportal.elements.GalleryImage;
27
import eu.etaxonomy.dataportal.elements.LinkElement;
28
import eu.etaxonomy.dataportal.elements.TaxonListElement;
29
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
30
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
31
import eu.etaxonomy.dataportal.pages.GenericPortalPage;
32
import eu.etaxonomy.dataportal.pages.PortalPage;
33
import eu.etaxonomy.dataportal.pages.TaxonSearchResultPage;
34
import eu.etaxonomy.dataportal.selenium.VisibilityOfElementLocated;
35

  
36
@DataPortalContexts( { DataPortalContext.cichorieae })
37
public class Cichorieae_SearchTest extends CdmDataPortalTestBase {
38

  
39
    private static final UUID UUID_L_COMMUNIS = UUID.fromString("5d65f017-0c23-43e4-888d-9649de50dd45");
40
    private static GenericPortalPage homePage = null;
41

  
42
    @Before
43
    public void setUp() throws Exception {
44

  
45
        driver.get(getContext().getBaseUri().toString());
46
        homePage = new GenericPortalPage(driver, getContext());
47

  
48
    }
49

  
50
    @Test
51
    public void testSearchLCommunis() throws Exception {
52

  
53
        TaxonSearchResultPage searchResultPage = homePage.submitQuery("Lapsana com*");
54

  
55
        assertEquals(getContext().prepareTitle("Search results"), searchResultPage.getTitle());
56

  
57
        TaxonListElement lapsanaCommunnis = searchResultPage.getResultItem(1);
58

  
59
        assertEquals("Lapsana communis L., Sp. Pl.: 811. 1753", lapsanaCommunnis.getFullTaxonName());
60

  
61
        WebElement nameElement = lapsanaCommunnis.getElement().findElement(By.className("BotanicalName"));
62

  
63
        WebElement namePart1 = nameElement.findElement(By.xpath("span[1]"));
64
        Assert.assertEquals("Lapsana", namePart1.getText());
65
        Assert.assertEquals("italic", namePart1.getCssValue("font-style"));
66

  
67
        WebElement namePart2 = nameElement.findElement(By.xpath("span[2]"));
68
        Assert.assertEquals("communis", namePart2.getText());
69
        Assert.assertEquals("italic", namePart2.getCssValue("font-style"));
70

  
71
        WebElement authorPart = nameElement.findElement(By.xpath("span[3]"));
72
        Assert.assertEquals("L.", authorPart.getText());
73
        Assert.assertEquals("normal", authorPart.getCssValue("font-style"));
74

  
75
        WebElement referenceElement = lapsanaCommunnis.getElement().findElement(By.className("reference"));
76
        Assert.assertEquals("Sp. Pl.: 811. 1753", referenceElement.findElement((By.className("reference"))).getText());
77

  
78
        PortalPage taxonProfilLapsanaCommunnis = searchResultPage.clickTaxonName(lapsanaCommunnis, GenericPortalPage.class, UUID_L_COMMUNIS);
79
        assertEquals(getContext().prepareTitle("Lapsana communis"), taxonProfilLapsanaCommunnis.getTitle());
80
    }
81

  
82
    @Test
83
    public void testSearchLCommunis_ImageLinks() throws Exception {
84

  
85
        TaxonSearchResultPage searchResultPage = homePage.submitQuery("Lapsana com*");
86

  
87
        assertEquals(getContext().prepareTitle("Search results"), searchResultPage.getTitle());
88

  
89
        TaxonListElement lapsanaCommunnis = searchResultPage.getResultItem(1);
90

  
91
        List<List<GalleryImage>> galleryImageRows = searchResultPage.getGalleryImagesOf(lapsanaCommunnis);
92

  
93
        assertEquals("Expecting one row of images", 1, galleryImageRows.size());
94
        assertEquals("Expecting 4 images in row", 4, galleryImageRows.get(0).size());
95

  
96
        GalleryImage firstImage = galleryImageRows.get(0).get(0);
97
        assertNull("caption should be off", firstImage.getCaptionText());
98
        searchResultPage.clickLink(firstImage.getImageLink(), new VisibilityOfElementLocated(By.id("images")), GenericPortalPage.class);
99
    }
100

  
101
}
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Crepis_tectorum_Synonymy.java
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.assertEquals;
13

  
14
import java.net.MalformedURLException;
15
import java.util.UUID;
16

  
17
import org.junit.Test;
18

  
19
import eu.etaxonomy.dataportal.DataPortalContext;
20
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
21
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
22
import eu.etaxonomy.dataportal.pages.TaxonSynonymyPage;
23

  
24
/**
25
 *
26
 * @author a.kohlbecker
27
 *
28
 */
29

  
30
@DataPortalContexts( { DataPortalContext.cichorieae })
31
public class Crepis_tectorum_Synonymy extends CdmDataPortalTestBase{
32

  
33
    static UUID crepis_tectorum_Uuid = UUID.fromString("c62dff09-3f04-4f05-9aac-904d51ac1b77");
34

  
35
    @Test
36
    public void crepis_oenipontana() throws MalformedURLException {
37
        TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), crepis_tectorum_Uuid);
38
        assertEquals(getContext().prepareTitle("Crepis tectorum"), p.getTitle());
39
        assertEquals("Crepis tectorum L., Sp. Pl.: 807. 1753", p.getAcceptedNameText());
40
        assertEquals("≡ Crepis varia Moench, Methodus: 534. 1794, nom. illeg.", p.getHomotypicalGroupSynonymName(2));
41
        assertEquals("≡ Crepis stricta Schultz, Prodr. Fl. Starg. Suppl.: 41. 1819 [non Crepis stricta Scop. 1772]", p.getHeterotypicalGroupSynonymName(1, 2));
42
        assertEquals("= Crepis lanceolata Kit. [non Crepis lanceolata Sch. Bip. 1854]", p.getHeterotypicalGroupSynonymName(9, 1));
43
    }
44

  
45

  
46

  
47
}
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Crepis_tectorum_SynonymyTest.java
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.assertEquals;
13

  
14
import java.net.MalformedURLException;
15
import java.util.UUID;
16

  
17
import org.junit.Test;
18

  
19
import eu.etaxonomy.dataportal.DataPortalContext;
20
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
21
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
22
import eu.etaxonomy.dataportal.pages.TaxonSynonymyPage;
23

  
24
/**
25
 *
26
 * @author a.kohlbecker
27
 *
28
 */
29

  
30
@DataPortalContexts( { DataPortalContext.cichorieae })
31
public class Crepis_tectorum_SynonymyTest extends CdmDataPortalTestBase{
32

  
33
    static UUID crepis_tectorum_Uuid = UUID.fromString("c62dff09-3f04-4f05-9aac-904d51ac1b77");
34

  
35
    @Test
36
    public void crepis_oenipontana() throws MalformedURLException {
37
        TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), crepis_tectorum_Uuid);
38
        assertEquals(getContext().prepareTitle("Crepis tectorum"), p.getTitle());
39
        assertEquals("Crepis tectorum L., Sp. Pl.: 807. 1753", p.getAcceptedNameText());
40
        assertEquals("≡ Crepis varia Moench, Methodus: 534. 1794, nom. illeg.", p.getHomotypicalGroupSynonymName(2));
41
        assertEquals("≡ Crepis stricta Schultz, Prodr. Fl. Starg. Suppl.: 41. 1819 [non Crepis stricta Scop. 1772]", p.getHeterotypicalGroupSynonymName(1, 2));
42
        assertEquals("= Crepis lanceolata Kit. [non Crepis lanceolata Sch. Bip. 1854]", p.getHeterotypicalGroupSynonymName(9, 1));
43
    }
44

  
45

  
46

  
47
}
7.x/modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Scorzonera_SynonymyTest.java
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.assertEquals;
13

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

  
18
import org.junit.Test;
19

  
20
import eu.etaxonomy.dataportal.DataPortalContext;
21
import eu.etaxonomy.dataportal.elements.TypeDesignationElement;
22
import eu.etaxonomy.dataportal.elements.TypeDesignationType;
23
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
24
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
25
import eu.etaxonomy.dataportal.pages.TaxonSynonymyPage;
26

  
27
/**
28
 *
29
 * @author a.kohlbecker
30
 *
31
 */
32

  
33
@DataPortalContexts( { DataPortalContext.cichorieae })
34
public class Scorzonera_SynonymyTest extends CdmDataPortalTestBase{
35

  
36
    static UUID scorzonera_Uuid = UUID.fromString("c1e8a3f2-2b65-4aad-ad25-1cf9df92e290");
37

  
38
    @Test
39
    public void scorzonera_typeDesignations() throws MalformedURLException {
40
        TaxonSynonymyPage p = new TaxonSynonymyPage(driver, getContext(), scorzonera_Uuid);
41
        assertEquals(getContext().prepareTitle("Scorzonera"), p.getTitle());
42
        assertEquals("Scorzonera L., Sp. Pl.: 790. 1753", p.getAcceptedNameText());
43

  
44

  
45
        // check type designation for accepted taxon
46
        List<TypeDesignationElement> typeDesignations = p.getAcceptedNameTypeDesignations();
47
        assertEquals("Expecting one Typedesignation", 1, typeDesignations.size());
48
        assertEquals(TypeDesignationType.nameTypeDesignation, typeDesignations.get(0).getTypeDesignationType());
49
        assertEquals("Lectotype (designated by Green 1929: 1771): Scorzonera humilis L.", typeDesignations.get(0).getText()); // last digit of 1771 is footnote key !!!
50
        assertEquals("1. Green, Proposals by British Botanists. 1929", p.getAcceptedNameFootNotes().get(0).getText());
51
//        assertNull("The typified name should not have a name description (protologue)", typeDesignations.get(0).getNameDescription()); // FIXME
52

  
53
        assertEquals("= Gelasia Cass. in Bull. Sci. Soc. Philom. Paris 1818: 33. 1818", p.getHeterotypicalGroupSynonymName(1, 1));
54
        List<TypeDesignationElement> heterotypicalGroupTypeDesignations = p.getHeterotypicalGroupTypeDesignations(1);
55
        assertEquals("Type: Gelasia villosa (Scop.) Cass.", heterotypicalGroupTypeDesignations.get(0).getText());
56
        assertEquals(TypeDesignationType.nameTypeDesignation, heterotypicalGroupTypeDesignations.get(0).getTypeDesignationType());
57

  
58
//        test case only available in produciton portal
59
//        assertEquals("≡ Scorzonera subg. Lasiospora (Cass.) Peterm., Deutschl. Fl.: 334. 1846-1849", p.getHeterotypicalGroupSynonymName(2, 3));
60
//        heterotypicalGroupTypeDesignations = p.getHeterotypicalGroupTypeDesignations(2);
61
//        assertEquals("Lectotype (designated by Tzvelev 1989: 452): Lasiospora hirsuta (Gouan) Cass.", heterotypicalGroupTypeDesignations.get(0).getText());
62
//        assertEquals(TypeDesignationType.nameTypeDesignation, heterotypicalGroupTypeDesignations.get(0).getTypeDesignationType());
63
//        assertEquals("Should have one foot note", 1, p.getHeterotypicalGroupFootNotes(2).size()); // FIXME
64

  
65

  
66
        // also to some synonymy checks
67
        assertEquals("– Scorzonera sect. Euscorzonera DC., Prodr. 7: 117. 1838, nom. inval.", p.getHeterotypicalGroupSynonymName(58, 1));
68
        assertEquals("– Scorzonera subsect. Euvierhapperia Lipsch., Fragm. Monogr. Scorzonera 2: 89. 1939, nom. inval.", p.getHeterotypicalGroupSynonymName(59, 1));
69
    }
70
}
7.x/modules/cdm_dataportal/theme/cdm_dataportal.name.theme
101 101
function theme_cdm_typedesignations($variables) {
102 102
  $typeDesignations = $variables['typeDesignations'];
103 103

  
104
  // need to add element to render path since type designations
105
  // need other name render template
106
  RenderHints::pushToRenderStack('typedesignations');
104 107
  $out = '<ul class="typeDesignations">';
105 108
  $typeDesignation_footnotes = FALSE;
106 109
  $is_lectotype = FALSE;
......
206 209

  
207 210
  $out .= '</ul>';
208 211

  
212
  RenderHints::popFromRenderStack();
213

  
209 214
  return $out;
210 215
}
211 216

  

Also available in: Unified diff