Project

General

Profile

Download (1.45 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2012 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.elements;
11

    
12
import org.openqa.selenium.By;
13
import org.openqa.selenium.NoSuchElementException;
14
import org.openqa.selenium.WebElement;
15

    
16
/**
17
 * @author andreas
18
 * @date Jul 30, 2012
19
 *
20
 */
21
public class TypeDesignationElement extends BaseElement {
22

    
23
    private final WebElement status;
24

    
25
    private WebElement nameDescription = null;
26

    
27
    private final TypeDesignationType typeDesignationType;
28

    
29
    public TypeDesignationElement(WebElement element) {
30
        super(element);
31
        status = element.findElement(By.cssSelector(".status"));
32
        try {
33
            nameDescription = element.findElement(By.cssSelector(".description"));
34
        } catch (NoSuchElementException e) {
35
            // IGNORE
36
        }
37
        typeDesignationType = TypeDesignationType.valueOf(element.getAttribute("class"));
38
    }
39

    
40
    public String statusToString(){
41
        return status.getText();
42
    }
43

    
44
    public TypeDesignationType getTypeDesignationType() {
45
        return typeDesignationType;
46
    }
47

    
48
    /**
49
     * contains nomenclatorical status, protologues, etc.
50
     *
51
     * @return the nameDescription
52
     */
53
    public WebElement getNameDescription() {
54
        return nameDescription;
55
    }
56

    
57
}
(14-14/15)