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.BaseElement;
|
23
|
import eu.etaxonomy.dataportal.elements.FeatureBlock;
|
24
|
import eu.etaxonomy.dataportal.elements.LinkElement;
|
25
|
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
|
26
|
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
|
27
|
import eu.etaxonomy.dataportal.pages.TaxonProfilePage;
|
28
|
import eu.etaxonomy.dataportal.pages.TaxonSynonymyPage;
|
29
|
|
30
|
/**
|
31
|
*
|
32
|
* @author a.kohlbecker
|
33
|
*
|
34
|
*/
|
35
|
|
36
|
@DataPortalContexts( { DataPortalContext.cichorieae })
|
37
|
public class Cichorieae_CommonNamesTest extends CdmDataPortalTestBase{
|
38
|
|
39
|
|
40
|
static UUID lactuca_serriola_uuid = UUID.fromString("85176c77-e4b6-4899-a08b-e257ab09350a");
|
41
|
|
42
|
|
43
|
/**
|
44
|
* regression test for issue ##3160 (Cichorieae Portal: Common names not correctly ordered)
|
45
|
*
|
46
|
* @throws MalformedURLException
|
47
|
*/
|
48
|
@Test
|
49
|
public void lactuca_serriola() throws MalformedURLException {
|
50
|
TaxonProfilePage p = new TaxonProfilePage(driver, getContext(), lactuca_serriola_uuid);
|
51
|
String expectedName = "Lactuca serriola";
|
52
|
assertEquals(getContext().prepareTitle(expectedName), p.getTitle());
|
53
|
FeatureBlock commonNamesBlock = p.getFeatureBlockAt(3, "common_names", "div", "span");
|
54
|
assertNotNull(commonNamesBlock);
|
55
|
|
56
|
// 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";
|
57
|
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";
|
58
|
String firstChars = commonNamesBlock.getText().substring(0, expected.length());
|
59
|
|
60
|
assertEquals(expected, firstChars);
|
61
|
}
|
62
|
|
63
|
}
|