1
|
/**
|
2
|
* Copyright (C) 2011 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 java.util.List;
|
12
|
|
13
|
import org.apache.log4j.Level;
|
14
|
import org.openqa.selenium.By;
|
15
|
import org.openqa.selenium.NoSuchElementException;
|
16
|
import org.openqa.selenium.WebElement;
|
17
|
|
18
|
|
19
|
/**
|
20
|
* @author andreas
|
21
|
* @since Jul 4, 2011
|
22
|
*
|
23
|
*/
|
24
|
public class DrupalBlock extends BaseElement {
|
25
|
|
26
|
private String header;
|
27
|
|
28
|
protected WebElement content;
|
29
|
|
30
|
protected List<WebElement> featureBlockelements;
|
31
|
|
32
|
|
33
|
public DrupalBlock(WebElement element) {
|
34
|
|
35
|
super(element);
|
36
|
|
37
|
logger.setLevel(Level.TRACE);
|
38
|
logger.trace("DrupalBlock() - constructor after super()");
|
39
|
|
40
|
content = element.findElement(By.className("content"));
|
41
|
featureBlockelements = element.findElements(By.className("feature-block-elements"));
|
42
|
|
43
|
logger.trace("DrupalBlock() - block content loaded");
|
44
|
try {
|
45
|
WebElement headerElement = element.findElement(By.tagName("h2"));
|
46
|
header = headerElement.getText();
|
47
|
logger.trace("DrupalBlock() - header text ready");
|
48
|
} catch (NoSuchElementException e){
|
49
|
// IGNORE //
|
50
|
}
|
51
|
}
|
52
|
|
53
|
public String getHeader() {
|
54
|
return header;
|
55
|
}
|
56
|
|
57
|
public WebElement getContent() {
|
58
|
return content;
|
59
|
}
|
60
|
|
61
|
public List<WebElement> getFeatureBlockElements() {
|
62
|
return featureBlockelements;
|
63
|
}
|
64
|
|
65
|
}
|