Project

General

Profile

Download (3.62 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.assertEquals;
13
import static org.junit.Assert.assertNotNull;
14

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

    
18
import org.junit.Test;
19

    
20
import eu.etaxonomy.dataportal.DataPortalContext;
21
import eu.etaxonomy.dataportal.elements.FeatureBlock;
22
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
23
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
24
import eu.etaxonomy.dataportal.pages.TaxonProfilePage;
25

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

    
32
@DataPortalContexts( { DataPortalContext.cichorieae })
33
public class Cichorieae_CommonNamesTest extends CdmDataPortalTestBase{
34

    
35

    
36
    static UUID lactuca_serriola_uuid = UUID.fromString("85176c77-e4b6-4899-a08b-e257ab09350a");
37

    
38

    
39
    /**
40
     * regression test for issue ##3160 (Cichorieae Portal: Common names not correctly ordered)
41
     *
42
     * @throws MalformedURLException
43
     */
44
    @Test
45
    public void lactuca_serriola() throws MalformedURLException {
46
        TaxonProfilePage p = new TaxonProfilePage(driver, getContext(), lactuca_serriola_uuid);
47
        String expectedName = "Lactuca serriola";
48
        assertEquals(getContext().prepareTitle(expectedName), p.getTitle());
49
        FeatureBlock commonNamesBlock = p.getFeatureBlockAt(3, "common_names", "div", "span");
50
        assertNotNull(commonNamesBlock);
51

    
52
//        no longer valid since 2012-11-19: String expected = "Common names\nlechuguilla145, escariola145; Albanian (Albania): Ogrisht146; Arabic (Lebanon): خَسّ الزَّيْت147; Arabic (Saudi Arabia): Khass-al-Hammar148; Arabic (Syria): خَسّ الزَّيْت149; Armenian (Armenia): Կաթնուկ կողմնացույց150; Bulgarian (Bulgaria): Компасна салата151; Czech (Czech Republic): Locika kompasová152; Danish (Denmark): Tornet Salat153; English (Australia): compass plant154, Prickly Lettuce155, Prickly Lettuce156, Prickly Lettuce157, Prickly Lettuce158, compass plant159";
53
//        no longer valid since 2013-06-27, sorting and merging implemented: String expected = "Common names\nlechuguilla144, escariola144; Albanian (Albania): Ogrisht145; Arabic (Lebanon): خَسّ الزَّيْت146; Arabic (Saudi Arabia): Khass-al-Hammar147; Arabic (Syria): خَسّ الزَّيْت148; Armenian (Armenia): Կաթնուկ կողմնացույց149; Bulgarian (Bulgaria): Компасна салата150; Czech (Czech Republic): Locika kompasová151; Danish (Denmark): Tornet Salat152; English (Australia): compass plant153, Prickly Lettuce154, Prickly Lettuce155, Prickly Lettuce156, Prickly Lettuce157, compass plant158";
54
        String expected = "Common names\nescariola144, lechuguilla144; Albanian (Albania): Ogrisht145; Arabic (Lebanon): خَسّ الزَّيْت146; Arabic (Saudi Arabia): Khass-al-Hammar147; Arabic (Syria): خَسّ الزَّيْت148; Armenian (Armenia): Կաթնուկ կողմնացույց149; Bulgarian (Bulgaria): Компасна салата150; Czech (Czech Republic): Locika kompasová151; Danish (Denmark): Tornet Salat152; English (Australia): Prickly Lettuce153,154,155,156,157,158,159, Prickly lettuce160,161, compass plant160,161, milk thistle160,161";
55
        String firstChars = commonNamesBlock.getText().substring(0, expected.length());
56

    
57
        assertEquals(expected, firstChars);
58
    }
59

    
60
}
(1-1/10)