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;
|
11
|
|
12
|
import java.util.List;
|
13
|
|
14
|
import org.junit.Assert;
|
15
|
import org.junit.Test;
|
16
|
import org.openqa.selenium.support.PageFactory;
|
17
|
|
18
|
import eu.etaxonomy.dataportal.DataPortalContext;
|
19
|
import eu.etaxonomy.dataportal.elements.ImgElement;
|
20
|
import eu.etaxonomy.dataportal.elements.LinkElement;
|
21
|
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
|
22
|
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
|
23
|
import eu.etaxonomy.dataportal.pages.TaxonProfilePage;
|
24
|
|
25
|
/**
|
26
|
* @author a.kohlbecker
|
27
|
*
|
28
|
*/
|
29
|
|
30
|
@DataPortalContexts( { DataPortalContext.cyprus })
|
31
|
public class CyprusTaxonProfileTest extends CdmDataPortalTestBase{
|
32
|
|
33
|
@Test
|
34
|
public void allium_guttatum_subsp_guttatum(){
|
35
|
|
36
|
String pageUrlString = getBaseUrl() + "?q=cdm_dataportal/taxon/6d04598b-3852-4038-91c9-13c7581b21a6";
|
37
|
driver.get(pageUrlString);
|
38
|
TaxonProfilePage p = PageFactory.initElements(driver, TaxonProfilePage.class);
|
39
|
|
40
|
Assert.assertEquals(prepareTitle("Allium guttatum subsp. guttatum"), p.getTitle());
|
41
|
|
42
|
List<LinkElement> primaryTabs = p.getPrimaryTabs();
|
43
|
Assert.assertEquals("Expecting 3 tabs", 3, primaryTabs.size());
|
44
|
Assert.assertEquals("General", primaryTabs.get(0).getText());
|
45
|
Assert.assertEquals("Synonymy", primaryTabs.get(1).getText());
|
46
|
Assert.assertEquals("Images", primaryTabs.get(2).getText());
|
47
|
|
48
|
ImgElement profileImage = p.getProfileImage();
|
49
|
Assert.assertNotNull("Expecting profile images to be switched on", profileImage);
|
50
|
Assert.assertEquals("http://media.bgbm.org/erez/erez?src=EditWP6/zypern/photos/Allium_guttatum_guttatum_A1.jpg", profileImage.getUrl().toString());
|
51
|
Assert.assertEquals(400, profileImage.getDimension().getHeight(), 0.5);
|
52
|
Assert.assertEquals(250, profileImage.getDimension().getWidth(), 0.5);
|
53
|
|
54
|
|
55
|
}
|
56
|
|
57
|
}
|