1
|
/**
|
2
|
* Copyright (C) 2012 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.elements;
|
10
|
|
11
|
import org.openqa.selenium.By;
|
12
|
import org.openqa.selenium.NoSuchElementException;
|
13
|
import org.openqa.selenium.WebElement;
|
14
|
|
15
|
/**
|
16
|
* @author andreas
|
17
|
* @date Jul 30, 2012
|
18
|
*
|
19
|
*/
|
20
|
public class TypeDesignationElement extends BaseElement {
|
21
|
|
22
|
private final WebElement status;
|
23
|
|
24
|
private WebElement nameDescription = null;
|
25
|
|
26
|
private final TypeDesignationType typeDesignationType;
|
27
|
|
28
|
public TypeDesignationElement(WebElement element) {
|
29
|
super(element);
|
30
|
status = element.findElement(By.cssSelector(".status"));
|
31
|
try {
|
32
|
nameDescription = element.findElement(By.cssSelector(".description"));
|
33
|
} catch (NoSuchElementException e) {
|
34
|
// IGNORE
|
35
|
}
|
36
|
typeDesignationType = TypeDesignationType.valueOf(element.getAttribute("class"));
|
37
|
}
|
38
|
|
39
|
public String statusToString(){
|
40
|
return status.getText();
|
41
|
}
|
42
|
|
43
|
public TypeDesignationType getTypeDesignationType() {
|
44
|
return typeDesignationType;
|
45
|
}
|
46
|
|
47
|
/**
|
48
|
* contains nomenclatorical status, protologues, etc.
|
49
|
*
|
50
|
* @return the nameDescription
|
51
|
*/
|
52
|
public WebElement getNameDescription() {
|
53
|
return nameDescription;
|
54
|
}
|
55
|
|
56
|
}
|