9 |
9 |
*/
|
10 |
10 |
package eu.etaxonomy.dataportal.selenium.tests.cichorieae;
|
11 |
11 |
|
12 |
|
import static org.junit.Assert.assertEquals;
|
13 |
|
import static org.junit.Assert.assertNotNull;
|
|
12 |
import static org.junit.Assert.*;
|
14 |
13 |
|
15 |
14 |
import java.net.MalformedURLException;
|
|
15 |
import java.util.List;
|
16 |
16 |
import java.util.UUID;
|
17 |
17 |
|
18 |
18 |
import org.junit.Test;
|
19 |
19 |
|
20 |
20 |
import eu.etaxonomy.dataportal.DataPortalContext;
|
|
21 |
import eu.etaxonomy.dataportal.elements.BaseElement;
|
21 |
22 |
import eu.etaxonomy.dataportal.elements.FeatureBlock;
|
22 |
23 |
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
|
23 |
24 |
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
|
... | ... | |
46 |
47 |
TaxonProfilePage p = new TaxonProfilePage(driver, getContext(), lactuca_serriola_uuid);
|
47 |
48 |
String expectedName = "Lactuca serriola";
|
48 |
49 |
assertEquals(getContext().prepareTitle(expectedName), p.getTitle());
|
|
50 |
|
|
51 |
FeatureBlock distributionBlock = p.getFeatureBlockAt(2, "distribution", "div", "dd");
|
|
52 |
assertNotNull(distributionBlock);
|
|
53 |
|
|
54 |
List<BaseElement> footnotes = distributionBlock.getFootNotes();
|
|
55 |
assertTrue("footnotes must not be empty", footnotes.size() > 0);
|
|
56 |
// testing for the duplicate footnotes named below in the FIXME (related to #4383 )
|
|
57 |
assertEquals("40. Komarov, V. L., Flora SSSR 29. 1964", footnotes.get(39).getText());
|
|
58 |
assertEquals("43. Komarov, V. L., Flora SSSR 29. 1964 (as Lactuca altaica)", footnotes.get(42).getText());
|
|
59 |
|
|
60 |
|
49 |
61 |
FeatureBlock commonNamesBlock = p.getFeatureBlockAt(3, "common_names", "div", "span");
|
50 |
62 |
assertNotNull(commonNamesBlock);
|
51 |
63 |
|
... | ... | |
55 |
67 |
// no longer valid since 2013-11-21 (#3475 fixed) String expected = "Common names\n(Mexico): escariola150, lechuguilla150; Albanian (Albania): Ogrisht151; Arabic (Lebanon): خَسّ الزَّيْت152; Arabic (Saudi Arabia): Khass-al-Hammar153; Arabic (Syria): خَسّ الزَّيْت154; Armenian (Armenia): Կաթնուկ կողմնացույց155; Bulgarian (Bulgaria): Компасна салата156; Czech (Czech Republic): Locika kompasová157; Danish (Denmark): Tornet Salat158; English (Australia): Prickly Lettuce159,160,161,162,163,164,165, Prickly lettuce166,167, compass plant166,167, milk thistle166,167";
|
56 |
68 |
// no longer valid since 2013-12-06 implementing rule 2 and 3 for #3904 String expected = "Common names\n(Mexico): escariola156, lechuguilla156; Albanian (Albania): Ogrisht157; Arabic (Lebanon): خَسّ الزَّيْت158; Arabic (Saudi Arabia): Khass-al-Hammar159; Arabic (Syria): خَسّ الزَّيْت160; Armenian (Armenia): Կաթնուկ կողմնացույց161; Bulgarian (Bulgaria): Компасна салата162; Czech (Czech Republic): Locika kompasová163; Danish (Denmark): Tornet Salat164; English (Australia): Prickly Lettuce165,166,167,168,169,170,171, Prickly lettuce172,173, compass plant172,173, milk thistle172,173";
|
57 |
69 |
// no longer valid since 2014-08-27 fixing #3915 String expected = "Common names\n(Mexico): escariola153, lechuguilla153; Albanian (Albania): Ogrisht154; Arabic (Lebanon): خَسّ الزَّيْت155; Arabic (Saudi Arabia): Khass-al-Hammar156; Arabic (Syria): خَسّ الزَّيْت157; Armenian (Armenia): Կաթնուկ կողմնացույց158; Bulgarian (Bulgaria): Компасна салата159; Czech (Czech Republic): Locika kompasová160; Danish (Denmark): Tornet Salat161; English (Australia): Prickly Lettuce162,163,164,165,166,167,168, Prickly lettuce169,170, compass plant169,170, milk thistle169,170";
|
58 |
|
String expected = "Common names\n(Mexico): escariola155, lechuguilla155; Albanian (Albania): Ogrisht156,157; Arabic (Lebanon): خَسّ الزَّيْت156,158; Arabic (Saudi Arabia): Khass-al-Hammar159; Arabic (Syria): خَسّ الزَّيْت156,160; Armenian (Armenia): Կաթնուկ կողմնացույց156,161; Bulgarian (Bulgaria): Компасна салата156,162; Czech (Czech Republic): Locika kompasová156,163; Danish (Denmark): Tornet Salat156,164; English (Australia): Prickly Lettuce165,166,167,168,169,170,171, Prickly lettuce172,173, compass plant";
|
|
70 |
|
|
71 |
// FIXME the distribution entries have duplicate foonote key for source references, see #4383 (references in bibliography need de-duplication)
|
|
72 |
// for example "40. Komarov, V. L., Flora SSSR 29. 1964", and "43. Komarov, V. L., Flora SSSR 29. 1964 (as Lactuca altaica)"
|
|
73 |
// this is why the Common name footnote keys are having an offset, the below out-commented string should be the correct one:
|
|
74 |
// String expected = "Common names\n(Mexico): escariola155, lechuguilla155; Albanian (Albania): Ogrisht156,157; Arabic (Lebanon): خَسّ الزَّيْت156,158; Arabic (Saudi Arabia): Khass-al-Hammar159; Arabic (Syria): خَسّ الزَّيْت156,160; Armenian (Armenia): Կաթնուկ կողմնացույց156,161; Bulgarian (Bulgaria): Компасна салата156,162; Czech (Czech Republic): Locika kompasová156,163; Danish (Denmark): Tornet Salat156,164; English (Australia): Prickly Lettuce165,166,167,168,169,170,171, Prickly lettuce172,173, compass plant";
|
|
75 |
String expected = "Common names\n(Mexico): escariola168, lechuguilla168; Albanian (Albania): Ogrisht169,170; Arabic (Lebanon): خَسّ الزَّيْت169,171; Arabic (Saudi Arabia): Khass-al-Hammar172; Arabic (Syria): خَسّ الزَّيْت169,173; Armenian (Armenia): Կաթնուկ կողմնացույց169,174; Bulgarian (Bulgaria): Компасна салата169,175; Czech (Czech Republic): Locika kompasová169,176; Danish (Denmark): Tornet Salat169,177; English (Australia): Prickly Lettuce178,179,180,181,182,183,184, Prickly lettuce185,186, compass plant";
|
59 |
76 |
String firstChars = commonNamesBlock.getText().substring(0, expected.length());
|
60 |
77 |
|
61 |
78 |
assertEquals(expected, firstChars);
|
adapting existing tests and adding a new one to reproduce #4383 (references in bibliography need de-duplication)