Project

General

Profile

Download (2.28 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2020 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.dataportal.selenium.tests.reference;
10

    
11
import java.io.IOException;
12
import java.net.MalformedURLException;
13
import java.util.List;
14
import java.util.UUID;
15

    
16
import org.apache.log4j.Level;
17
import org.apache.log4j.Logger;
18
import org.junit.Before;
19
import org.junit.Test;
20
import org.openqa.selenium.By;
21
import org.openqa.selenium.WebElement;
22

    
23
import eu.etaxonomy.dataportal.DataPortalSite;
24
import eu.etaxonomy.dataportal.DrupalVars;
25
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
26
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
27
import eu.etaxonomy.dataportal.pages.TaxonPage;
28
import eu.etaxonomy.drush.DrushExecuter;
29

    
30
/**
31
 * @author a.kohlbecker
32
 * @since Aug 11, 2020
33
 */
34
@DataPortalContexts( { DataPortalSite.reference })
35
public class SpecimensTopDownViewTest extends CdmDataPortalTestBase {
36

    
37
    private static final UUID glenodinium_apiculatum_t = UUID.fromString("d245083e-3bda-435f-9bb3-bdc2249ff23c");
38

    
39
    @Before
40
    public void switchToView() throws IOException, InterruptedException {
41
        Logger.getLogger(DrushExecuter.class).setLevel(Level.DEBUG);
42
        setDrupalVar(DrupalVars.CDM_DATAPORTAL_TAXONPAGE_TABS, "1");
43
        setDrupalVar(DrupalVars.CDM_SPECIMEN_LIST_VIEW_MODE, "derivate_path");
44
    }
45

    
46
    @Test
47
    public void test1() throws MalformedURLException {
48
        TaxonPage p = new TaxonPage(driver, getContext(), glenodinium_apiculatum_t, "specimens");
49
        WebElement specimensTable = p.getDataPortalContent().getElement().findElement(By.cssSelector("#specimans table.specimens"));
50
        List<WebElement> rows = specimensTable.findElements(By.tagName("tr"));
51
        assertEquals(3, rows.size());
52
        assertEquals("Epitype: Germany, Berlin, 52°31'1.2\"N, 13°21'E, 28.3.2016, D047 (CEDiT 2017E68).", rows.get(0).getText());
53
        assertEquals("Isolectotype: Germany, Berlin, 52°31'1.2\"N, 13°21'E, 28.3.2016, D047 (M M-0289351).", rows.get(1).getText());
54
        assertEquals("Lectotype: -title cache generation not implemented-", rows.get(2).getText());
55

    
56

    
57

    
58

    
59
    }
60

    
61
}
(9-9/11)